Initial deployment with all files and images
Browse files- .dockerignore +7 -0
- .gitattributes +3 -0
- .ipynb_checkpoints/Crop Classification With Recommendation System-checkpoint.ipynb +1907 -0
- Crop Classification With Recommendation System.ipynb +1795 -0
- Crop_recommendation.csv +0 -0
- Dockerfile +17 -0
- README.md +26 -4
- app.py +82 -0
- config.py +2 -0
- crop22_powerbi.pbix +0 -0
- crop2_powerbi.pbix +0 -0
- git +0 -0
- image_utils.py +22 -0
- minmaxscaler.pkl +3 -0
- model.pkl +3 -0
- requirements.txt +6 -0
- standscaler.pkl +3 -0
- static/apple.jpg +3 -0
- static/bananan.jpg +3 -0
- static/banner.png +3 -0
- static/black.jpg +3 -0
- static/chik.jpg +3 -0
- static/coconut.jpg +3 -0
- static/coffe.jpg +3 -0
- static/cotton.jpg +3 -0
- static/crop.png +3 -0
- static/cropp.jpg +3 -0
- static/grapes.jpg +3 -0
- static/jute.jpg +3 -0
- static/kidney.jpg +3 -0
- static/lent.jpg +3 -0
- static/logo.png +3 -0
- static/maize.jpg +3 -0
- static/mango.jpg +3 -0
- static/moth.jpg +3 -0
- static/mung.jpg +3 -0
- static/muskmelon].jpg +3 -0
- static/orange.jpg +3 -0
- static/papaya.jpg +3 -0
- static/peas.jpg +3 -0
- static/pomo.jpg +3 -0
- static/rice.jpg +3 -0
- static/watermelon.jpg +3 -0
- templates/home.html +812 -0
- templates/info.html +218 -0
- templates/recommendation.html +239 -0
.dockerignore
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__pycache__
|
| 2 |
+
*.pyc
|
| 3 |
+
.git
|
| 4 |
+
.gitignore
|
| 5 |
+
.env
|
| 6 |
+
*.md
|
| 7 |
+
!README.md
|
.gitattributes
CHANGED
|
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
.ipynb_checkpoints/Crop Classification With Recommendation System-checkpoint.ipynb
ADDED
|
@@ -0,0 +1,1907 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cells": [
|
| 3 |
+
{
|
| 4 |
+
"cell_type": "markdown",
|
| 5 |
+
"id": "6bdfd636",
|
| 6 |
+
"metadata": {},
|
| 7 |
+
"source": [
|
| 8 |
+
"# Import Libaries"
|
| 9 |
+
]
|
| 10 |
+
},
|
| 11 |
+
{
|
| 12 |
+
"cell_type": "code",
|
| 13 |
+
"execution_count": 1,
|
| 14 |
+
"id": "7bee9b73",
|
| 15 |
+
"metadata": {},
|
| 16 |
+
"outputs": [
|
| 17 |
+
{
|
| 18 |
+
"name": "stderr",
|
| 19 |
+
"output_type": "stream",
|
| 20 |
+
"text": [
|
| 21 |
+
"C:\\Users\\Noor Saeed\\anaconda3\\lib\\site-packages\\pandas\\core\\computation\\expressions.py:21: UserWarning: Pandas requires version '2.8.4' or newer of 'numexpr' (version '2.8.1' currently installed).\n",
|
| 22 |
+
" from pandas.core.computation.check import NUMEXPR_INSTALLED\n",
|
| 23 |
+
"C:\\Users\\Noor Saeed\\anaconda3\\lib\\site-packages\\pandas\\core\\arrays\\masked.py:60: UserWarning: Pandas requires version '1.3.6' or newer of 'bottleneck' (version '1.3.4' currently installed).\n",
|
| 24 |
+
" from pandas.core import (\n"
|
| 25 |
+
]
|
| 26 |
+
}
|
| 27 |
+
],
|
| 28 |
+
"source": [
|
| 29 |
+
"import numpy as np\n",
|
| 30 |
+
"import pandas as pd"
|
| 31 |
+
]
|
| 32 |
+
},
|
| 33 |
+
{
|
| 34 |
+
"cell_type": "markdown",
|
| 35 |
+
"id": "2822305c",
|
| 36 |
+
"metadata": {},
|
| 37 |
+
"source": [
|
| 38 |
+
"# Importing Data"
|
| 39 |
+
]
|
| 40 |
+
},
|
| 41 |
+
{
|
| 42 |
+
"cell_type": "code",
|
| 43 |
+
"execution_count": 2,
|
| 44 |
+
"id": "5b6f8884",
|
| 45 |
+
"metadata": {},
|
| 46 |
+
"outputs": [
|
| 47 |
+
{
|
| 48 |
+
"data": {
|
| 49 |
+
"text/html": [
|
| 50 |
+
"<div>\n",
|
| 51 |
+
"<style scoped>\n",
|
| 52 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 53 |
+
" vertical-align: middle;\n",
|
| 54 |
+
" }\n",
|
| 55 |
+
"\n",
|
| 56 |
+
" .dataframe tbody tr th {\n",
|
| 57 |
+
" vertical-align: top;\n",
|
| 58 |
+
" }\n",
|
| 59 |
+
"\n",
|
| 60 |
+
" .dataframe thead th {\n",
|
| 61 |
+
" text-align: right;\n",
|
| 62 |
+
" }\n",
|
| 63 |
+
"</style>\n",
|
| 64 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 65 |
+
" <thead>\n",
|
| 66 |
+
" <tr style=\"text-align: right;\">\n",
|
| 67 |
+
" <th></th>\n",
|
| 68 |
+
" <th>N</th>\n",
|
| 69 |
+
" <th>P</th>\n",
|
| 70 |
+
" <th>K</th>\n",
|
| 71 |
+
" <th>temperature</th>\n",
|
| 72 |
+
" <th>humidity</th>\n",
|
| 73 |
+
" <th>ph</th>\n",
|
| 74 |
+
" <th>rainfall</th>\n",
|
| 75 |
+
" <th>label</th>\n",
|
| 76 |
+
" </tr>\n",
|
| 77 |
+
" </thead>\n",
|
| 78 |
+
" <tbody>\n",
|
| 79 |
+
" <tr>\n",
|
| 80 |
+
" <th>0</th>\n",
|
| 81 |
+
" <td>90</td>\n",
|
| 82 |
+
" <td>42</td>\n",
|
| 83 |
+
" <td>43</td>\n",
|
| 84 |
+
" <td>20.879744</td>\n",
|
| 85 |
+
" <td>82.002744</td>\n",
|
| 86 |
+
" <td>6.502985</td>\n",
|
| 87 |
+
" <td>202.935536</td>\n",
|
| 88 |
+
" <td>rice</td>\n",
|
| 89 |
+
" </tr>\n",
|
| 90 |
+
" <tr>\n",
|
| 91 |
+
" <th>1</th>\n",
|
| 92 |
+
" <td>85</td>\n",
|
| 93 |
+
" <td>58</td>\n",
|
| 94 |
+
" <td>41</td>\n",
|
| 95 |
+
" <td>21.770462</td>\n",
|
| 96 |
+
" <td>80.319644</td>\n",
|
| 97 |
+
" <td>7.038096</td>\n",
|
| 98 |
+
" <td>226.655537</td>\n",
|
| 99 |
+
" <td>rice</td>\n",
|
| 100 |
+
" </tr>\n",
|
| 101 |
+
" <tr>\n",
|
| 102 |
+
" <th>2</th>\n",
|
| 103 |
+
" <td>60</td>\n",
|
| 104 |
+
" <td>55</td>\n",
|
| 105 |
+
" <td>44</td>\n",
|
| 106 |
+
" <td>23.004459</td>\n",
|
| 107 |
+
" <td>82.320763</td>\n",
|
| 108 |
+
" <td>7.840207</td>\n",
|
| 109 |
+
" <td>263.964248</td>\n",
|
| 110 |
+
" <td>rice</td>\n",
|
| 111 |
+
" </tr>\n",
|
| 112 |
+
" <tr>\n",
|
| 113 |
+
" <th>3</th>\n",
|
| 114 |
+
" <td>74</td>\n",
|
| 115 |
+
" <td>35</td>\n",
|
| 116 |
+
" <td>40</td>\n",
|
| 117 |
+
" <td>26.491096</td>\n",
|
| 118 |
+
" <td>80.158363</td>\n",
|
| 119 |
+
" <td>6.980401</td>\n",
|
| 120 |
+
" <td>242.864034</td>\n",
|
| 121 |
+
" <td>rice</td>\n",
|
| 122 |
+
" </tr>\n",
|
| 123 |
+
" <tr>\n",
|
| 124 |
+
" <th>4</th>\n",
|
| 125 |
+
" <td>78</td>\n",
|
| 126 |
+
" <td>42</td>\n",
|
| 127 |
+
" <td>42</td>\n",
|
| 128 |
+
" <td>20.130175</td>\n",
|
| 129 |
+
" <td>81.604873</td>\n",
|
| 130 |
+
" <td>7.628473</td>\n",
|
| 131 |
+
" <td>262.717340</td>\n",
|
| 132 |
+
" <td>rice</td>\n",
|
| 133 |
+
" </tr>\n",
|
| 134 |
+
" </tbody>\n",
|
| 135 |
+
"</table>\n",
|
| 136 |
+
"</div>"
|
| 137 |
+
],
|
| 138 |
+
"text/plain": [
|
| 139 |
+
" N P K temperature humidity ph rainfall label\n",
|
| 140 |
+
"0 90 42 43 20.879744 82.002744 6.502985 202.935536 rice\n",
|
| 141 |
+
"1 85 58 41 21.770462 80.319644 7.038096 226.655537 rice\n",
|
| 142 |
+
"2 60 55 44 23.004459 82.320763 7.840207 263.964248 rice\n",
|
| 143 |
+
"3 74 35 40 26.491096 80.158363 6.980401 242.864034 rice\n",
|
| 144 |
+
"4 78 42 42 20.130175 81.604873 7.628473 262.717340 rice"
|
| 145 |
+
]
|
| 146 |
+
},
|
| 147 |
+
"execution_count": 2,
|
| 148 |
+
"metadata": {},
|
| 149 |
+
"output_type": "execute_result"
|
| 150 |
+
}
|
| 151 |
+
],
|
| 152 |
+
"source": [
|
| 153 |
+
"crop = pd.read_csv(\"Crop_recommendation.csv\")\n",
|
| 154 |
+
"crop.head()"
|
| 155 |
+
]
|
| 156 |
+
},
|
| 157 |
+
{
|
| 158 |
+
"cell_type": "markdown",
|
| 159 |
+
"id": "e9ddfb22",
|
| 160 |
+
"metadata": {},
|
| 161 |
+
"source": [
|
| 162 |
+
"# Asq Six Question to yourself"
|
| 163 |
+
]
|
| 164 |
+
},
|
| 165 |
+
{
|
| 166 |
+
"cell_type": "code",
|
| 167 |
+
"execution_count": 3,
|
| 168 |
+
"id": "3ca70c00",
|
| 169 |
+
"metadata": {},
|
| 170 |
+
"outputs": [
|
| 171 |
+
{
|
| 172 |
+
"data": {
|
| 173 |
+
"text/plain": [
|
| 174 |
+
"(2200, 8)"
|
| 175 |
+
]
|
| 176 |
+
},
|
| 177 |
+
"execution_count": 3,
|
| 178 |
+
"metadata": {},
|
| 179 |
+
"output_type": "execute_result"
|
| 180 |
+
}
|
| 181 |
+
],
|
| 182 |
+
"source": [
|
| 183 |
+
"crop.shape"
|
| 184 |
+
]
|
| 185 |
+
},
|
| 186 |
+
{
|
| 187 |
+
"cell_type": "code",
|
| 188 |
+
"execution_count": 4,
|
| 189 |
+
"id": "e2ae9b60",
|
| 190 |
+
"metadata": {},
|
| 191 |
+
"outputs": [
|
| 192 |
+
{
|
| 193 |
+
"name": "stdout",
|
| 194 |
+
"output_type": "stream",
|
| 195 |
+
"text": [
|
| 196 |
+
"<class 'pandas.core.frame.DataFrame'>\n",
|
| 197 |
+
"RangeIndex: 2200 entries, 0 to 2199\n",
|
| 198 |
+
"Data columns (total 8 columns):\n",
|
| 199 |
+
" # Column Non-Null Count Dtype \n",
|
| 200 |
+
"--- ------ -------------- ----- \n",
|
| 201 |
+
" 0 N 2200 non-null int64 \n",
|
| 202 |
+
" 1 P 2200 non-null int64 \n",
|
| 203 |
+
" 2 K 2200 non-null int64 \n",
|
| 204 |
+
" 3 temperature 2200 non-null float64\n",
|
| 205 |
+
" 4 humidity 2200 non-null float64\n",
|
| 206 |
+
" 5 ph 2200 non-null float64\n",
|
| 207 |
+
" 6 rainfall 2200 non-null float64\n",
|
| 208 |
+
" 7 label 2200 non-null object \n",
|
| 209 |
+
"dtypes: float64(4), int64(3), object(1)\n",
|
| 210 |
+
"memory usage: 137.6+ KB\n"
|
| 211 |
+
]
|
| 212 |
+
}
|
| 213 |
+
],
|
| 214 |
+
"source": [
|
| 215 |
+
"crop.info()"
|
| 216 |
+
]
|
| 217 |
+
},
|
| 218 |
+
{
|
| 219 |
+
"cell_type": "code",
|
| 220 |
+
"execution_count": 5,
|
| 221 |
+
"id": "9efad4c4",
|
| 222 |
+
"metadata": {},
|
| 223 |
+
"outputs": [
|
| 224 |
+
{
|
| 225 |
+
"data": {
|
| 226 |
+
"text/plain": [
|
| 227 |
+
"N 0\n",
|
| 228 |
+
"P 0\n",
|
| 229 |
+
"K 0\n",
|
| 230 |
+
"temperature 0\n",
|
| 231 |
+
"humidity 0\n",
|
| 232 |
+
"ph 0\n",
|
| 233 |
+
"rainfall 0\n",
|
| 234 |
+
"label 0\n",
|
| 235 |
+
"dtype: int64"
|
| 236 |
+
]
|
| 237 |
+
},
|
| 238 |
+
"execution_count": 5,
|
| 239 |
+
"metadata": {},
|
| 240 |
+
"output_type": "execute_result"
|
| 241 |
+
}
|
| 242 |
+
],
|
| 243 |
+
"source": [
|
| 244 |
+
"crop.isnull().sum()"
|
| 245 |
+
]
|
| 246 |
+
},
|
| 247 |
+
{
|
| 248 |
+
"cell_type": "code",
|
| 249 |
+
"execution_count": 6,
|
| 250 |
+
"id": "1f7bf8c5",
|
| 251 |
+
"metadata": {},
|
| 252 |
+
"outputs": [
|
| 253 |
+
{
|
| 254 |
+
"data": {
|
| 255 |
+
"text/plain": [
|
| 256 |
+
"0"
|
| 257 |
+
]
|
| 258 |
+
},
|
| 259 |
+
"execution_count": 6,
|
| 260 |
+
"metadata": {},
|
| 261 |
+
"output_type": "execute_result"
|
| 262 |
+
}
|
| 263 |
+
],
|
| 264 |
+
"source": [
|
| 265 |
+
"crop.duplicated().sum()"
|
| 266 |
+
]
|
| 267 |
+
},
|
| 268 |
+
{
|
| 269 |
+
"cell_type": "code",
|
| 270 |
+
"execution_count": 7,
|
| 271 |
+
"id": "3d5b7413",
|
| 272 |
+
"metadata": {
|
| 273 |
+
"scrolled": false
|
| 274 |
+
},
|
| 275 |
+
"outputs": [
|
| 276 |
+
{
|
| 277 |
+
"data": {
|
| 278 |
+
"text/html": [
|
| 279 |
+
"<div>\n",
|
| 280 |
+
"<style scoped>\n",
|
| 281 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 282 |
+
" vertical-align: middle;\n",
|
| 283 |
+
" }\n",
|
| 284 |
+
"\n",
|
| 285 |
+
" .dataframe tbody tr th {\n",
|
| 286 |
+
" vertical-align: top;\n",
|
| 287 |
+
" }\n",
|
| 288 |
+
"\n",
|
| 289 |
+
" .dataframe thead th {\n",
|
| 290 |
+
" text-align: right;\n",
|
| 291 |
+
" }\n",
|
| 292 |
+
"</style>\n",
|
| 293 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 294 |
+
" <thead>\n",
|
| 295 |
+
" <tr style=\"text-align: right;\">\n",
|
| 296 |
+
" <th></th>\n",
|
| 297 |
+
" <th>N</th>\n",
|
| 298 |
+
" <th>P</th>\n",
|
| 299 |
+
" <th>K</th>\n",
|
| 300 |
+
" <th>temperature</th>\n",
|
| 301 |
+
" <th>humidity</th>\n",
|
| 302 |
+
" <th>ph</th>\n",
|
| 303 |
+
" <th>rainfall</th>\n",
|
| 304 |
+
" </tr>\n",
|
| 305 |
+
" </thead>\n",
|
| 306 |
+
" <tbody>\n",
|
| 307 |
+
" <tr>\n",
|
| 308 |
+
" <th>count</th>\n",
|
| 309 |
+
" <td>2200.000000</td>\n",
|
| 310 |
+
" <td>2200.000000</td>\n",
|
| 311 |
+
" <td>2200.000000</td>\n",
|
| 312 |
+
" <td>2200.000000</td>\n",
|
| 313 |
+
" <td>2200.000000</td>\n",
|
| 314 |
+
" <td>2200.000000</td>\n",
|
| 315 |
+
" <td>2200.000000</td>\n",
|
| 316 |
+
" </tr>\n",
|
| 317 |
+
" <tr>\n",
|
| 318 |
+
" <th>mean</th>\n",
|
| 319 |
+
" <td>50.551818</td>\n",
|
| 320 |
+
" <td>53.362727</td>\n",
|
| 321 |
+
" <td>48.149091</td>\n",
|
| 322 |
+
" <td>25.616244</td>\n",
|
| 323 |
+
" <td>71.481779</td>\n",
|
| 324 |
+
" <td>6.469480</td>\n",
|
| 325 |
+
" <td>103.463655</td>\n",
|
| 326 |
+
" </tr>\n",
|
| 327 |
+
" <tr>\n",
|
| 328 |
+
" <th>std</th>\n",
|
| 329 |
+
" <td>36.917334</td>\n",
|
| 330 |
+
" <td>32.985883</td>\n",
|
| 331 |
+
" <td>50.647931</td>\n",
|
| 332 |
+
" <td>5.063749</td>\n",
|
| 333 |
+
" <td>22.263812</td>\n",
|
| 334 |
+
" <td>0.773938</td>\n",
|
| 335 |
+
" <td>54.958389</td>\n",
|
| 336 |
+
" </tr>\n",
|
| 337 |
+
" <tr>\n",
|
| 338 |
+
" <th>min</th>\n",
|
| 339 |
+
" <td>0.000000</td>\n",
|
| 340 |
+
" <td>5.000000</td>\n",
|
| 341 |
+
" <td>5.000000</td>\n",
|
| 342 |
+
" <td>8.825675</td>\n",
|
| 343 |
+
" <td>14.258040</td>\n",
|
| 344 |
+
" <td>3.504752</td>\n",
|
| 345 |
+
" <td>20.211267</td>\n",
|
| 346 |
+
" </tr>\n",
|
| 347 |
+
" <tr>\n",
|
| 348 |
+
" <th>25%</th>\n",
|
| 349 |
+
" <td>21.000000</td>\n",
|
| 350 |
+
" <td>28.000000</td>\n",
|
| 351 |
+
" <td>20.000000</td>\n",
|
| 352 |
+
" <td>22.769375</td>\n",
|
| 353 |
+
" <td>60.261953</td>\n",
|
| 354 |
+
" <td>5.971693</td>\n",
|
| 355 |
+
" <td>64.551686</td>\n",
|
| 356 |
+
" </tr>\n",
|
| 357 |
+
" <tr>\n",
|
| 358 |
+
" <th>50%</th>\n",
|
| 359 |
+
" <td>37.000000</td>\n",
|
| 360 |
+
" <td>51.000000</td>\n",
|
| 361 |
+
" <td>32.000000</td>\n",
|
| 362 |
+
" <td>25.598693</td>\n",
|
| 363 |
+
" <td>80.473146</td>\n",
|
| 364 |
+
" <td>6.425045</td>\n",
|
| 365 |
+
" <td>94.867624</td>\n",
|
| 366 |
+
" </tr>\n",
|
| 367 |
+
" <tr>\n",
|
| 368 |
+
" <th>75%</th>\n",
|
| 369 |
+
" <td>84.250000</td>\n",
|
| 370 |
+
" <td>68.000000</td>\n",
|
| 371 |
+
" <td>49.000000</td>\n",
|
| 372 |
+
" <td>28.561654</td>\n",
|
| 373 |
+
" <td>89.948771</td>\n",
|
| 374 |
+
" <td>6.923643</td>\n",
|
| 375 |
+
" <td>124.267508</td>\n",
|
| 376 |
+
" </tr>\n",
|
| 377 |
+
" <tr>\n",
|
| 378 |
+
" <th>max</th>\n",
|
| 379 |
+
" <td>140.000000</td>\n",
|
| 380 |
+
" <td>145.000000</td>\n",
|
| 381 |
+
" <td>205.000000</td>\n",
|
| 382 |
+
" <td>43.675493</td>\n",
|
| 383 |
+
" <td>99.981876</td>\n",
|
| 384 |
+
" <td>9.935091</td>\n",
|
| 385 |
+
" <td>298.560117</td>\n",
|
| 386 |
+
" </tr>\n",
|
| 387 |
+
" </tbody>\n",
|
| 388 |
+
"</table>\n",
|
| 389 |
+
"</div>"
|
| 390 |
+
],
|
| 391 |
+
"text/plain": [
|
| 392 |
+
" N P K temperature humidity \\\n",
|
| 393 |
+
"count 2200.000000 2200.000000 2200.000000 2200.000000 2200.000000 \n",
|
| 394 |
+
"mean 50.551818 53.362727 48.149091 25.616244 71.481779 \n",
|
| 395 |
+
"std 36.917334 32.985883 50.647931 5.063749 22.263812 \n",
|
| 396 |
+
"min 0.000000 5.000000 5.000000 8.825675 14.258040 \n",
|
| 397 |
+
"25% 21.000000 28.000000 20.000000 22.769375 60.261953 \n",
|
| 398 |
+
"50% 37.000000 51.000000 32.000000 25.598693 80.473146 \n",
|
| 399 |
+
"75% 84.250000 68.000000 49.000000 28.561654 89.948771 \n",
|
| 400 |
+
"max 140.000000 145.000000 205.000000 43.675493 99.981876 \n",
|
| 401 |
+
"\n",
|
| 402 |
+
" ph rainfall \n",
|
| 403 |
+
"count 2200.000000 2200.000000 \n",
|
| 404 |
+
"mean 6.469480 103.463655 \n",
|
| 405 |
+
"std 0.773938 54.958389 \n",
|
| 406 |
+
"min 3.504752 20.211267 \n",
|
| 407 |
+
"25% 5.971693 64.551686 \n",
|
| 408 |
+
"50% 6.425045 94.867624 \n",
|
| 409 |
+
"75% 6.923643 124.267508 \n",
|
| 410 |
+
"max 9.935091 298.560117 "
|
| 411 |
+
]
|
| 412 |
+
},
|
| 413 |
+
"execution_count": 7,
|
| 414 |
+
"metadata": {},
|
| 415 |
+
"output_type": "execute_result"
|
| 416 |
+
}
|
| 417 |
+
],
|
| 418 |
+
"source": [
|
| 419 |
+
"crop.describe()"
|
| 420 |
+
]
|
| 421 |
+
},
|
| 422 |
+
{
|
| 423 |
+
"cell_type": "code",
|
| 424 |
+
"execution_count": 20,
|
| 425 |
+
"id": "1056bfba",
|
| 426 |
+
"metadata": {},
|
| 427 |
+
"outputs": [
|
| 428 |
+
{
|
| 429 |
+
"data": {
|
| 430 |
+
"text/plain": [
|
| 431 |
+
"label\n",
|
| 432 |
+
"rice 100\n",
|
| 433 |
+
"maize 100\n",
|
| 434 |
+
"jute 100\n",
|
| 435 |
+
"cotton 100\n",
|
| 436 |
+
"coconut 100\n",
|
| 437 |
+
"papaya 100\n",
|
| 438 |
+
"orange 100\n",
|
| 439 |
+
"apple 100\n",
|
| 440 |
+
"muskmelon 100\n",
|
| 441 |
+
"watermelon 100\n",
|
| 442 |
+
"grapes 100\n",
|
| 443 |
+
"mango 100\n",
|
| 444 |
+
"banana 100\n",
|
| 445 |
+
"pomegranate 100\n",
|
| 446 |
+
"lentil 100\n",
|
| 447 |
+
"blackgram 100\n",
|
| 448 |
+
"mungbean 100\n",
|
| 449 |
+
"mothbeans 100\n",
|
| 450 |
+
"pigeonpeas 100\n",
|
| 451 |
+
"kidneybeans 100\n",
|
| 452 |
+
"chickpea 100\n",
|
| 453 |
+
"coffee 100\n",
|
| 454 |
+
"Name: count, dtype: int64"
|
| 455 |
+
]
|
| 456 |
+
},
|
| 457 |
+
"execution_count": 20,
|
| 458 |
+
"metadata": {},
|
| 459 |
+
"output_type": "execute_result"
|
| 460 |
+
}
|
| 461 |
+
],
|
| 462 |
+
"source": [
|
| 463 |
+
"crop['label'].value_counts()"
|
| 464 |
+
]
|
| 465 |
+
},
|
| 466 |
+
{
|
| 467 |
+
"cell_type": "markdown",
|
| 468 |
+
"id": "3e3af150",
|
| 469 |
+
"metadata": {},
|
| 470 |
+
"source": [
|
| 471 |
+
"# Encoding"
|
| 472 |
+
]
|
| 473 |
+
},
|
| 474 |
+
{
|
| 475 |
+
"cell_type": "code",
|
| 476 |
+
"execution_count": 24,
|
| 477 |
+
"id": "8c35d395",
|
| 478 |
+
"metadata": {},
|
| 479 |
+
"outputs": [],
|
| 480 |
+
"source": [
|
| 481 |
+
"crop_dict = {\n",
|
| 482 |
+
" 'rice': 1,\n",
|
| 483 |
+
" 'maize': 2,\n",
|
| 484 |
+
" 'jute': 3,\n",
|
| 485 |
+
" 'cotton': 4,\n",
|
| 486 |
+
" 'coconut': 5,\n",
|
| 487 |
+
" 'papaya': 6,\n",
|
| 488 |
+
" 'orange': 7,\n",
|
| 489 |
+
" 'apple': 8,\n",
|
| 490 |
+
" 'muskmelon': 9,\n",
|
| 491 |
+
" 'watermelon': 10,\n",
|
| 492 |
+
" 'grapes': 11,\n",
|
| 493 |
+
" 'mango': 12,\n",
|
| 494 |
+
" 'banana': 13,\n",
|
| 495 |
+
" 'pomegranate': 14,\n",
|
| 496 |
+
" 'lentil': 15,\n",
|
| 497 |
+
" 'blackgram': 16,\n",
|
| 498 |
+
" 'mungbean': 17,\n",
|
| 499 |
+
" 'mothbeans': 18,\n",
|
| 500 |
+
" 'pigeonpeas': 19,\n",
|
| 501 |
+
" 'kidneybeans': 20,\n",
|
| 502 |
+
" 'chickpea': 21,\n",
|
| 503 |
+
" 'coffee': 22\n",
|
| 504 |
+
"}\n",
|
| 505 |
+
"crop['crop_num']= crop['label'].map(crop_dict)"
|
| 506 |
+
]
|
| 507 |
+
},
|
| 508 |
+
{
|
| 509 |
+
"cell_type": "code",
|
| 510 |
+
"execution_count": 25,
|
| 511 |
+
"id": "b1a53f7f",
|
| 512 |
+
"metadata": {},
|
| 513 |
+
"outputs": [
|
| 514 |
+
{
|
| 515 |
+
"data": {
|
| 516 |
+
"text/html": [
|
| 517 |
+
"<div>\n",
|
| 518 |
+
"<style scoped>\n",
|
| 519 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 520 |
+
" vertical-align: middle;\n",
|
| 521 |
+
" }\n",
|
| 522 |
+
"\n",
|
| 523 |
+
" .dataframe tbody tr th {\n",
|
| 524 |
+
" vertical-align: top;\n",
|
| 525 |
+
" }\n",
|
| 526 |
+
"\n",
|
| 527 |
+
" .dataframe thead th {\n",
|
| 528 |
+
" text-align: right;\n",
|
| 529 |
+
" }\n",
|
| 530 |
+
"</style>\n",
|
| 531 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 532 |
+
" <thead>\n",
|
| 533 |
+
" <tr style=\"text-align: right;\">\n",
|
| 534 |
+
" <th></th>\n",
|
| 535 |
+
" <th>N</th>\n",
|
| 536 |
+
" <th>P</th>\n",
|
| 537 |
+
" <th>K</th>\n",
|
| 538 |
+
" <th>temperature</th>\n",
|
| 539 |
+
" <th>humidity</th>\n",
|
| 540 |
+
" <th>ph</th>\n",
|
| 541 |
+
" <th>rainfall</th>\n",
|
| 542 |
+
" <th>label</th>\n",
|
| 543 |
+
" <th>crop_num</th>\n",
|
| 544 |
+
" </tr>\n",
|
| 545 |
+
" </thead>\n",
|
| 546 |
+
" <tbody>\n",
|
| 547 |
+
" <tr>\n",
|
| 548 |
+
" <th>0</th>\n",
|
| 549 |
+
" <td>90</td>\n",
|
| 550 |
+
" <td>42</td>\n",
|
| 551 |
+
" <td>43</td>\n",
|
| 552 |
+
" <td>20.879744</td>\n",
|
| 553 |
+
" <td>82.002744</td>\n",
|
| 554 |
+
" <td>6.502985</td>\n",
|
| 555 |
+
" <td>202.935536</td>\n",
|
| 556 |
+
" <td>rice</td>\n",
|
| 557 |
+
" <td>1</td>\n",
|
| 558 |
+
" </tr>\n",
|
| 559 |
+
" <tr>\n",
|
| 560 |
+
" <th>1</th>\n",
|
| 561 |
+
" <td>85</td>\n",
|
| 562 |
+
" <td>58</td>\n",
|
| 563 |
+
" <td>41</td>\n",
|
| 564 |
+
" <td>21.770462</td>\n",
|
| 565 |
+
" <td>80.319644</td>\n",
|
| 566 |
+
" <td>7.038096</td>\n",
|
| 567 |
+
" <td>226.655537</td>\n",
|
| 568 |
+
" <td>rice</td>\n",
|
| 569 |
+
" <td>1</td>\n",
|
| 570 |
+
" </tr>\n",
|
| 571 |
+
" <tr>\n",
|
| 572 |
+
" <th>2</th>\n",
|
| 573 |
+
" <td>60</td>\n",
|
| 574 |
+
" <td>55</td>\n",
|
| 575 |
+
" <td>44</td>\n",
|
| 576 |
+
" <td>23.004459</td>\n",
|
| 577 |
+
" <td>82.320763</td>\n",
|
| 578 |
+
" <td>7.840207</td>\n",
|
| 579 |
+
" <td>263.964248</td>\n",
|
| 580 |
+
" <td>rice</td>\n",
|
| 581 |
+
" <td>1</td>\n",
|
| 582 |
+
" </tr>\n",
|
| 583 |
+
" <tr>\n",
|
| 584 |
+
" <th>3</th>\n",
|
| 585 |
+
" <td>74</td>\n",
|
| 586 |
+
" <td>35</td>\n",
|
| 587 |
+
" <td>40</td>\n",
|
| 588 |
+
" <td>26.491096</td>\n",
|
| 589 |
+
" <td>80.158363</td>\n",
|
| 590 |
+
" <td>6.980401</td>\n",
|
| 591 |
+
" <td>242.864034</td>\n",
|
| 592 |
+
" <td>rice</td>\n",
|
| 593 |
+
" <td>1</td>\n",
|
| 594 |
+
" </tr>\n",
|
| 595 |
+
" <tr>\n",
|
| 596 |
+
" <th>4</th>\n",
|
| 597 |
+
" <td>78</td>\n",
|
| 598 |
+
" <td>42</td>\n",
|
| 599 |
+
" <td>42</td>\n",
|
| 600 |
+
" <td>20.130175</td>\n",
|
| 601 |
+
" <td>81.604873</td>\n",
|
| 602 |
+
" <td>7.628473</td>\n",
|
| 603 |
+
" <td>262.717340</td>\n",
|
| 604 |
+
" <td>rice</td>\n",
|
| 605 |
+
" <td>1</td>\n",
|
| 606 |
+
" </tr>\n",
|
| 607 |
+
" <tr>\n",
|
| 608 |
+
" <th>...</th>\n",
|
| 609 |
+
" <td>...</td>\n",
|
| 610 |
+
" <td>...</td>\n",
|
| 611 |
+
" <td>...</td>\n",
|
| 612 |
+
" <td>...</td>\n",
|
| 613 |
+
" <td>...</td>\n",
|
| 614 |
+
" <td>...</td>\n",
|
| 615 |
+
" <td>...</td>\n",
|
| 616 |
+
" <td>...</td>\n",
|
| 617 |
+
" <td>...</td>\n",
|
| 618 |
+
" </tr>\n",
|
| 619 |
+
" <tr>\n",
|
| 620 |
+
" <th>2195</th>\n",
|
| 621 |
+
" <td>107</td>\n",
|
| 622 |
+
" <td>34</td>\n",
|
| 623 |
+
" <td>32</td>\n",
|
| 624 |
+
" <td>26.774637</td>\n",
|
| 625 |
+
" <td>66.413269</td>\n",
|
| 626 |
+
" <td>6.780064</td>\n",
|
| 627 |
+
" <td>177.774507</td>\n",
|
| 628 |
+
" <td>coffee</td>\n",
|
| 629 |
+
" <td>22</td>\n",
|
| 630 |
+
" </tr>\n",
|
| 631 |
+
" <tr>\n",
|
| 632 |
+
" <th>2196</th>\n",
|
| 633 |
+
" <td>99</td>\n",
|
| 634 |
+
" <td>15</td>\n",
|
| 635 |
+
" <td>27</td>\n",
|
| 636 |
+
" <td>27.417112</td>\n",
|
| 637 |
+
" <td>56.636362</td>\n",
|
| 638 |
+
" <td>6.086922</td>\n",
|
| 639 |
+
" <td>127.924610</td>\n",
|
| 640 |
+
" <td>coffee</td>\n",
|
| 641 |
+
" <td>22</td>\n",
|
| 642 |
+
" </tr>\n",
|
| 643 |
+
" <tr>\n",
|
| 644 |
+
" <th>2197</th>\n",
|
| 645 |
+
" <td>118</td>\n",
|
| 646 |
+
" <td>33</td>\n",
|
| 647 |
+
" <td>30</td>\n",
|
| 648 |
+
" <td>24.131797</td>\n",
|
| 649 |
+
" <td>67.225123</td>\n",
|
| 650 |
+
" <td>6.362608</td>\n",
|
| 651 |
+
" <td>173.322839</td>\n",
|
| 652 |
+
" <td>coffee</td>\n",
|
| 653 |
+
" <td>22</td>\n",
|
| 654 |
+
" </tr>\n",
|
| 655 |
+
" <tr>\n",
|
| 656 |
+
" <th>2198</th>\n",
|
| 657 |
+
" <td>117</td>\n",
|
| 658 |
+
" <td>32</td>\n",
|
| 659 |
+
" <td>34</td>\n",
|
| 660 |
+
" <td>26.272418</td>\n",
|
| 661 |
+
" <td>52.127394</td>\n",
|
| 662 |
+
" <td>6.758793</td>\n",
|
| 663 |
+
" <td>127.175293</td>\n",
|
| 664 |
+
" <td>coffee</td>\n",
|
| 665 |
+
" <td>22</td>\n",
|
| 666 |
+
" </tr>\n",
|
| 667 |
+
" <tr>\n",
|
| 668 |
+
" <th>2199</th>\n",
|
| 669 |
+
" <td>104</td>\n",
|
| 670 |
+
" <td>18</td>\n",
|
| 671 |
+
" <td>30</td>\n",
|
| 672 |
+
" <td>23.603016</td>\n",
|
| 673 |
+
" <td>60.396475</td>\n",
|
| 674 |
+
" <td>6.779833</td>\n",
|
| 675 |
+
" <td>140.937041</td>\n",
|
| 676 |
+
" <td>coffee</td>\n",
|
| 677 |
+
" <td>22</td>\n",
|
| 678 |
+
" </tr>\n",
|
| 679 |
+
" </tbody>\n",
|
| 680 |
+
"</table>\n",
|
| 681 |
+
"<p>2200 rows × 9 columns</p>\n",
|
| 682 |
+
"</div>"
|
| 683 |
+
],
|
| 684 |
+
"text/plain": [
|
| 685 |
+
" N P K temperature humidity ph rainfall label \\\n",
|
| 686 |
+
"0 90 42 43 20.879744 82.002744 6.502985 202.935536 rice \n",
|
| 687 |
+
"1 85 58 41 21.770462 80.319644 7.038096 226.655537 rice \n",
|
| 688 |
+
"2 60 55 44 23.004459 82.320763 7.840207 263.964248 rice \n",
|
| 689 |
+
"3 74 35 40 26.491096 80.158363 6.980401 242.864034 rice \n",
|
| 690 |
+
"4 78 42 42 20.130175 81.604873 7.628473 262.717340 rice \n",
|
| 691 |
+
"... ... .. .. ... ... ... ... ... \n",
|
| 692 |
+
"2195 107 34 32 26.774637 66.413269 6.780064 177.774507 coffee \n",
|
| 693 |
+
"2196 99 15 27 27.417112 56.636362 6.086922 127.924610 coffee \n",
|
| 694 |
+
"2197 118 33 30 24.131797 67.225123 6.362608 173.322839 coffee \n",
|
| 695 |
+
"2198 117 32 34 26.272418 52.127394 6.758793 127.175293 coffee \n",
|
| 696 |
+
"2199 104 18 30 23.603016 60.396475 6.779833 140.937041 coffee \n",
|
| 697 |
+
"\n",
|
| 698 |
+
" crop_num \n",
|
| 699 |
+
"0 1 \n",
|
| 700 |
+
"1 1 \n",
|
| 701 |
+
"2 1 \n",
|
| 702 |
+
"3 1 \n",
|
| 703 |
+
"4 1 \n",
|
| 704 |
+
"... ... \n",
|
| 705 |
+
"2195 22 \n",
|
| 706 |
+
"2196 22 \n",
|
| 707 |
+
"2197 22 \n",
|
| 708 |
+
"2198 22 \n",
|
| 709 |
+
"2199 22 \n",
|
| 710 |
+
"\n",
|
| 711 |
+
"[2200 rows x 9 columns]"
|
| 712 |
+
]
|
| 713 |
+
},
|
| 714 |
+
"execution_count": 25,
|
| 715 |
+
"metadata": {},
|
| 716 |
+
"output_type": "execute_result"
|
| 717 |
+
}
|
| 718 |
+
],
|
| 719 |
+
"source": [
|
| 720 |
+
"crop"
|
| 721 |
+
]
|
| 722 |
+
},
|
| 723 |
+
{
|
| 724 |
+
"cell_type": "code",
|
| 725 |
+
"execution_count": 26,
|
| 726 |
+
"id": "dff5caca",
|
| 727 |
+
"metadata": {},
|
| 728 |
+
"outputs": [
|
| 729 |
+
{
|
| 730 |
+
"data": {
|
| 731 |
+
"text/html": [
|
| 732 |
+
"<div>\n",
|
| 733 |
+
"<style scoped>\n",
|
| 734 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 735 |
+
" vertical-align: middle;\n",
|
| 736 |
+
" }\n",
|
| 737 |
+
"\n",
|
| 738 |
+
" .dataframe tbody tr th {\n",
|
| 739 |
+
" vertical-align: top;\n",
|
| 740 |
+
" }\n",
|
| 741 |
+
"\n",
|
| 742 |
+
" .dataframe thead th {\n",
|
| 743 |
+
" text-align: right;\n",
|
| 744 |
+
" }\n",
|
| 745 |
+
"</style>\n",
|
| 746 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 747 |
+
" <thead>\n",
|
| 748 |
+
" <tr style=\"text-align: right;\">\n",
|
| 749 |
+
" <th></th>\n",
|
| 750 |
+
" <th>N</th>\n",
|
| 751 |
+
" <th>P</th>\n",
|
| 752 |
+
" <th>K</th>\n",
|
| 753 |
+
" <th>temperature</th>\n",
|
| 754 |
+
" <th>humidity</th>\n",
|
| 755 |
+
" <th>ph</th>\n",
|
| 756 |
+
" <th>rainfall</th>\n",
|
| 757 |
+
" <th>crop_num</th>\n",
|
| 758 |
+
" </tr>\n",
|
| 759 |
+
" </thead>\n",
|
| 760 |
+
" <tbody>\n",
|
| 761 |
+
" <tr>\n",
|
| 762 |
+
" <th>0</th>\n",
|
| 763 |
+
" <td>90</td>\n",
|
| 764 |
+
" <td>42</td>\n",
|
| 765 |
+
" <td>43</td>\n",
|
| 766 |
+
" <td>20.879744</td>\n",
|
| 767 |
+
" <td>82.002744</td>\n",
|
| 768 |
+
" <td>6.502985</td>\n",
|
| 769 |
+
" <td>202.935536</td>\n",
|
| 770 |
+
" <td>1</td>\n",
|
| 771 |
+
" </tr>\n",
|
| 772 |
+
" <tr>\n",
|
| 773 |
+
" <th>1</th>\n",
|
| 774 |
+
" <td>85</td>\n",
|
| 775 |
+
" <td>58</td>\n",
|
| 776 |
+
" <td>41</td>\n",
|
| 777 |
+
" <td>21.770462</td>\n",
|
| 778 |
+
" <td>80.319644</td>\n",
|
| 779 |
+
" <td>7.038096</td>\n",
|
| 780 |
+
" <td>226.655537</td>\n",
|
| 781 |
+
" <td>1</td>\n",
|
| 782 |
+
" </tr>\n",
|
| 783 |
+
" <tr>\n",
|
| 784 |
+
" <th>2</th>\n",
|
| 785 |
+
" <td>60</td>\n",
|
| 786 |
+
" <td>55</td>\n",
|
| 787 |
+
" <td>44</td>\n",
|
| 788 |
+
" <td>23.004459</td>\n",
|
| 789 |
+
" <td>82.320763</td>\n",
|
| 790 |
+
" <td>7.840207</td>\n",
|
| 791 |
+
" <td>263.964248</td>\n",
|
| 792 |
+
" <td>1</td>\n",
|
| 793 |
+
" </tr>\n",
|
| 794 |
+
" <tr>\n",
|
| 795 |
+
" <th>3</th>\n",
|
| 796 |
+
" <td>74</td>\n",
|
| 797 |
+
" <td>35</td>\n",
|
| 798 |
+
" <td>40</td>\n",
|
| 799 |
+
" <td>26.491096</td>\n",
|
| 800 |
+
" <td>80.158363</td>\n",
|
| 801 |
+
" <td>6.980401</td>\n",
|
| 802 |
+
" <td>242.864034</td>\n",
|
| 803 |
+
" <td>1</td>\n",
|
| 804 |
+
" </tr>\n",
|
| 805 |
+
" <tr>\n",
|
| 806 |
+
" <th>4</th>\n",
|
| 807 |
+
" <td>78</td>\n",
|
| 808 |
+
" <td>42</td>\n",
|
| 809 |
+
" <td>42</td>\n",
|
| 810 |
+
" <td>20.130175</td>\n",
|
| 811 |
+
" <td>81.604873</td>\n",
|
| 812 |
+
" <td>7.628473</td>\n",
|
| 813 |
+
" <td>262.717340</td>\n",
|
| 814 |
+
" <td>1</td>\n",
|
| 815 |
+
" </tr>\n",
|
| 816 |
+
" </tbody>\n",
|
| 817 |
+
"</table>\n",
|
| 818 |
+
"</div>"
|
| 819 |
+
],
|
| 820 |
+
"text/plain": [
|
| 821 |
+
" N P K temperature humidity ph rainfall crop_num\n",
|
| 822 |
+
"0 90 42 43 20.879744 82.002744 6.502985 202.935536 1\n",
|
| 823 |
+
"1 85 58 41 21.770462 80.319644 7.038096 226.655537 1\n",
|
| 824 |
+
"2 60 55 44 23.004459 82.320763 7.840207 263.964248 1\n",
|
| 825 |
+
"3 74 35 40 26.491096 80.158363 6.980401 242.864034 1\n",
|
| 826 |
+
"4 78 42 42 20.130175 81.604873 7.628473 262.717340 1"
|
| 827 |
+
]
|
| 828 |
+
},
|
| 829 |
+
"execution_count": 26,
|
| 830 |
+
"metadata": {},
|
| 831 |
+
"output_type": "execute_result"
|
| 832 |
+
}
|
| 833 |
+
],
|
| 834 |
+
"source": [
|
| 835 |
+
"crop.drop(['label'],axis=1,inplace=True)\n",
|
| 836 |
+
"crop.head()"
|
| 837 |
+
]
|
| 838 |
+
},
|
| 839 |
+
{
|
| 840 |
+
"cell_type": "markdown",
|
| 841 |
+
"id": "a5494675",
|
| 842 |
+
"metadata": {},
|
| 843 |
+
"source": [
|
| 844 |
+
"# Train Test Split"
|
| 845 |
+
]
|
| 846 |
+
},
|
| 847 |
+
{
|
| 848 |
+
"cell_type": "code",
|
| 849 |
+
"execution_count": 27,
|
| 850 |
+
"id": "5a049f55",
|
| 851 |
+
"metadata": {},
|
| 852 |
+
"outputs": [],
|
| 853 |
+
"source": [
|
| 854 |
+
"X = crop.drop(['crop_num'],axis=1)\n",
|
| 855 |
+
"y = crop['crop_num']"
|
| 856 |
+
]
|
| 857 |
+
},
|
| 858 |
+
{
|
| 859 |
+
"cell_type": "code",
|
| 860 |
+
"execution_count": 28,
|
| 861 |
+
"id": "9d223a69",
|
| 862 |
+
"metadata": {},
|
| 863 |
+
"outputs": [
|
| 864 |
+
{
|
| 865 |
+
"data": {
|
| 866 |
+
"text/html": [
|
| 867 |
+
"<div>\n",
|
| 868 |
+
"<style scoped>\n",
|
| 869 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 870 |
+
" vertical-align: middle;\n",
|
| 871 |
+
" }\n",
|
| 872 |
+
"\n",
|
| 873 |
+
" .dataframe tbody tr th {\n",
|
| 874 |
+
" vertical-align: top;\n",
|
| 875 |
+
" }\n",
|
| 876 |
+
"\n",
|
| 877 |
+
" .dataframe thead th {\n",
|
| 878 |
+
" text-align: right;\n",
|
| 879 |
+
" }\n",
|
| 880 |
+
"</style>\n",
|
| 881 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 882 |
+
" <thead>\n",
|
| 883 |
+
" <tr style=\"text-align: right;\">\n",
|
| 884 |
+
" <th></th>\n",
|
| 885 |
+
" <th>N</th>\n",
|
| 886 |
+
" <th>P</th>\n",
|
| 887 |
+
" <th>K</th>\n",
|
| 888 |
+
" <th>temperature</th>\n",
|
| 889 |
+
" <th>humidity</th>\n",
|
| 890 |
+
" <th>ph</th>\n",
|
| 891 |
+
" <th>rainfall</th>\n",
|
| 892 |
+
" </tr>\n",
|
| 893 |
+
" </thead>\n",
|
| 894 |
+
" <tbody>\n",
|
| 895 |
+
" <tr>\n",
|
| 896 |
+
" <th>0</th>\n",
|
| 897 |
+
" <td>90</td>\n",
|
| 898 |
+
" <td>42</td>\n",
|
| 899 |
+
" <td>43</td>\n",
|
| 900 |
+
" <td>20.879744</td>\n",
|
| 901 |
+
" <td>82.002744</td>\n",
|
| 902 |
+
" <td>6.502985</td>\n",
|
| 903 |
+
" <td>202.935536</td>\n",
|
| 904 |
+
" </tr>\n",
|
| 905 |
+
" <tr>\n",
|
| 906 |
+
" <th>1</th>\n",
|
| 907 |
+
" <td>85</td>\n",
|
| 908 |
+
" <td>58</td>\n",
|
| 909 |
+
" <td>41</td>\n",
|
| 910 |
+
" <td>21.770462</td>\n",
|
| 911 |
+
" <td>80.319644</td>\n",
|
| 912 |
+
" <td>7.038096</td>\n",
|
| 913 |
+
" <td>226.655537</td>\n",
|
| 914 |
+
" </tr>\n",
|
| 915 |
+
" <tr>\n",
|
| 916 |
+
" <th>2</th>\n",
|
| 917 |
+
" <td>60</td>\n",
|
| 918 |
+
" <td>55</td>\n",
|
| 919 |
+
" <td>44</td>\n",
|
| 920 |
+
" <td>23.004459</td>\n",
|
| 921 |
+
" <td>82.320763</td>\n",
|
| 922 |
+
" <td>7.840207</td>\n",
|
| 923 |
+
" <td>263.964248</td>\n",
|
| 924 |
+
" </tr>\n",
|
| 925 |
+
" <tr>\n",
|
| 926 |
+
" <th>3</th>\n",
|
| 927 |
+
" <td>74</td>\n",
|
| 928 |
+
" <td>35</td>\n",
|
| 929 |
+
" <td>40</td>\n",
|
| 930 |
+
" <td>26.491096</td>\n",
|
| 931 |
+
" <td>80.158363</td>\n",
|
| 932 |
+
" <td>6.980401</td>\n",
|
| 933 |
+
" <td>242.864034</td>\n",
|
| 934 |
+
" </tr>\n",
|
| 935 |
+
" <tr>\n",
|
| 936 |
+
" <th>4</th>\n",
|
| 937 |
+
" <td>78</td>\n",
|
| 938 |
+
" <td>42</td>\n",
|
| 939 |
+
" <td>42</td>\n",
|
| 940 |
+
" <td>20.130175</td>\n",
|
| 941 |
+
" <td>81.604873</td>\n",
|
| 942 |
+
" <td>7.628473</td>\n",
|
| 943 |
+
" <td>262.717340</td>\n",
|
| 944 |
+
" </tr>\n",
|
| 945 |
+
" <tr>\n",
|
| 946 |
+
" <th>...</th>\n",
|
| 947 |
+
" <td>...</td>\n",
|
| 948 |
+
" <td>...</td>\n",
|
| 949 |
+
" <td>...</td>\n",
|
| 950 |
+
" <td>...</td>\n",
|
| 951 |
+
" <td>...</td>\n",
|
| 952 |
+
" <td>...</td>\n",
|
| 953 |
+
" <td>...</td>\n",
|
| 954 |
+
" </tr>\n",
|
| 955 |
+
" <tr>\n",
|
| 956 |
+
" <th>2195</th>\n",
|
| 957 |
+
" <td>107</td>\n",
|
| 958 |
+
" <td>34</td>\n",
|
| 959 |
+
" <td>32</td>\n",
|
| 960 |
+
" <td>26.774637</td>\n",
|
| 961 |
+
" <td>66.413269</td>\n",
|
| 962 |
+
" <td>6.780064</td>\n",
|
| 963 |
+
" <td>177.774507</td>\n",
|
| 964 |
+
" </tr>\n",
|
| 965 |
+
" <tr>\n",
|
| 966 |
+
" <th>2196</th>\n",
|
| 967 |
+
" <td>99</td>\n",
|
| 968 |
+
" <td>15</td>\n",
|
| 969 |
+
" <td>27</td>\n",
|
| 970 |
+
" <td>27.417112</td>\n",
|
| 971 |
+
" <td>56.636362</td>\n",
|
| 972 |
+
" <td>6.086922</td>\n",
|
| 973 |
+
" <td>127.924610</td>\n",
|
| 974 |
+
" </tr>\n",
|
| 975 |
+
" <tr>\n",
|
| 976 |
+
" <th>2197</th>\n",
|
| 977 |
+
" <td>118</td>\n",
|
| 978 |
+
" <td>33</td>\n",
|
| 979 |
+
" <td>30</td>\n",
|
| 980 |
+
" <td>24.131797</td>\n",
|
| 981 |
+
" <td>67.225123</td>\n",
|
| 982 |
+
" <td>6.362608</td>\n",
|
| 983 |
+
" <td>173.322839</td>\n",
|
| 984 |
+
" </tr>\n",
|
| 985 |
+
" <tr>\n",
|
| 986 |
+
" <th>2198</th>\n",
|
| 987 |
+
" <td>117</td>\n",
|
| 988 |
+
" <td>32</td>\n",
|
| 989 |
+
" <td>34</td>\n",
|
| 990 |
+
" <td>26.272418</td>\n",
|
| 991 |
+
" <td>52.127394</td>\n",
|
| 992 |
+
" <td>6.758793</td>\n",
|
| 993 |
+
" <td>127.175293</td>\n",
|
| 994 |
+
" </tr>\n",
|
| 995 |
+
" <tr>\n",
|
| 996 |
+
" <th>2199</th>\n",
|
| 997 |
+
" <td>104</td>\n",
|
| 998 |
+
" <td>18</td>\n",
|
| 999 |
+
" <td>30</td>\n",
|
| 1000 |
+
" <td>23.603016</td>\n",
|
| 1001 |
+
" <td>60.396475</td>\n",
|
| 1002 |
+
" <td>6.779833</td>\n",
|
| 1003 |
+
" <td>140.937041</td>\n",
|
| 1004 |
+
" </tr>\n",
|
| 1005 |
+
" </tbody>\n",
|
| 1006 |
+
"</table>\n",
|
| 1007 |
+
"<p>2200 rows × 7 columns</p>\n",
|
| 1008 |
+
"</div>"
|
| 1009 |
+
],
|
| 1010 |
+
"text/plain": [
|
| 1011 |
+
" N P K temperature humidity ph rainfall\n",
|
| 1012 |
+
"0 90 42 43 20.879744 82.002744 6.502985 202.935536\n",
|
| 1013 |
+
"1 85 58 41 21.770462 80.319644 7.038096 226.655537\n",
|
| 1014 |
+
"2 60 55 44 23.004459 82.320763 7.840207 263.964248\n",
|
| 1015 |
+
"3 74 35 40 26.491096 80.158363 6.980401 242.864034\n",
|
| 1016 |
+
"4 78 42 42 20.130175 81.604873 7.628473 262.717340\n",
|
| 1017 |
+
"... ... .. .. ... ... ... ...\n",
|
| 1018 |
+
"2195 107 34 32 26.774637 66.413269 6.780064 177.774507\n",
|
| 1019 |
+
"2196 99 15 27 27.417112 56.636362 6.086922 127.924610\n",
|
| 1020 |
+
"2197 118 33 30 24.131797 67.225123 6.362608 173.322839\n",
|
| 1021 |
+
"2198 117 32 34 26.272418 52.127394 6.758793 127.175293\n",
|
| 1022 |
+
"2199 104 18 30 23.603016 60.396475 6.779833 140.937041\n",
|
| 1023 |
+
"\n",
|
| 1024 |
+
"[2200 rows x 7 columns]"
|
| 1025 |
+
]
|
| 1026 |
+
},
|
| 1027 |
+
"execution_count": 28,
|
| 1028 |
+
"metadata": {},
|
| 1029 |
+
"output_type": "execute_result"
|
| 1030 |
+
}
|
| 1031 |
+
],
|
| 1032 |
+
"source": [
|
| 1033 |
+
"X"
|
| 1034 |
+
]
|
| 1035 |
+
},
|
| 1036 |
+
{
|
| 1037 |
+
"cell_type": "code",
|
| 1038 |
+
"execution_count": 29,
|
| 1039 |
+
"id": "d2601fcf",
|
| 1040 |
+
"metadata": {},
|
| 1041 |
+
"outputs": [
|
| 1042 |
+
{
|
| 1043 |
+
"data": {
|
| 1044 |
+
"text/plain": [
|
| 1045 |
+
"0 1\n",
|
| 1046 |
+
"1 1\n",
|
| 1047 |
+
"2 1\n",
|
| 1048 |
+
"3 1\n",
|
| 1049 |
+
"4 1\n",
|
| 1050 |
+
" ..\n",
|
| 1051 |
+
"2195 22\n",
|
| 1052 |
+
"2196 22\n",
|
| 1053 |
+
"2197 22\n",
|
| 1054 |
+
"2198 22\n",
|
| 1055 |
+
"2199 22\n",
|
| 1056 |
+
"Name: crop_num, Length: 2200, dtype: int64"
|
| 1057 |
+
]
|
| 1058 |
+
},
|
| 1059 |
+
"execution_count": 29,
|
| 1060 |
+
"metadata": {},
|
| 1061 |
+
"output_type": "execute_result"
|
| 1062 |
+
}
|
| 1063 |
+
],
|
| 1064 |
+
"source": [
|
| 1065 |
+
"y"
|
| 1066 |
+
]
|
| 1067 |
+
},
|
| 1068 |
+
{
|
| 1069 |
+
"cell_type": "code",
|
| 1070 |
+
"execution_count": 30,
|
| 1071 |
+
"id": "c561ea31",
|
| 1072 |
+
"metadata": {},
|
| 1073 |
+
"outputs": [
|
| 1074 |
+
{
|
| 1075 |
+
"data": {
|
| 1076 |
+
"text/plain": [
|
| 1077 |
+
"(2200,)"
|
| 1078 |
+
]
|
| 1079 |
+
},
|
| 1080 |
+
"execution_count": 30,
|
| 1081 |
+
"metadata": {},
|
| 1082 |
+
"output_type": "execute_result"
|
| 1083 |
+
}
|
| 1084 |
+
],
|
| 1085 |
+
"source": [
|
| 1086 |
+
"y.shape"
|
| 1087 |
+
]
|
| 1088 |
+
},
|
| 1089 |
+
{
|
| 1090 |
+
"cell_type": "code",
|
| 1091 |
+
"execution_count": 31,
|
| 1092 |
+
"id": "caba8efb",
|
| 1093 |
+
"metadata": {},
|
| 1094 |
+
"outputs": [],
|
| 1095 |
+
"source": [
|
| 1096 |
+
"from sklearn.model_selection import train_test_split"
|
| 1097 |
+
]
|
| 1098 |
+
},
|
| 1099 |
+
{
|
| 1100 |
+
"cell_type": "code",
|
| 1101 |
+
"execution_count": 32,
|
| 1102 |
+
"id": "6774a9dd",
|
| 1103 |
+
"metadata": {},
|
| 1104 |
+
"outputs": [],
|
| 1105 |
+
"source": [
|
| 1106 |
+
"X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)"
|
| 1107 |
+
]
|
| 1108 |
+
},
|
| 1109 |
+
{
|
| 1110 |
+
"cell_type": "code",
|
| 1111 |
+
"execution_count": 33,
|
| 1112 |
+
"id": "41b6bcbb",
|
| 1113 |
+
"metadata": {},
|
| 1114 |
+
"outputs": [
|
| 1115 |
+
{
|
| 1116 |
+
"data": {
|
| 1117 |
+
"text/html": [
|
| 1118 |
+
"<div>\n",
|
| 1119 |
+
"<style scoped>\n",
|
| 1120 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 1121 |
+
" vertical-align: middle;\n",
|
| 1122 |
+
" }\n",
|
| 1123 |
+
"\n",
|
| 1124 |
+
" .dataframe tbody tr th {\n",
|
| 1125 |
+
" vertical-align: top;\n",
|
| 1126 |
+
" }\n",
|
| 1127 |
+
"\n",
|
| 1128 |
+
" .dataframe thead th {\n",
|
| 1129 |
+
" text-align: right;\n",
|
| 1130 |
+
" }\n",
|
| 1131 |
+
"</style>\n",
|
| 1132 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 1133 |
+
" <thead>\n",
|
| 1134 |
+
" <tr style=\"text-align: right;\">\n",
|
| 1135 |
+
" <th></th>\n",
|
| 1136 |
+
" <th>N</th>\n",
|
| 1137 |
+
" <th>P</th>\n",
|
| 1138 |
+
" <th>K</th>\n",
|
| 1139 |
+
" <th>temperature</th>\n",
|
| 1140 |
+
" <th>humidity</th>\n",
|
| 1141 |
+
" <th>ph</th>\n",
|
| 1142 |
+
" <th>rainfall</th>\n",
|
| 1143 |
+
" </tr>\n",
|
| 1144 |
+
" </thead>\n",
|
| 1145 |
+
" <tbody>\n",
|
| 1146 |
+
" <tr>\n",
|
| 1147 |
+
" <th>1656</th>\n",
|
| 1148 |
+
" <td>17</td>\n",
|
| 1149 |
+
" <td>16</td>\n",
|
| 1150 |
+
" <td>14</td>\n",
|
| 1151 |
+
" <td>16.396243</td>\n",
|
| 1152 |
+
" <td>92.181519</td>\n",
|
| 1153 |
+
" <td>6.625539</td>\n",
|
| 1154 |
+
" <td>102.944161</td>\n",
|
| 1155 |
+
" </tr>\n",
|
| 1156 |
+
" <tr>\n",
|
| 1157 |
+
" <th>752</th>\n",
|
| 1158 |
+
" <td>37</td>\n",
|
| 1159 |
+
" <td>79</td>\n",
|
| 1160 |
+
" <td>19</td>\n",
|
| 1161 |
+
" <td>27.543848</td>\n",
|
| 1162 |
+
" <td>69.347863</td>\n",
|
| 1163 |
+
" <td>7.143943</td>\n",
|
| 1164 |
+
" <td>69.408782</td>\n",
|
| 1165 |
+
" </tr>\n",
|
| 1166 |
+
" <tr>\n",
|
| 1167 |
+
" <th>892</th>\n",
|
| 1168 |
+
" <td>7</td>\n",
|
| 1169 |
+
" <td>73</td>\n",
|
| 1170 |
+
" <td>25</td>\n",
|
| 1171 |
+
" <td>27.521856</td>\n",
|
| 1172 |
+
" <td>63.132153</td>\n",
|
| 1173 |
+
" <td>7.288057</td>\n",
|
| 1174 |
+
" <td>45.208411</td>\n",
|
| 1175 |
+
" </tr>\n",
|
| 1176 |
+
" <tr>\n",
|
| 1177 |
+
" <th>1041</th>\n",
|
| 1178 |
+
" <td>101</td>\n",
|
| 1179 |
+
" <td>70</td>\n",
|
| 1180 |
+
" <td>48</td>\n",
|
| 1181 |
+
" <td>25.360592</td>\n",
|
| 1182 |
+
" <td>75.031933</td>\n",
|
| 1183 |
+
" <td>6.012697</td>\n",
|
| 1184 |
+
" <td>116.553145</td>\n",
|
| 1185 |
+
" </tr>\n",
|
| 1186 |
+
" <tr>\n",
|
| 1187 |
+
" <th>1179</th>\n",
|
| 1188 |
+
" <td>0</td>\n",
|
| 1189 |
+
" <td>17</td>\n",
|
| 1190 |
+
" <td>30</td>\n",
|
| 1191 |
+
" <td>35.474783</td>\n",
|
| 1192 |
+
" <td>47.972305</td>\n",
|
| 1193 |
+
" <td>6.279134</td>\n",
|
| 1194 |
+
" <td>97.790725</td>\n",
|
| 1195 |
+
" </tr>\n",
|
| 1196 |
+
" <tr>\n",
|
| 1197 |
+
" <th>...</th>\n",
|
| 1198 |
+
" <td>...</td>\n",
|
| 1199 |
+
" <td>...</td>\n",
|
| 1200 |
+
" <td>...</td>\n",
|
| 1201 |
+
" <td>...</td>\n",
|
| 1202 |
+
" <td>...</td>\n",
|
| 1203 |
+
" <td>...</td>\n",
|
| 1204 |
+
" <td>...</td>\n",
|
| 1205 |
+
" </tr>\n",
|
| 1206 |
+
" <tr>\n",
|
| 1207 |
+
" <th>1638</th>\n",
|
| 1208 |
+
" <td>10</td>\n",
|
| 1209 |
+
" <td>5</td>\n",
|
| 1210 |
+
" <td>5</td>\n",
|
| 1211 |
+
" <td>21.213070</td>\n",
|
| 1212 |
+
" <td>91.353492</td>\n",
|
| 1213 |
+
" <td>7.817846</td>\n",
|
| 1214 |
+
" <td>112.983436</td>\n",
|
| 1215 |
+
" </tr>\n",
|
| 1216 |
+
" <tr>\n",
|
| 1217 |
+
" <th>1095</th>\n",
|
| 1218 |
+
" <td>108</td>\n",
|
| 1219 |
+
" <td>94</td>\n",
|
| 1220 |
+
" <td>47</td>\n",
|
| 1221 |
+
" <td>27.359116</td>\n",
|
| 1222 |
+
" <td>84.546250</td>\n",
|
| 1223 |
+
" <td>6.387431</td>\n",
|
| 1224 |
+
" <td>90.812505</td>\n",
|
| 1225 |
+
" </tr>\n",
|
| 1226 |
+
" <tr>\n",
|
| 1227 |
+
" <th>1130</th>\n",
|
| 1228 |
+
" <td>11</td>\n",
|
| 1229 |
+
" <td>36</td>\n",
|
| 1230 |
+
" <td>31</td>\n",
|
| 1231 |
+
" <td>27.920633</td>\n",
|
| 1232 |
+
" <td>51.779659</td>\n",
|
| 1233 |
+
" <td>6.475449</td>\n",
|
| 1234 |
+
" <td>100.258567</td>\n",
|
| 1235 |
+
" </tr>\n",
|
| 1236 |
+
" <tr>\n",
|
| 1237 |
+
" <th>1294</th>\n",
|
| 1238 |
+
" <td>11</td>\n",
|
| 1239 |
+
" <td>124</td>\n",
|
| 1240 |
+
" <td>204</td>\n",
|
| 1241 |
+
" <td>13.429886</td>\n",
|
| 1242 |
+
" <td>80.066340</td>\n",
|
| 1243 |
+
" <td>6.361141</td>\n",
|
| 1244 |
+
" <td>71.400430</td>\n",
|
| 1245 |
+
" </tr>\n",
|
| 1246 |
+
" <tr>\n",
|
| 1247 |
+
" <th>860</th>\n",
|
| 1248 |
+
" <td>32</td>\n",
|
| 1249 |
+
" <td>78</td>\n",
|
| 1250 |
+
" <td>22</td>\n",
|
| 1251 |
+
" <td>23.970814</td>\n",
|
| 1252 |
+
" <td>62.355576</td>\n",
|
| 1253 |
+
" <td>7.007038</td>\n",
|
| 1254 |
+
" <td>53.409060</td>\n",
|
| 1255 |
+
" </tr>\n",
|
| 1256 |
+
" </tbody>\n",
|
| 1257 |
+
"</table>\n",
|
| 1258 |
+
"<p>1760 rows × 7 columns</p>\n",
|
| 1259 |
+
"</div>"
|
| 1260 |
+
],
|
| 1261 |
+
"text/plain": [
|
| 1262 |
+
" N P K temperature humidity ph rainfall\n",
|
| 1263 |
+
"1656 17 16 14 16.396243 92.181519 6.625539 102.944161\n",
|
| 1264 |
+
"752 37 79 19 27.543848 69.347863 7.143943 69.408782\n",
|
| 1265 |
+
"892 7 73 25 27.521856 63.132153 7.288057 45.208411\n",
|
| 1266 |
+
"1041 101 70 48 25.360592 75.031933 6.012697 116.553145\n",
|
| 1267 |
+
"1179 0 17 30 35.474783 47.972305 6.279134 97.790725\n",
|
| 1268 |
+
"... ... ... ... ... ... ... ...\n",
|
| 1269 |
+
"1638 10 5 5 21.213070 91.353492 7.817846 112.983436\n",
|
| 1270 |
+
"1095 108 94 47 27.359116 84.546250 6.387431 90.812505\n",
|
| 1271 |
+
"1130 11 36 31 27.920633 51.779659 6.475449 100.258567\n",
|
| 1272 |
+
"1294 11 124 204 13.429886 80.066340 6.361141 71.400430\n",
|
| 1273 |
+
"860 32 78 22 23.970814 62.355576 7.007038 53.409060\n",
|
| 1274 |
+
"\n",
|
| 1275 |
+
"[1760 rows x 7 columns]"
|
| 1276 |
+
]
|
| 1277 |
+
},
|
| 1278 |
+
"execution_count": 33,
|
| 1279 |
+
"metadata": {},
|
| 1280 |
+
"output_type": "execute_result"
|
| 1281 |
+
}
|
| 1282 |
+
],
|
| 1283 |
+
"source": [
|
| 1284 |
+
"X_train"
|
| 1285 |
+
]
|
| 1286 |
+
},
|
| 1287 |
+
{
|
| 1288 |
+
"cell_type": "markdown",
|
| 1289 |
+
"id": "ab13cdf8",
|
| 1290 |
+
"metadata": {},
|
| 1291 |
+
"source": [
|
| 1292 |
+
"\n",
|
| 1293 |
+
"# Scale the features using MinMaxScaler"
|
| 1294 |
+
]
|
| 1295 |
+
},
|
| 1296 |
+
{
|
| 1297 |
+
"cell_type": "code",
|
| 1298 |
+
"execution_count": 34,
|
| 1299 |
+
"id": "f19981a7",
|
| 1300 |
+
"metadata": {},
|
| 1301 |
+
"outputs": [],
|
| 1302 |
+
"source": [
|
| 1303 |
+
"from sklearn.preprocessing import MinMaxScaler\n",
|
| 1304 |
+
"ms = MinMaxScaler()\n",
|
| 1305 |
+
"\n",
|
| 1306 |
+
"X_train = ms.fit_transform(X_train)\n",
|
| 1307 |
+
"X_test = ms.transform(X_test)"
|
| 1308 |
+
]
|
| 1309 |
+
},
|
| 1310 |
+
{
|
| 1311 |
+
"cell_type": "code",
|
| 1312 |
+
"execution_count": 35,
|
| 1313 |
+
"id": "f3f50c64",
|
| 1314 |
+
"metadata": {},
|
| 1315 |
+
"outputs": [
|
| 1316 |
+
{
|
| 1317 |
+
"data": {
|
| 1318 |
+
"text/plain": [
|
| 1319 |
+
"array([[0.12142857, 0.07857143, 0.045 , ..., 0.9089898 , 0.48532225,\n",
|
| 1320 |
+
" 0.29685161],\n",
|
| 1321 |
+
" [0.26428571, 0.52857143, 0.07 , ..., 0.64257946, 0.56594073,\n",
|
| 1322 |
+
" 0.17630752],\n",
|
| 1323 |
+
" [0.05 , 0.48571429, 0.1 , ..., 0.57005802, 0.58835229,\n",
|
| 1324 |
+
" 0.08931844],\n",
|
| 1325 |
+
" ...,\n",
|
| 1326 |
+
" [0.07857143, 0.22142857, 0.13 , ..., 0.43760347, 0.46198144,\n",
|
| 1327 |
+
" 0.28719815],\n",
|
| 1328 |
+
" [0.07857143, 0.85 , 0.995 , ..., 0.76763665, 0.44420505,\n",
|
| 1329 |
+
" 0.18346657],\n",
|
| 1330 |
+
" [0.22857143, 0.52142857, 0.085 , ..., 0.56099735, 0.54465022,\n",
|
| 1331 |
+
" 0.11879596]])"
|
| 1332 |
+
]
|
| 1333 |
+
},
|
| 1334 |
+
"execution_count": 35,
|
| 1335 |
+
"metadata": {},
|
| 1336 |
+
"output_type": "execute_result"
|
| 1337 |
+
}
|
| 1338 |
+
],
|
| 1339 |
+
"source": [
|
| 1340 |
+
"X_train"
|
| 1341 |
+
]
|
| 1342 |
+
},
|
| 1343 |
+
{
|
| 1344 |
+
"cell_type": "markdown",
|
| 1345 |
+
"id": "752a08ae",
|
| 1346 |
+
"metadata": {},
|
| 1347 |
+
"source": [
|
| 1348 |
+
"# Training Models"
|
| 1349 |
+
]
|
| 1350 |
+
},
|
| 1351 |
+
{
|
| 1352 |
+
"cell_type": "code",
|
| 1353 |
+
"execution_count": 51,
|
| 1354 |
+
"id": "ac6ef55e",
|
| 1355 |
+
"metadata": {},
|
| 1356 |
+
"outputs": [
|
| 1357 |
+
{
|
| 1358 |
+
"name": "stdout",
|
| 1359 |
+
"output_type": "stream",
|
| 1360 |
+
"text": [
|
| 1361 |
+
"Logistic Regression with accuracy : 0.9181818181818182\n",
|
| 1362 |
+
"Confusion matrix : [[16 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1363 |
+
" [ 0 20 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1364 |
+
" [ 6 0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1]\n",
|
| 1365 |
+
" [ 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1366 |
+
" [ 0 0 0 0 27 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1367 |
+
" [ 3 0 0 0 0 17 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0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
"==========================================================\n",
|
| 1385 |
+
"Naive Bayes with accuracy : 0.9954545454545455\n",
|
| 1386 |
+
"Confusion matrix : [[17 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1387 |
+
" [ 0 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1388 |
+
" [ 0 0 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1389 |
+
" [ 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1390 |
+
" [ 0 0 0 0 27 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1391 |
+
" [ 0 0 0 0 0 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1392 |
+
" [ 0 0 0 0 0 0 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1393 |
+
" [ 0 0 0 0 0 0 0 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1394 |
+
" [ 0 0 0 0 0 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1395 |
+
" [ 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1396 |
+
" [ 0 0 0 0 0 0 0 0 0 0 14 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1397 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1398 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 21 0 0 0 0 0 0 0 0 0]\n",
|
| 1399 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 23 0 0 0 0 0 0 0 0]\n",
|
| 1400 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 0 0 0 0 0 0 0]\n",
|
| 1401 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0 0 0 0 0 0]\n",
|
| 1402 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0]\n",
|
| 1403 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 24 0 0 0 0]\n",
|
| 1404 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 23 0 0 0]\n",
|
| 1405 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0 0]\n",
|
| 1406 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 26 0]\n",
|
| 1407 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17]]\n",
|
| 1408 |
+
"==========================================================\n",
|
| 1409 |
+
"Support Vector Machine with accuracy : 0.9681818181818181\n",
|
| 1410 |
+
"Confusion matrix : [[14 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1411 |
+
" [ 0 20 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1412 |
+
" [ 0 0 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1]\n",
|
| 1413 |
+
" [ 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1414 |
+
" [ 0 0 0 0 27 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1415 |
+
" [ 0 0 0 0 0 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1416 |
+
" [ 0 0 0 0 0 0 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1417 |
+
" [ 0 0 0 0 0 0 0 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1418 |
+
" [ 0 0 0 0 0 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1419 |
+
" [ 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1420 |
+
" [ 0 0 0 0 0 0 0 0 0 0 14 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1421 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1422 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 21 0 0 0 0 0 0 0 0 0]\n",
|
| 1423 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 23 0 0 0 0 0 0 0 0]\n",
|
| 1424 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 0 0 0 0 0 0 0]\n",
|
| 1425 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 19 0 0 0 0 0 0]\n",
|
| 1426 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0]\n",
|
| 1427 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 21 0 0 0 0]\n",
|
| 1428 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 20 2 0 0]\n",
|
| 1429 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0 0]\n",
|
| 1430 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 26 0]\n",
|
| 1431 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17]]\n",
|
| 1432 |
+
"==========================================================\n",
|
| 1433 |
+
"K-Nearest Neighbors with accuracy : 0.9704545454545455\n",
|
| 1434 |
+
"Confusion matrix : [[14 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1435 |
+
" [ 0 21 0 0 0 0 0 0 0 0 0 0 0 0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]\n",
|
| 1452 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 20 2 0 0]\n",
|
| 1453 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0 0]\n",
|
| 1454 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 26 0]\n",
|
| 1455 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17]]\n",
|
| 1456 |
+
"==========================================================\n",
|
| 1457 |
+
"Decision Tree with accuracy : 0.9818181818181818\n",
|
| 1458 |
+
"Confusion matrix : [[17 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1459 |
+
" [ 0 20 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1460 |
+
" [ 3 0 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1461 |
+
" [ 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1462 |
+
" [ 0 0 0 0 27 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1463 |
+
" [ 0 0 0 0 0 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1464 |
+
" [ 0 0 0 0 0 0 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1465 |
+
" [ 0 0 0 0 0 0 0 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1466 |
+
" [ 0 0 0 0 0 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1467 |
+
" [ 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1468 |
+
" [ 0 0 0 0 0 0 0 0 0 0 14 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1469 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1470 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 21 0 0 0 0 0 0 0 0 0]\n",
|
| 1471 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 23 0 0 0 0 0 0 0 0]\n",
|
| 1472 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 0 0 0 0 0 0 0]\n",
|
| 1473 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0 0 0 0 0 0]\n",
|
| 1474 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0]\n",
|
| 1475 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 22 0 0 0 0]\n",
|
| 1476 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 23 0 0 0]\n",
|
| 1477 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0 0]\n",
|
| 1478 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 26 0]\n",
|
| 1479 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17]]\n",
|
| 1480 |
+
"==========================================================\n"
|
| 1481 |
+
]
|
| 1482 |
+
},
|
| 1483 |
+
{
|
| 1484 |
+
"name": "stdout",
|
| 1485 |
+
"output_type": "stream",
|
| 1486 |
+
"text": [
|
| 1487 |
+
"Random Forest with accuracy : 0.9931818181818182\n",
|
| 1488 |
+
"Confusion matrix : [[17 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1489 |
+
" [ 0 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1490 |
+
" [ 0 0 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0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507 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0 0]\n",
|
| 1508 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 26 0]\n",
|
| 1509 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17]]\n",
|
| 1510 |
+
"==========================================================\n",
|
| 1511 |
+
"Bagging with accuracy : 0.9886363636363636\n",
|
| 1512 |
+
"Confusion matrix : [[17 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1513 |
+
" [ 0 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1514 |
+
" [ 1 0 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1515 |
+
" [ 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1516 |
+
" [ 0 0 0 0 27 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1517 |
+
" [ 0 0 0 0 0 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1518 |
+
" [ 0 0 0 0 0 0 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1519 |
+
" [ 0 0 0 0 0 0 0 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1520 |
+
" [ 0 0 0 0 0 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1521 |
+
" [ 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1522 |
+
" [ 0 0 0 0 0 0 0 0 0 0 14 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1523 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1524 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 21 0 0 0 0 0 0 0 0 0]\n",
|
| 1525 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 23 0 0 0 0 0 0 0 0]\n",
|
| 1526 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 0 0 0 0 0 0 0]\n",
|
| 1527 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0 0 0 0 0 0]\n",
|
| 1528 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0]\n",
|
| 1529 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 22 0 0 0 0]\n",
|
| 1530 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 23 0 0 0]\n",
|
| 1531 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0 0]\n",
|
| 1532 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 26 0]\n",
|
| 1533 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17]]\n",
|
| 1534 |
+
"==========================================================\n"
|
| 1535 |
+
]
|
| 1536 |
+
},
|
| 1537 |
+
{
|
| 1538 |
+
"name": "stderr",
|
| 1539 |
+
"output_type": "stream",
|
| 1540 |
+
"text": [
|
| 1541 |
+
"C:\\Users\\Noor Saeed\\AppData\\Roaming\\Python\\Python39\\site-packages\\sklearn\\ensemble\\_weight_boosting.py:527: FutureWarning: The SAMME.R algorithm (the default) is deprecated and will be removed in 1.6. Use the SAMME algorithm to circumvent this warning.\n",
|
| 1542 |
+
" warnings.warn(\n"
|
| 1543 |
+
]
|
| 1544 |
+
},
|
| 1545 |
+
{
|
| 1546 |
+
"name": "stdout",
|
| 1547 |
+
"output_type": "stream",
|
| 1548 |
+
"text": [
|
| 1549 |
+
"AdaBoost with accuracy : 0.09545454545454546\n",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 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0 0 0]\n",
|
| 1567 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 24 0 0 0 0 0 0 0]\n",
|
| 1568 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 23 0 0 0 0 0 0 0]\n",
|
| 1569 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0 0 0 0 0 0 0]\n",
|
| 1570 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 26 0 0 0 0 0 0 0]\n",
|
| 1571 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 0 0 0 0 0 0 0]]\n",
|
| 1572 |
+
"==========================================================\n",
|
| 1573 |
+
"Gradient Boosting with accuracy : 0.9818181818181818\n",
|
| 1574 |
+
"Confusion matrix : [[15 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1575 |
+
" [ 0 20 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1576 |
+
" [ 0 0 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1577 |
+
" [ 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1578 |
+
" [ 0 0 1 0 26 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1579 |
+
" [ 0 0 0 0 0 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1580 |
+
" [ 0 0 0 0 0 0 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1581 |
+
" [ 0 0 0 0 0 0 0 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1582 |
+
" [ 0 0 0 0 0 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1583 |
+
" [ 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1584 |
+
" [ 0 0 0 0 0 0 0 0 0 0 14 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1585 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1586 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 21 0 0 0 0 0 0 0 0 0]\n",
|
| 1587 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 23 0 0 0 0 0 0 0 0]\n",
|
| 1588 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 0 0 0 0 0 0 0]\n",
|
| 1589 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0 0 0 0 0 0]\n",
|
| 1590 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0]\n",
|
| 1591 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 23 0 0 0 0]\n",
|
| 1592 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 22 0 0 0]\n",
|
| 1593 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0 0]\n",
|
| 1594 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 26 0]\n",
|
| 1595 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17]]\n",
|
| 1596 |
+
"==========================================================\n",
|
| 1597 |
+
"Extra Trees with accuracy : 0.8863636363636364\n",
|
| 1598 |
+
"Confusion matrix : [[12 0 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1599 |
+
" [ 0 18 0 2 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0]\n",
|
| 1600 |
+
" [ 6 0 15 0 0 0 0 0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 0 0 16 4 0 0]\n",
|
| 1617 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 4 15 0 0]\n",
|
| 1618 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 26 0]\n",
|
| 1619 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 16]]\n",
|
| 1620 |
+
"==========================================================\n"
|
| 1621 |
+
]
|
| 1622 |
+
}
|
| 1623 |
+
],
|
| 1624 |
+
"source": [
|
| 1625 |
+
"from sklearn.linear_model import LogisticRegression\n",
|
| 1626 |
+
"from sklearn.naive_bayes import GaussianNB\n",
|
| 1627 |
+
"from sklearn.svm import SVC\n",
|
| 1628 |
+
"from sklearn.neighbors import KNeighborsClassifier\n",
|
| 1629 |
+
"from sklearn.tree import DecisionTreeClassifier\n",
|
| 1630 |
+
"from sklearn.tree import ExtraTreeClassifier\n",
|
| 1631 |
+
"from sklearn.ensemble import RandomForestClassifier\n",
|
| 1632 |
+
"from sklearn.ensemble import BaggingClassifier\n",
|
| 1633 |
+
"from sklearn.ensemble import GradientBoostingClassifier\n",
|
| 1634 |
+
"from sklearn.ensemble import AdaBoostClassifier\n",
|
| 1635 |
+
"from sklearn.metrics import accuracy_score,confusion_matrix\n",
|
| 1636 |
+
"\n",
|
| 1637 |
+
"# create instances of all models\n",
|
| 1638 |
+
"models = {\n",
|
| 1639 |
+
" 'Logistic Regression': LogisticRegression(),\n",
|
| 1640 |
+
" 'Naive Bayes': GaussianNB(),\n",
|
| 1641 |
+
" 'Support Vector Machine': SVC(),\n",
|
| 1642 |
+
" 'K-Nearest Neighbors': KNeighborsClassifier(),\n",
|
| 1643 |
+
" 'Decision Tree': DecisionTreeClassifier(),\n",
|
| 1644 |
+
" 'Random Forest': RandomForestClassifier(),\n",
|
| 1645 |
+
" 'Bagging': BaggingClassifier(),\n",
|
| 1646 |
+
" 'AdaBoost': AdaBoostClassifier(),\n",
|
| 1647 |
+
" 'Gradient Boosting': GradientBoostingClassifier(),\n",
|
| 1648 |
+
" 'Extra Trees': ExtraTreeClassifier(),\n",
|
| 1649 |
+
"}\n",
|
| 1650 |
+
"\n",
|
| 1651 |
+
"\n",
|
| 1652 |
+
"for name, model in models.items():\n",
|
| 1653 |
+
" model.fit(X_train,y_train)\n",
|
| 1654 |
+
" ypred = model.predict(X_test)\n",
|
| 1655 |
+
" \n",
|
| 1656 |
+
" print(f\"{name} with accuracy : {accuracy_score(y_test,ypred)}\")\n",
|
| 1657 |
+
" print(\"Confusion matrix : \",confusion_matrix(y_test,ypred))\n",
|
| 1658 |
+
" print(\"==========================================================\")\n",
|
| 1659 |
+
" "
|
| 1660 |
+
]
|
| 1661 |
+
},
|
| 1662 |
+
{
|
| 1663 |
+
"cell_type": "code",
|
| 1664 |
+
"execution_count": 38,
|
| 1665 |
+
"id": "4659be4d",
|
| 1666 |
+
"metadata": {},
|
| 1667 |
+
"outputs": [
|
| 1668 |
+
{
|
| 1669 |
+
"data": {
|
| 1670 |
+
"text/plain": [
|
| 1671 |
+
"0.9931818181818182"
|
| 1672 |
+
]
|
| 1673 |
+
},
|
| 1674 |
+
"execution_count": 38,
|
| 1675 |
+
"metadata": {},
|
| 1676 |
+
"output_type": "execute_result"
|
| 1677 |
+
}
|
| 1678 |
+
],
|
| 1679 |
+
"source": [
|
| 1680 |
+
"# finally selected randomforest model\n",
|
| 1681 |
+
"\n",
|
| 1682 |
+
"rfc = RandomForestClassifier()\n",
|
| 1683 |
+
"rfc.fit(X_train,y_train)\n",
|
| 1684 |
+
"ypred = rfc.predict(X_test)\n",
|
| 1685 |
+
"accuracy_score(y_test,ypred)"
|
| 1686 |
+
]
|
| 1687 |
+
},
|
| 1688 |
+
{
|
| 1689 |
+
"cell_type": "code",
|
| 1690 |
+
"execution_count": 44,
|
| 1691 |
+
"id": "3e72d7f1",
|
| 1692 |
+
"metadata": {},
|
| 1693 |
+
"outputs": [
|
| 1694 |
+
{
|
| 1695 |
+
"data": {
|
| 1696 |
+
"text/plain": [
|
| 1697 |
+
"0.9954545454545455"
|
| 1698 |
+
]
|
| 1699 |
+
},
|
| 1700 |
+
"execution_count": 44,
|
| 1701 |
+
"metadata": {},
|
| 1702 |
+
"output_type": "execute_result"
|
| 1703 |
+
}
|
| 1704 |
+
],
|
| 1705 |
+
"source": [
|
| 1706 |
+
"# or gausianjb\n",
|
| 1707 |
+
"gnb = GaussianNB()\n",
|
| 1708 |
+
"gnb.fit(X_train,y_train)\n",
|
| 1709 |
+
"ypred = gnb.predict(X_test)\n",
|
| 1710 |
+
"accuracy_score(y_test,ypred)"
|
| 1711 |
+
]
|
| 1712 |
+
},
|
| 1713 |
+
{
|
| 1714 |
+
"cell_type": "markdown",
|
| 1715 |
+
"id": "859d9922",
|
| 1716 |
+
"metadata": {},
|
| 1717 |
+
"source": [
|
| 1718 |
+
"# Predictive System"
|
| 1719 |
+
]
|
| 1720 |
+
},
|
| 1721 |
+
{
|
| 1722 |
+
"cell_type": "code",
|
| 1723 |
+
"execution_count": 61,
|
| 1724 |
+
"id": "17f3a3fe",
|
| 1725 |
+
"metadata": {},
|
| 1726 |
+
"outputs": [],
|
| 1727 |
+
"source": [
|
| 1728 |
+
"def recommendation(N,P,k,temperature,humidity,ph,rainfal):\n",
|
| 1729 |
+
" features = np.array([[N,P,k,temperature,humidity,ph,rainfal]])\n",
|
| 1730 |
+
" transformed_features = ms.fit_transform(features)\n",
|
| 1731 |
+
" prediction = rfc.predict(transformed_features)\n",
|
| 1732 |
+
" print(prediction)\n",
|
| 1733 |
+
" return prediction[0] "
|
| 1734 |
+
]
|
| 1735 |
+
},
|
| 1736 |
+
{
|
| 1737 |
+
"cell_type": "code",
|
| 1738 |
+
"execution_count": 62,
|
| 1739 |
+
"id": "64ffd9d3",
|
| 1740 |
+
"metadata": {},
|
| 1741 |
+
"outputs": [
|
| 1742 |
+
{
|
| 1743 |
+
"name": "stdout",
|
| 1744 |
+
"output_type": "stream",
|
| 1745 |
+
"text": [
|
| 1746 |
+
"[9]\n",
|
| 1747 |
+
"Muskmelon is a best crop to be cultivated \n"
|
| 1748 |
+
]
|
| 1749 |
+
}
|
| 1750 |
+
],
|
| 1751 |
+
"source": [
|
| 1752 |
+
"# new inputs\n",
|
| 1753 |
+
"\n",
|
| 1754 |
+
"\n",
|
| 1755 |
+
"N = 40\n",
|
| 1756 |
+
"P = 50\n",
|
| 1757 |
+
"k = 50\n",
|
| 1758 |
+
"temperature = 40.0\n",
|
| 1759 |
+
"humidity = 20\n",
|
| 1760 |
+
"ph = 100\n",
|
| 1761 |
+
"rainfall = 100\n",
|
| 1762 |
+
"\n",
|
| 1763 |
+
"predict = recommendation(N,P,k,temperature,humidity,ph,rainfall)\n",
|
| 1764 |
+
"\n",
|
| 1765 |
+
"crop_dict = {1: \"Rice\", 2: \"Maize\", 3: \"Jute\", 4: \"Cotton\", 5: \"Coconut\", 6: \"Papaya\", 7: \"Orange\",\n",
|
| 1766 |
+
" 8: \"Apple\", 9: \"Muskmelon\", 10: \"Watermelon\", 11: \"Grapes\", 12: \"Mango\", 13: \"Banana\",\n",
|
| 1767 |
+
" 14: \"Pomegranate\", 15: \"Lentil\", 16: \"Blackgram\", 17: \"Mungbean\", 18: \"Mothbeans\",\n",
|
| 1768 |
+
" 19: \"Pigeonpeas\", 20: \"Kidneybeans\", 21: \"Chickpea\", 22: \"Coffee\"}\n",
|
| 1769 |
+
"\n",
|
| 1770 |
+
"if predict in crop_dict:\n",
|
| 1771 |
+
" crop = crop_dict[predict]\n",
|
| 1772 |
+
" print(\"{} is a best crop to be cultivated \".format(crop))\n",
|
| 1773 |
+
"else:\n",
|
| 1774 |
+
" print(\"Sorry are not able to recommend a proper crop for this environment\")"
|
| 1775 |
+
]
|
| 1776 |
+
},
|
| 1777 |
+
{
|
| 1778 |
+
"cell_type": "code",
|
| 1779 |
+
"execution_count": 63,
|
| 1780 |
+
"id": "2ea8ffda",
|
| 1781 |
+
"metadata": {},
|
| 1782 |
+
"outputs": [
|
| 1783 |
+
{
|
| 1784 |
+
"name": "stdout",
|
| 1785 |
+
"output_type": "stream",
|
| 1786 |
+
"text": [
|
| 1787 |
+
"[9]\n",
|
| 1788 |
+
"Muskmelon is a best crop to be cultivated \n"
|
| 1789 |
+
]
|
| 1790 |
+
}
|
| 1791 |
+
],
|
| 1792 |
+
"source": [
|
| 1793 |
+
"# new inputs 2\n",
|
| 1794 |
+
"\n",
|
| 1795 |
+
"\n",
|
| 1796 |
+
"N = 100\n",
|
| 1797 |
+
"P = 90\n",
|
| 1798 |
+
"k = 100\n",
|
| 1799 |
+
"temperature = 50.0\n",
|
| 1800 |
+
"humidity = 90.0\n",
|
| 1801 |
+
"ph = 100\n",
|
| 1802 |
+
"rainfall = 202.0\n",
|
| 1803 |
+
"\n",
|
| 1804 |
+
"predict = recommendation(N,P,k,temperature,humidity,ph,rainfall)\n",
|
| 1805 |
+
"\n",
|
| 1806 |
+
"crop_dict = {1: \"Rice\", 2: \"Maize\", 3: \"Jute\", 4: \"Cotton\", 5: \"Coconut\", 6: \"Papaya\", 7: \"Orange\",\n",
|
| 1807 |
+
" 8: \"Apple\", 9: \"Muskmelon\", 10: \"Watermelon\", 11: \"Grapes\", 12: \"Mango\", 13: \"Banana\",\n",
|
| 1808 |
+
" 14: \"Pomegranate\", 15: \"Lentil\", 16: \"Blackgram\", 17: \"Mungbean\", 18: \"Mothbeans\",\n",
|
| 1809 |
+
" 19: \"Pigeonpeas\", 20: \"Kidneybeans\", 21: \"Chickpea\", 22: \"Coffee\"}\n",
|
| 1810 |
+
"\n",
|
| 1811 |
+
"if predict in crop_dict:\n",
|
| 1812 |
+
" crop = crop_dict[predict]\n",
|
| 1813 |
+
" print(\"{} is a best crop to be cultivated \".format(crop))\n",
|
| 1814 |
+
"else:\n",
|
| 1815 |
+
" print(\"Sorry are not able to recommend a proper crop for this environment\")"
|
| 1816 |
+
]
|
| 1817 |
+
},
|
| 1818 |
+
{
|
| 1819 |
+
"cell_type": "code",
|
| 1820 |
+
"execution_count": 64,
|
| 1821 |
+
"id": "d0dccd4e",
|
| 1822 |
+
"metadata": {},
|
| 1823 |
+
"outputs": [
|
| 1824 |
+
{
|
| 1825 |
+
"name": "stdout",
|
| 1826 |
+
"output_type": "stream",
|
| 1827 |
+
"text": [
|
| 1828 |
+
"[9]\n",
|
| 1829 |
+
"Muskmelon is a best crop to be cultivated \n"
|
| 1830 |
+
]
|
| 1831 |
+
}
|
| 1832 |
+
],
|
| 1833 |
+
"source": [
|
| 1834 |
+
"# new inputs 2\n",
|
| 1835 |
+
"N = 10\n",
|
| 1836 |
+
"P = 10\n",
|
| 1837 |
+
"k = 10\n",
|
| 1838 |
+
"temperature = 15.0\n",
|
| 1839 |
+
"humidity = 80.0\n",
|
| 1840 |
+
"ph = 4.5\n",
|
| 1841 |
+
"rainfall = 10.0\n",
|
| 1842 |
+
"\n",
|
| 1843 |
+
"predict = recommendation(N,P,k,temperature,humidity,ph,rainfall)\n",
|
| 1844 |
+
"\n",
|
| 1845 |
+
"crop_dict = {1: \"Rice\", 2: \"Maize\", 3: \"Jute\", 4: \"Cotton\", 5: \"Coconut\", 6: \"Papaya\", 7: \"Orange\",\n",
|
| 1846 |
+
" 8: \"Apple\", 9: \"Muskmelon\", 10: \"Watermelon\", 11: \"Grapes\", 12: \"Mango\", 13: \"Banana\",\n",
|
| 1847 |
+
" 14: \"Pomegranate\", 15: \"Lentil\", 16: \"Blackgram\", 17: \"Mungbean\", 18: \"Mothbeans\",\n",
|
| 1848 |
+
" 19: \"Pigeonpeas\", 20: \"Kidneybeans\", 21: \"Chickpea\", 22: \"Coffee\"}\n",
|
| 1849 |
+
"\n",
|
| 1850 |
+
"if predict in crop_dict:\n",
|
| 1851 |
+
" crop = crop_dict[predict]\n",
|
| 1852 |
+
" print(\"{} is a best crop to be cultivated \".format(crop))\n",
|
| 1853 |
+
"else:\n",
|
| 1854 |
+
" print(\"Sorry are not able to recommend a proper crop for this environment\")"
|
| 1855 |
+
]
|
| 1856 |
+
},
|
| 1857 |
+
{
|
| 1858 |
+
"cell_type": "code",
|
| 1859 |
+
"execution_count": 66,
|
| 1860 |
+
"id": "fa3d3b8c",
|
| 1861 |
+
"metadata": {},
|
| 1862 |
+
"outputs": [],
|
| 1863 |
+
"source": [
|
| 1864 |
+
"import pickle\n",
|
| 1865 |
+
"pickle.dump(rfc,open('model.pkl','wb'))\n",
|
| 1866 |
+
"pickle.dump(ms,open('minmaxscaler.pkl','wb'))"
|
| 1867 |
+
]
|
| 1868 |
+
},
|
| 1869 |
+
{
|
| 1870 |
+
"cell_type": "code",
|
| 1871 |
+
"execution_count": null,
|
| 1872 |
+
"id": "a55a48a3",
|
| 1873 |
+
"metadata": {},
|
| 1874 |
+
"outputs": [],
|
| 1875 |
+
"source": []
|
| 1876 |
+
},
|
| 1877 |
+
{
|
| 1878 |
+
"cell_type": "code",
|
| 1879 |
+
"execution_count": null,
|
| 1880 |
+
"id": "c97733fc",
|
| 1881 |
+
"metadata": {},
|
| 1882 |
+
"outputs": [],
|
| 1883 |
+
"source": []
|
| 1884 |
+
}
|
| 1885 |
+
],
|
| 1886 |
+
"metadata": {
|
| 1887 |
+
"kernelspec": {
|
| 1888 |
+
"display_name": "Python 3 (ipykernel)",
|
| 1889 |
+
"language": "python",
|
| 1890 |
+
"name": "python3"
|
| 1891 |
+
},
|
| 1892 |
+
"language_info": {
|
| 1893 |
+
"codemirror_mode": {
|
| 1894 |
+
"name": "ipython",
|
| 1895 |
+
"version": 3
|
| 1896 |
+
},
|
| 1897 |
+
"file_extension": ".py",
|
| 1898 |
+
"mimetype": "text/x-python",
|
| 1899 |
+
"name": "python",
|
| 1900 |
+
"nbconvert_exporter": "python",
|
| 1901 |
+
"pygments_lexer": "ipython3",
|
| 1902 |
+
"version": "3.9.12"
|
| 1903 |
+
}
|
| 1904 |
+
},
|
| 1905 |
+
"nbformat": 4,
|
| 1906 |
+
"nbformat_minor": 5
|
| 1907 |
+
}
|
Crop Classification With Recommendation System.ipynb
ADDED
|
@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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cells": [
|
| 3 |
+
{
|
| 4 |
+
"cell_type": "markdown",
|
| 5 |
+
"id": "6bdfd636",
|
| 6 |
+
"metadata": {},
|
| 7 |
+
"source": [
|
| 8 |
+
"# Import Libaries"
|
| 9 |
+
]
|
| 10 |
+
},
|
| 11 |
+
{
|
| 12 |
+
"cell_type": "code",
|
| 13 |
+
"execution_count": 1,
|
| 14 |
+
"id": "7bee9b73",
|
| 15 |
+
"metadata": {},
|
| 16 |
+
"outputs": [],
|
| 17 |
+
"source": [
|
| 18 |
+
"import numpy as np\n",
|
| 19 |
+
"import pandas as pd"
|
| 20 |
+
]
|
| 21 |
+
},
|
| 22 |
+
{
|
| 23 |
+
"cell_type": "markdown",
|
| 24 |
+
"id": "2822305c",
|
| 25 |
+
"metadata": {},
|
| 26 |
+
"source": [
|
| 27 |
+
"# Importing Data"
|
| 28 |
+
]
|
| 29 |
+
},
|
| 30 |
+
{
|
| 31 |
+
"cell_type": "code",
|
| 32 |
+
"execution_count": 2,
|
| 33 |
+
"id": "5b6f8884",
|
| 34 |
+
"metadata": {},
|
| 35 |
+
"outputs": [
|
| 36 |
+
{
|
| 37 |
+
"data": {
|
| 38 |
+
"text/html": [
|
| 39 |
+
"<div>\n",
|
| 40 |
+
"<style scoped>\n",
|
| 41 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 42 |
+
" vertical-align: middle;\n",
|
| 43 |
+
" }\n",
|
| 44 |
+
"\n",
|
| 45 |
+
" .dataframe tbody tr th {\n",
|
| 46 |
+
" vertical-align: top;\n",
|
| 47 |
+
" }\n",
|
| 48 |
+
"\n",
|
| 49 |
+
" .dataframe thead th {\n",
|
| 50 |
+
" text-align: right;\n",
|
| 51 |
+
" }\n",
|
| 52 |
+
"</style>\n",
|
| 53 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 54 |
+
" <thead>\n",
|
| 55 |
+
" <tr style=\"text-align: right;\">\n",
|
| 56 |
+
" <th></th>\n",
|
| 57 |
+
" <th>N</th>\n",
|
| 58 |
+
" <th>P</th>\n",
|
| 59 |
+
" <th>K</th>\n",
|
| 60 |
+
" <th>temperature</th>\n",
|
| 61 |
+
" <th>humidity</th>\n",
|
| 62 |
+
" <th>ph</th>\n",
|
| 63 |
+
" <th>rainfall</th>\n",
|
| 64 |
+
" <th>label</th>\n",
|
| 65 |
+
" </tr>\n",
|
| 66 |
+
" </thead>\n",
|
| 67 |
+
" <tbody>\n",
|
| 68 |
+
" <tr>\n",
|
| 69 |
+
" <th>0</th>\n",
|
| 70 |
+
" <td>90</td>\n",
|
| 71 |
+
" <td>42</td>\n",
|
| 72 |
+
" <td>43</td>\n",
|
| 73 |
+
" <td>20.879744</td>\n",
|
| 74 |
+
" <td>82.002744</td>\n",
|
| 75 |
+
" <td>6.502985</td>\n",
|
| 76 |
+
" <td>202.935536</td>\n",
|
| 77 |
+
" <td>rice</td>\n",
|
| 78 |
+
" </tr>\n",
|
| 79 |
+
" <tr>\n",
|
| 80 |
+
" <th>1</th>\n",
|
| 81 |
+
" <td>85</td>\n",
|
| 82 |
+
" <td>58</td>\n",
|
| 83 |
+
" <td>41</td>\n",
|
| 84 |
+
" <td>21.770462</td>\n",
|
| 85 |
+
" <td>80.319644</td>\n",
|
| 86 |
+
" <td>7.038096</td>\n",
|
| 87 |
+
" <td>226.655537</td>\n",
|
| 88 |
+
" <td>rice</td>\n",
|
| 89 |
+
" </tr>\n",
|
| 90 |
+
" <tr>\n",
|
| 91 |
+
" <th>2</th>\n",
|
| 92 |
+
" <td>60</td>\n",
|
| 93 |
+
" <td>55</td>\n",
|
| 94 |
+
" <td>44</td>\n",
|
| 95 |
+
" <td>23.004459</td>\n",
|
| 96 |
+
" <td>82.320763</td>\n",
|
| 97 |
+
" <td>7.840207</td>\n",
|
| 98 |
+
" <td>263.964248</td>\n",
|
| 99 |
+
" <td>rice</td>\n",
|
| 100 |
+
" </tr>\n",
|
| 101 |
+
" <tr>\n",
|
| 102 |
+
" <th>3</th>\n",
|
| 103 |
+
" <td>74</td>\n",
|
| 104 |
+
" <td>35</td>\n",
|
| 105 |
+
" <td>40</td>\n",
|
| 106 |
+
" <td>26.491096</td>\n",
|
| 107 |
+
" <td>80.158363</td>\n",
|
| 108 |
+
" <td>6.980401</td>\n",
|
| 109 |
+
" <td>242.864034</td>\n",
|
| 110 |
+
" <td>rice</td>\n",
|
| 111 |
+
" </tr>\n",
|
| 112 |
+
" <tr>\n",
|
| 113 |
+
" <th>4</th>\n",
|
| 114 |
+
" <td>78</td>\n",
|
| 115 |
+
" <td>42</td>\n",
|
| 116 |
+
" <td>42</td>\n",
|
| 117 |
+
" <td>20.130175</td>\n",
|
| 118 |
+
" <td>81.604873</td>\n",
|
| 119 |
+
" <td>7.628473</td>\n",
|
| 120 |
+
" <td>262.717340</td>\n",
|
| 121 |
+
" <td>rice</td>\n",
|
| 122 |
+
" </tr>\n",
|
| 123 |
+
" </tbody>\n",
|
| 124 |
+
"</table>\n",
|
| 125 |
+
"</div>"
|
| 126 |
+
],
|
| 127 |
+
"text/plain": [
|
| 128 |
+
" N P K temperature humidity ph rainfall label\n",
|
| 129 |
+
"0 90 42 43 20.879744 82.002744 6.502985 202.935536 rice\n",
|
| 130 |
+
"1 85 58 41 21.770462 80.319644 7.038096 226.655537 rice\n",
|
| 131 |
+
"2 60 55 44 23.004459 82.320763 7.840207 263.964248 rice\n",
|
| 132 |
+
"3 74 35 40 26.491096 80.158363 6.980401 242.864034 rice\n",
|
| 133 |
+
"4 78 42 42 20.130175 81.604873 7.628473 262.717340 rice"
|
| 134 |
+
]
|
| 135 |
+
},
|
| 136 |
+
"execution_count": 2,
|
| 137 |
+
"metadata": {},
|
| 138 |
+
"output_type": "execute_result"
|
| 139 |
+
}
|
| 140 |
+
],
|
| 141 |
+
"source": [
|
| 142 |
+
"crop = pd.read_csv(\"Crop_recommendation.csv\")\n",
|
| 143 |
+
"crop.head()"
|
| 144 |
+
]
|
| 145 |
+
},
|
| 146 |
+
{
|
| 147 |
+
"cell_type": "markdown",
|
| 148 |
+
"id": "e9ddfb22",
|
| 149 |
+
"metadata": {},
|
| 150 |
+
"source": [
|
| 151 |
+
"# Asq Six Question to yourself"
|
| 152 |
+
]
|
| 153 |
+
},
|
| 154 |
+
{
|
| 155 |
+
"cell_type": "code",
|
| 156 |
+
"execution_count": 3,
|
| 157 |
+
"id": "3ca70c00",
|
| 158 |
+
"metadata": {},
|
| 159 |
+
"outputs": [
|
| 160 |
+
{
|
| 161 |
+
"data": {
|
| 162 |
+
"text/plain": [
|
| 163 |
+
"(2200, 8)"
|
| 164 |
+
]
|
| 165 |
+
},
|
| 166 |
+
"execution_count": 3,
|
| 167 |
+
"metadata": {},
|
| 168 |
+
"output_type": "execute_result"
|
| 169 |
+
}
|
| 170 |
+
],
|
| 171 |
+
"source": [
|
| 172 |
+
"crop.shape"
|
| 173 |
+
]
|
| 174 |
+
},
|
| 175 |
+
{
|
| 176 |
+
"cell_type": "code",
|
| 177 |
+
"execution_count": 4,
|
| 178 |
+
"id": "e2ae9b60",
|
| 179 |
+
"metadata": {},
|
| 180 |
+
"outputs": [
|
| 181 |
+
{
|
| 182 |
+
"name": "stdout",
|
| 183 |
+
"output_type": "stream",
|
| 184 |
+
"text": [
|
| 185 |
+
"<class 'pandas.core.frame.DataFrame'>\n",
|
| 186 |
+
"RangeIndex: 2200 entries, 0 to 2199\n",
|
| 187 |
+
"Data columns (total 8 columns):\n",
|
| 188 |
+
" # Column Non-Null Count Dtype \n",
|
| 189 |
+
"--- ------ -------------- ----- \n",
|
| 190 |
+
" 0 N 2200 non-null int64 \n",
|
| 191 |
+
" 1 P 2200 non-null int64 \n",
|
| 192 |
+
" 2 K 2200 non-null int64 \n",
|
| 193 |
+
" 3 temperature 2200 non-null float64\n",
|
| 194 |
+
" 4 humidity 2200 non-null float64\n",
|
| 195 |
+
" 5 ph 2200 non-null float64\n",
|
| 196 |
+
" 6 rainfall 2200 non-null float64\n",
|
| 197 |
+
" 7 label 2200 non-null object \n",
|
| 198 |
+
"dtypes: float64(4), int64(3), object(1)\n",
|
| 199 |
+
"memory usage: 137.6+ KB\n"
|
| 200 |
+
]
|
| 201 |
+
}
|
| 202 |
+
],
|
| 203 |
+
"source": [
|
| 204 |
+
"crop.info()"
|
| 205 |
+
]
|
| 206 |
+
},
|
| 207 |
+
{
|
| 208 |
+
"cell_type": "code",
|
| 209 |
+
"execution_count": 5,
|
| 210 |
+
"id": "9efad4c4",
|
| 211 |
+
"metadata": {},
|
| 212 |
+
"outputs": [
|
| 213 |
+
{
|
| 214 |
+
"data": {
|
| 215 |
+
"text/plain": [
|
| 216 |
+
"N 0\n",
|
| 217 |
+
"P 0\n",
|
| 218 |
+
"K 0\n",
|
| 219 |
+
"temperature 0\n",
|
| 220 |
+
"humidity 0\n",
|
| 221 |
+
"ph 0\n",
|
| 222 |
+
"rainfall 0\n",
|
| 223 |
+
"label 0\n",
|
| 224 |
+
"dtype: int64"
|
| 225 |
+
]
|
| 226 |
+
},
|
| 227 |
+
"execution_count": 5,
|
| 228 |
+
"metadata": {},
|
| 229 |
+
"output_type": "execute_result"
|
| 230 |
+
}
|
| 231 |
+
],
|
| 232 |
+
"source": [
|
| 233 |
+
"crop.isnull().sum()"
|
| 234 |
+
]
|
| 235 |
+
},
|
| 236 |
+
{
|
| 237 |
+
"cell_type": "code",
|
| 238 |
+
"execution_count": 6,
|
| 239 |
+
"id": "1f7bf8c5",
|
| 240 |
+
"metadata": {},
|
| 241 |
+
"outputs": [
|
| 242 |
+
{
|
| 243 |
+
"data": {
|
| 244 |
+
"text/plain": [
|
| 245 |
+
"0"
|
| 246 |
+
]
|
| 247 |
+
},
|
| 248 |
+
"execution_count": 6,
|
| 249 |
+
"metadata": {},
|
| 250 |
+
"output_type": "execute_result"
|
| 251 |
+
}
|
| 252 |
+
],
|
| 253 |
+
"source": [
|
| 254 |
+
"crop.duplicated().sum()"
|
| 255 |
+
]
|
| 256 |
+
},
|
| 257 |
+
{
|
| 258 |
+
"cell_type": "code",
|
| 259 |
+
"execution_count": 7,
|
| 260 |
+
"id": "3d5b7413",
|
| 261 |
+
"metadata": {},
|
| 262 |
+
"outputs": [
|
| 263 |
+
{
|
| 264 |
+
"data": {
|
| 265 |
+
"text/html": [
|
| 266 |
+
"<div>\n",
|
| 267 |
+
"<style scoped>\n",
|
| 268 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 269 |
+
" vertical-align: middle;\n",
|
| 270 |
+
" }\n",
|
| 271 |
+
"\n",
|
| 272 |
+
" .dataframe tbody tr th {\n",
|
| 273 |
+
" vertical-align: top;\n",
|
| 274 |
+
" }\n",
|
| 275 |
+
"\n",
|
| 276 |
+
" .dataframe thead th {\n",
|
| 277 |
+
" text-align: right;\n",
|
| 278 |
+
" }\n",
|
| 279 |
+
"</style>\n",
|
| 280 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 281 |
+
" <thead>\n",
|
| 282 |
+
" <tr style=\"text-align: right;\">\n",
|
| 283 |
+
" <th></th>\n",
|
| 284 |
+
" <th>N</th>\n",
|
| 285 |
+
" <th>P</th>\n",
|
| 286 |
+
" <th>K</th>\n",
|
| 287 |
+
" <th>temperature</th>\n",
|
| 288 |
+
" <th>humidity</th>\n",
|
| 289 |
+
" <th>ph</th>\n",
|
| 290 |
+
" <th>rainfall</th>\n",
|
| 291 |
+
" </tr>\n",
|
| 292 |
+
" </thead>\n",
|
| 293 |
+
" <tbody>\n",
|
| 294 |
+
" <tr>\n",
|
| 295 |
+
" <th>count</th>\n",
|
| 296 |
+
" <td>2200.000000</td>\n",
|
| 297 |
+
" <td>2200.000000</td>\n",
|
| 298 |
+
" <td>2200.000000</td>\n",
|
| 299 |
+
" <td>2200.000000</td>\n",
|
| 300 |
+
" <td>2200.000000</td>\n",
|
| 301 |
+
" <td>2200.000000</td>\n",
|
| 302 |
+
" <td>2200.000000</td>\n",
|
| 303 |
+
" </tr>\n",
|
| 304 |
+
" <tr>\n",
|
| 305 |
+
" <th>mean</th>\n",
|
| 306 |
+
" <td>50.551818</td>\n",
|
| 307 |
+
" <td>53.362727</td>\n",
|
| 308 |
+
" <td>48.149091</td>\n",
|
| 309 |
+
" <td>25.616244</td>\n",
|
| 310 |
+
" <td>71.481779</td>\n",
|
| 311 |
+
" <td>6.469480</td>\n",
|
| 312 |
+
" <td>103.463655</td>\n",
|
| 313 |
+
" </tr>\n",
|
| 314 |
+
" <tr>\n",
|
| 315 |
+
" <th>std</th>\n",
|
| 316 |
+
" <td>36.917334</td>\n",
|
| 317 |
+
" <td>32.985883</td>\n",
|
| 318 |
+
" <td>50.647931</td>\n",
|
| 319 |
+
" <td>5.063749</td>\n",
|
| 320 |
+
" <td>22.263812</td>\n",
|
| 321 |
+
" <td>0.773938</td>\n",
|
| 322 |
+
" <td>54.958389</td>\n",
|
| 323 |
+
" </tr>\n",
|
| 324 |
+
" <tr>\n",
|
| 325 |
+
" <th>min</th>\n",
|
| 326 |
+
" <td>0.000000</td>\n",
|
| 327 |
+
" <td>5.000000</td>\n",
|
| 328 |
+
" <td>5.000000</td>\n",
|
| 329 |
+
" <td>8.825675</td>\n",
|
| 330 |
+
" <td>14.258040</td>\n",
|
| 331 |
+
" <td>3.504752</td>\n",
|
| 332 |
+
" <td>20.211267</td>\n",
|
| 333 |
+
" </tr>\n",
|
| 334 |
+
" <tr>\n",
|
| 335 |
+
" <th>25%</th>\n",
|
| 336 |
+
" <td>21.000000</td>\n",
|
| 337 |
+
" <td>28.000000</td>\n",
|
| 338 |
+
" <td>20.000000</td>\n",
|
| 339 |
+
" <td>22.769375</td>\n",
|
| 340 |
+
" <td>60.261953</td>\n",
|
| 341 |
+
" <td>5.971693</td>\n",
|
| 342 |
+
" <td>64.551686</td>\n",
|
| 343 |
+
" </tr>\n",
|
| 344 |
+
" <tr>\n",
|
| 345 |
+
" <th>50%</th>\n",
|
| 346 |
+
" <td>37.000000</td>\n",
|
| 347 |
+
" <td>51.000000</td>\n",
|
| 348 |
+
" <td>32.000000</td>\n",
|
| 349 |
+
" <td>25.598693</td>\n",
|
| 350 |
+
" <td>80.473146</td>\n",
|
| 351 |
+
" <td>6.425045</td>\n",
|
| 352 |
+
" <td>94.867624</td>\n",
|
| 353 |
+
" </tr>\n",
|
| 354 |
+
" <tr>\n",
|
| 355 |
+
" <th>75%</th>\n",
|
| 356 |
+
" <td>84.250000</td>\n",
|
| 357 |
+
" <td>68.000000</td>\n",
|
| 358 |
+
" <td>49.000000</td>\n",
|
| 359 |
+
" <td>28.561654</td>\n",
|
| 360 |
+
" <td>89.948771</td>\n",
|
| 361 |
+
" <td>6.923643</td>\n",
|
| 362 |
+
" <td>124.267508</td>\n",
|
| 363 |
+
" </tr>\n",
|
| 364 |
+
" <tr>\n",
|
| 365 |
+
" <th>max</th>\n",
|
| 366 |
+
" <td>140.000000</td>\n",
|
| 367 |
+
" <td>145.000000</td>\n",
|
| 368 |
+
" <td>205.000000</td>\n",
|
| 369 |
+
" <td>43.675493</td>\n",
|
| 370 |
+
" <td>99.981876</td>\n",
|
| 371 |
+
" <td>9.935091</td>\n",
|
| 372 |
+
" <td>298.560117</td>\n",
|
| 373 |
+
" </tr>\n",
|
| 374 |
+
" </tbody>\n",
|
| 375 |
+
"</table>\n",
|
| 376 |
+
"</div>"
|
| 377 |
+
],
|
| 378 |
+
"text/plain": [
|
| 379 |
+
" N P K temperature humidity \\\n",
|
| 380 |
+
"count 2200.000000 2200.000000 2200.000000 2200.000000 2200.000000 \n",
|
| 381 |
+
"mean 50.551818 53.362727 48.149091 25.616244 71.481779 \n",
|
| 382 |
+
"std 36.917334 32.985883 50.647931 5.063749 22.263812 \n",
|
| 383 |
+
"min 0.000000 5.000000 5.000000 8.825675 14.258040 \n",
|
| 384 |
+
"25% 21.000000 28.000000 20.000000 22.769375 60.261953 \n",
|
| 385 |
+
"50% 37.000000 51.000000 32.000000 25.598693 80.473146 \n",
|
| 386 |
+
"75% 84.250000 68.000000 49.000000 28.561654 89.948771 \n",
|
| 387 |
+
"max 140.000000 145.000000 205.000000 43.675493 99.981876 \n",
|
| 388 |
+
"\n",
|
| 389 |
+
" ph rainfall \n",
|
| 390 |
+
"count 2200.000000 2200.000000 \n",
|
| 391 |
+
"mean 6.469480 103.463655 \n",
|
| 392 |
+
"std 0.773938 54.958389 \n",
|
| 393 |
+
"min 3.504752 20.211267 \n",
|
| 394 |
+
"25% 5.971693 64.551686 \n",
|
| 395 |
+
"50% 6.425045 94.867624 \n",
|
| 396 |
+
"75% 6.923643 124.267508 \n",
|
| 397 |
+
"max 9.935091 298.560117 "
|
| 398 |
+
]
|
| 399 |
+
},
|
| 400 |
+
"execution_count": 7,
|
| 401 |
+
"metadata": {},
|
| 402 |
+
"output_type": "execute_result"
|
| 403 |
+
}
|
| 404 |
+
],
|
| 405 |
+
"source": [
|
| 406 |
+
"crop.describe()"
|
| 407 |
+
]
|
| 408 |
+
},
|
| 409 |
+
{
|
| 410 |
+
"cell_type": "code",
|
| 411 |
+
"execution_count": 8,
|
| 412 |
+
"id": "1056bfba",
|
| 413 |
+
"metadata": {},
|
| 414 |
+
"outputs": [
|
| 415 |
+
{
|
| 416 |
+
"data": {
|
| 417 |
+
"text/plain": [
|
| 418 |
+
"label\n",
|
| 419 |
+
"rice 100\n",
|
| 420 |
+
"maize 100\n",
|
| 421 |
+
"jute 100\n",
|
| 422 |
+
"cotton 100\n",
|
| 423 |
+
"coconut 100\n",
|
| 424 |
+
"papaya 100\n",
|
| 425 |
+
"orange 100\n",
|
| 426 |
+
"apple 100\n",
|
| 427 |
+
"muskmelon 100\n",
|
| 428 |
+
"watermelon 100\n",
|
| 429 |
+
"grapes 100\n",
|
| 430 |
+
"mango 100\n",
|
| 431 |
+
"banana 100\n",
|
| 432 |
+
"pomegranate 100\n",
|
| 433 |
+
"lentil 100\n",
|
| 434 |
+
"blackgram 100\n",
|
| 435 |
+
"mungbean 100\n",
|
| 436 |
+
"mothbeans 100\n",
|
| 437 |
+
"pigeonpeas 100\n",
|
| 438 |
+
"kidneybeans 100\n",
|
| 439 |
+
"chickpea 100\n",
|
| 440 |
+
"coffee 100\n",
|
| 441 |
+
"Name: count, dtype: int64"
|
| 442 |
+
]
|
| 443 |
+
},
|
| 444 |
+
"execution_count": 8,
|
| 445 |
+
"metadata": {},
|
| 446 |
+
"output_type": "execute_result"
|
| 447 |
+
}
|
| 448 |
+
],
|
| 449 |
+
"source": [
|
| 450 |
+
"crop['label'].value_counts()"
|
| 451 |
+
]
|
| 452 |
+
},
|
| 453 |
+
{
|
| 454 |
+
"cell_type": "markdown",
|
| 455 |
+
"id": "3e3af150",
|
| 456 |
+
"metadata": {},
|
| 457 |
+
"source": [
|
| 458 |
+
"# Encoding"
|
| 459 |
+
]
|
| 460 |
+
},
|
| 461 |
+
{
|
| 462 |
+
"cell_type": "code",
|
| 463 |
+
"execution_count": 9,
|
| 464 |
+
"id": "8c35d395",
|
| 465 |
+
"metadata": {},
|
| 466 |
+
"outputs": [],
|
| 467 |
+
"source": [
|
| 468 |
+
"crop_dict = {\n",
|
| 469 |
+
" 'rice': 1,\n",
|
| 470 |
+
" 'maize': 2,\n",
|
| 471 |
+
" 'jute': 3,\n",
|
| 472 |
+
" 'cotton': 4,\n",
|
| 473 |
+
" 'coconut': 5,\n",
|
| 474 |
+
" 'papaya': 6,\n",
|
| 475 |
+
" 'orange': 7,\n",
|
| 476 |
+
" 'apple': 8,\n",
|
| 477 |
+
" 'muskmelon': 9,\n",
|
| 478 |
+
" 'watermelon': 10,\n",
|
| 479 |
+
" 'grapes': 11,\n",
|
| 480 |
+
" 'mango': 12,\n",
|
| 481 |
+
" 'banana': 13,\n",
|
| 482 |
+
" 'pomegranate': 14,\n",
|
| 483 |
+
" 'lentil': 15,\n",
|
| 484 |
+
" 'blackgram': 16,\n",
|
| 485 |
+
" 'mungbean': 17,\n",
|
| 486 |
+
" 'mothbeans': 18,\n",
|
| 487 |
+
" 'pigeonpeas': 19,\n",
|
| 488 |
+
" 'kidneybeans': 20,\n",
|
| 489 |
+
" 'chickpea': 21,\n",
|
| 490 |
+
" 'coffee': 22\n",
|
| 491 |
+
"}\n",
|
| 492 |
+
"crop['crop_num']= crop['label'].map(crop_dict)"
|
| 493 |
+
]
|
| 494 |
+
},
|
| 495 |
+
{
|
| 496 |
+
"cell_type": "code",
|
| 497 |
+
"execution_count": 10,
|
| 498 |
+
"id": "b1a53f7f",
|
| 499 |
+
"metadata": {},
|
| 500 |
+
"outputs": [
|
| 501 |
+
{
|
| 502 |
+
"data": {
|
| 503 |
+
"text/html": [
|
| 504 |
+
"<div>\n",
|
| 505 |
+
"<style scoped>\n",
|
| 506 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 507 |
+
" vertical-align: middle;\n",
|
| 508 |
+
" }\n",
|
| 509 |
+
"\n",
|
| 510 |
+
" .dataframe tbody tr th {\n",
|
| 511 |
+
" vertical-align: top;\n",
|
| 512 |
+
" }\n",
|
| 513 |
+
"\n",
|
| 514 |
+
" .dataframe thead th {\n",
|
| 515 |
+
" text-align: right;\n",
|
| 516 |
+
" }\n",
|
| 517 |
+
"</style>\n",
|
| 518 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 519 |
+
" <thead>\n",
|
| 520 |
+
" <tr style=\"text-align: right;\">\n",
|
| 521 |
+
" <th></th>\n",
|
| 522 |
+
" <th>N</th>\n",
|
| 523 |
+
" <th>P</th>\n",
|
| 524 |
+
" <th>K</th>\n",
|
| 525 |
+
" <th>temperature</th>\n",
|
| 526 |
+
" <th>humidity</th>\n",
|
| 527 |
+
" <th>ph</th>\n",
|
| 528 |
+
" <th>rainfall</th>\n",
|
| 529 |
+
" <th>label</th>\n",
|
| 530 |
+
" <th>crop_num</th>\n",
|
| 531 |
+
" </tr>\n",
|
| 532 |
+
" </thead>\n",
|
| 533 |
+
" <tbody>\n",
|
| 534 |
+
" <tr>\n",
|
| 535 |
+
" <th>0</th>\n",
|
| 536 |
+
" <td>90</td>\n",
|
| 537 |
+
" <td>42</td>\n",
|
| 538 |
+
" <td>43</td>\n",
|
| 539 |
+
" <td>20.879744</td>\n",
|
| 540 |
+
" <td>82.002744</td>\n",
|
| 541 |
+
" <td>6.502985</td>\n",
|
| 542 |
+
" <td>202.935536</td>\n",
|
| 543 |
+
" <td>rice</td>\n",
|
| 544 |
+
" <td>1</td>\n",
|
| 545 |
+
" </tr>\n",
|
| 546 |
+
" <tr>\n",
|
| 547 |
+
" <th>1</th>\n",
|
| 548 |
+
" <td>85</td>\n",
|
| 549 |
+
" <td>58</td>\n",
|
| 550 |
+
" <td>41</td>\n",
|
| 551 |
+
" <td>21.770462</td>\n",
|
| 552 |
+
" <td>80.319644</td>\n",
|
| 553 |
+
" <td>7.038096</td>\n",
|
| 554 |
+
" <td>226.655537</td>\n",
|
| 555 |
+
" <td>rice</td>\n",
|
| 556 |
+
" <td>1</td>\n",
|
| 557 |
+
" </tr>\n",
|
| 558 |
+
" <tr>\n",
|
| 559 |
+
" <th>2</th>\n",
|
| 560 |
+
" <td>60</td>\n",
|
| 561 |
+
" <td>55</td>\n",
|
| 562 |
+
" <td>44</td>\n",
|
| 563 |
+
" <td>23.004459</td>\n",
|
| 564 |
+
" <td>82.320763</td>\n",
|
| 565 |
+
" <td>7.840207</td>\n",
|
| 566 |
+
" <td>263.964248</td>\n",
|
| 567 |
+
" <td>rice</td>\n",
|
| 568 |
+
" <td>1</td>\n",
|
| 569 |
+
" </tr>\n",
|
| 570 |
+
" <tr>\n",
|
| 571 |
+
" <th>3</th>\n",
|
| 572 |
+
" <td>74</td>\n",
|
| 573 |
+
" <td>35</td>\n",
|
| 574 |
+
" <td>40</td>\n",
|
| 575 |
+
" <td>26.491096</td>\n",
|
| 576 |
+
" <td>80.158363</td>\n",
|
| 577 |
+
" <td>6.980401</td>\n",
|
| 578 |
+
" <td>242.864034</td>\n",
|
| 579 |
+
" <td>rice</td>\n",
|
| 580 |
+
" <td>1</td>\n",
|
| 581 |
+
" </tr>\n",
|
| 582 |
+
" <tr>\n",
|
| 583 |
+
" <th>4</th>\n",
|
| 584 |
+
" <td>78</td>\n",
|
| 585 |
+
" <td>42</td>\n",
|
| 586 |
+
" <td>42</td>\n",
|
| 587 |
+
" <td>20.130175</td>\n",
|
| 588 |
+
" <td>81.604873</td>\n",
|
| 589 |
+
" <td>7.628473</td>\n",
|
| 590 |
+
" <td>262.717340</td>\n",
|
| 591 |
+
" <td>rice</td>\n",
|
| 592 |
+
" <td>1</td>\n",
|
| 593 |
+
" </tr>\n",
|
| 594 |
+
" <tr>\n",
|
| 595 |
+
" <th>...</th>\n",
|
| 596 |
+
" <td>...</td>\n",
|
| 597 |
+
" <td>...</td>\n",
|
| 598 |
+
" <td>...</td>\n",
|
| 599 |
+
" <td>...</td>\n",
|
| 600 |
+
" <td>...</td>\n",
|
| 601 |
+
" <td>...</td>\n",
|
| 602 |
+
" <td>...</td>\n",
|
| 603 |
+
" <td>...</td>\n",
|
| 604 |
+
" <td>...</td>\n",
|
| 605 |
+
" </tr>\n",
|
| 606 |
+
" <tr>\n",
|
| 607 |
+
" <th>2195</th>\n",
|
| 608 |
+
" <td>107</td>\n",
|
| 609 |
+
" <td>34</td>\n",
|
| 610 |
+
" <td>32</td>\n",
|
| 611 |
+
" <td>26.774637</td>\n",
|
| 612 |
+
" <td>66.413269</td>\n",
|
| 613 |
+
" <td>6.780064</td>\n",
|
| 614 |
+
" <td>177.774507</td>\n",
|
| 615 |
+
" <td>coffee</td>\n",
|
| 616 |
+
" <td>22</td>\n",
|
| 617 |
+
" </tr>\n",
|
| 618 |
+
" <tr>\n",
|
| 619 |
+
" <th>2196</th>\n",
|
| 620 |
+
" <td>99</td>\n",
|
| 621 |
+
" <td>15</td>\n",
|
| 622 |
+
" <td>27</td>\n",
|
| 623 |
+
" <td>27.417112</td>\n",
|
| 624 |
+
" <td>56.636362</td>\n",
|
| 625 |
+
" <td>6.086922</td>\n",
|
| 626 |
+
" <td>127.924610</td>\n",
|
| 627 |
+
" <td>coffee</td>\n",
|
| 628 |
+
" <td>22</td>\n",
|
| 629 |
+
" </tr>\n",
|
| 630 |
+
" <tr>\n",
|
| 631 |
+
" <th>2197</th>\n",
|
| 632 |
+
" <td>118</td>\n",
|
| 633 |
+
" <td>33</td>\n",
|
| 634 |
+
" <td>30</td>\n",
|
| 635 |
+
" <td>24.131797</td>\n",
|
| 636 |
+
" <td>67.225123</td>\n",
|
| 637 |
+
" <td>6.362608</td>\n",
|
| 638 |
+
" <td>173.322839</td>\n",
|
| 639 |
+
" <td>coffee</td>\n",
|
| 640 |
+
" <td>22</td>\n",
|
| 641 |
+
" </tr>\n",
|
| 642 |
+
" <tr>\n",
|
| 643 |
+
" <th>2198</th>\n",
|
| 644 |
+
" <td>117</td>\n",
|
| 645 |
+
" <td>32</td>\n",
|
| 646 |
+
" <td>34</td>\n",
|
| 647 |
+
" <td>26.272418</td>\n",
|
| 648 |
+
" <td>52.127394</td>\n",
|
| 649 |
+
" <td>6.758793</td>\n",
|
| 650 |
+
" <td>127.175293</td>\n",
|
| 651 |
+
" <td>coffee</td>\n",
|
| 652 |
+
" <td>22</td>\n",
|
| 653 |
+
" </tr>\n",
|
| 654 |
+
" <tr>\n",
|
| 655 |
+
" <th>2199</th>\n",
|
| 656 |
+
" <td>104</td>\n",
|
| 657 |
+
" <td>18</td>\n",
|
| 658 |
+
" <td>30</td>\n",
|
| 659 |
+
" <td>23.603016</td>\n",
|
| 660 |
+
" <td>60.396475</td>\n",
|
| 661 |
+
" <td>6.779833</td>\n",
|
| 662 |
+
" <td>140.937041</td>\n",
|
| 663 |
+
" <td>coffee</td>\n",
|
| 664 |
+
" <td>22</td>\n",
|
| 665 |
+
" </tr>\n",
|
| 666 |
+
" </tbody>\n",
|
| 667 |
+
"</table>\n",
|
| 668 |
+
"<p>2200 rows × 9 columns</p>\n",
|
| 669 |
+
"</div>"
|
| 670 |
+
],
|
| 671 |
+
"text/plain": [
|
| 672 |
+
" N P K temperature humidity ph rainfall label \\\n",
|
| 673 |
+
"0 90 42 43 20.879744 82.002744 6.502985 202.935536 rice \n",
|
| 674 |
+
"1 85 58 41 21.770462 80.319644 7.038096 226.655537 rice \n",
|
| 675 |
+
"2 60 55 44 23.004459 82.320763 7.840207 263.964248 rice \n",
|
| 676 |
+
"3 74 35 40 26.491096 80.158363 6.980401 242.864034 rice \n",
|
| 677 |
+
"4 78 42 42 20.130175 81.604873 7.628473 262.717340 rice \n",
|
| 678 |
+
"... ... .. .. ... ... ... ... ... \n",
|
| 679 |
+
"2195 107 34 32 26.774637 66.413269 6.780064 177.774507 coffee \n",
|
| 680 |
+
"2196 99 15 27 27.417112 56.636362 6.086922 127.924610 coffee \n",
|
| 681 |
+
"2197 118 33 30 24.131797 67.225123 6.362608 173.322839 coffee \n",
|
| 682 |
+
"2198 117 32 34 26.272418 52.127394 6.758793 127.175293 coffee \n",
|
| 683 |
+
"2199 104 18 30 23.603016 60.396475 6.779833 140.937041 coffee \n",
|
| 684 |
+
"\n",
|
| 685 |
+
" crop_num \n",
|
| 686 |
+
"0 1 \n",
|
| 687 |
+
"1 1 \n",
|
| 688 |
+
"2 1 \n",
|
| 689 |
+
"3 1 \n",
|
| 690 |
+
"4 1 \n",
|
| 691 |
+
"... ... \n",
|
| 692 |
+
"2195 22 \n",
|
| 693 |
+
"2196 22 \n",
|
| 694 |
+
"2197 22 \n",
|
| 695 |
+
"2198 22 \n",
|
| 696 |
+
"2199 22 \n",
|
| 697 |
+
"\n",
|
| 698 |
+
"[2200 rows x 9 columns]"
|
| 699 |
+
]
|
| 700 |
+
},
|
| 701 |
+
"execution_count": 10,
|
| 702 |
+
"metadata": {},
|
| 703 |
+
"output_type": "execute_result"
|
| 704 |
+
}
|
| 705 |
+
],
|
| 706 |
+
"source": [
|
| 707 |
+
"crop"
|
| 708 |
+
]
|
| 709 |
+
},
|
| 710 |
+
{
|
| 711 |
+
"cell_type": "code",
|
| 712 |
+
"execution_count": 11,
|
| 713 |
+
"id": "dff5caca",
|
| 714 |
+
"metadata": {},
|
| 715 |
+
"outputs": [
|
| 716 |
+
{
|
| 717 |
+
"data": {
|
| 718 |
+
"text/html": [
|
| 719 |
+
"<div>\n",
|
| 720 |
+
"<style scoped>\n",
|
| 721 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 722 |
+
" vertical-align: middle;\n",
|
| 723 |
+
" }\n",
|
| 724 |
+
"\n",
|
| 725 |
+
" .dataframe tbody tr th {\n",
|
| 726 |
+
" vertical-align: top;\n",
|
| 727 |
+
" }\n",
|
| 728 |
+
"\n",
|
| 729 |
+
" .dataframe thead th {\n",
|
| 730 |
+
" text-align: right;\n",
|
| 731 |
+
" }\n",
|
| 732 |
+
"</style>\n",
|
| 733 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 734 |
+
" <thead>\n",
|
| 735 |
+
" <tr style=\"text-align: right;\">\n",
|
| 736 |
+
" <th></th>\n",
|
| 737 |
+
" <th>N</th>\n",
|
| 738 |
+
" <th>P</th>\n",
|
| 739 |
+
" <th>K</th>\n",
|
| 740 |
+
" <th>temperature</th>\n",
|
| 741 |
+
" <th>humidity</th>\n",
|
| 742 |
+
" <th>ph</th>\n",
|
| 743 |
+
" <th>rainfall</th>\n",
|
| 744 |
+
" <th>crop_num</th>\n",
|
| 745 |
+
" </tr>\n",
|
| 746 |
+
" </thead>\n",
|
| 747 |
+
" <tbody>\n",
|
| 748 |
+
" <tr>\n",
|
| 749 |
+
" <th>0</th>\n",
|
| 750 |
+
" <td>90</td>\n",
|
| 751 |
+
" <td>42</td>\n",
|
| 752 |
+
" <td>43</td>\n",
|
| 753 |
+
" <td>20.879744</td>\n",
|
| 754 |
+
" <td>82.002744</td>\n",
|
| 755 |
+
" <td>6.502985</td>\n",
|
| 756 |
+
" <td>202.935536</td>\n",
|
| 757 |
+
" <td>1</td>\n",
|
| 758 |
+
" </tr>\n",
|
| 759 |
+
" <tr>\n",
|
| 760 |
+
" <th>1</th>\n",
|
| 761 |
+
" <td>85</td>\n",
|
| 762 |
+
" <td>58</td>\n",
|
| 763 |
+
" <td>41</td>\n",
|
| 764 |
+
" <td>21.770462</td>\n",
|
| 765 |
+
" <td>80.319644</td>\n",
|
| 766 |
+
" <td>7.038096</td>\n",
|
| 767 |
+
" <td>226.655537</td>\n",
|
| 768 |
+
" <td>1</td>\n",
|
| 769 |
+
" </tr>\n",
|
| 770 |
+
" <tr>\n",
|
| 771 |
+
" <th>2</th>\n",
|
| 772 |
+
" <td>60</td>\n",
|
| 773 |
+
" <td>55</td>\n",
|
| 774 |
+
" <td>44</td>\n",
|
| 775 |
+
" <td>23.004459</td>\n",
|
| 776 |
+
" <td>82.320763</td>\n",
|
| 777 |
+
" <td>7.840207</td>\n",
|
| 778 |
+
" <td>263.964248</td>\n",
|
| 779 |
+
" <td>1</td>\n",
|
| 780 |
+
" </tr>\n",
|
| 781 |
+
" <tr>\n",
|
| 782 |
+
" <th>3</th>\n",
|
| 783 |
+
" <td>74</td>\n",
|
| 784 |
+
" <td>35</td>\n",
|
| 785 |
+
" <td>40</td>\n",
|
| 786 |
+
" <td>26.491096</td>\n",
|
| 787 |
+
" <td>80.158363</td>\n",
|
| 788 |
+
" <td>6.980401</td>\n",
|
| 789 |
+
" <td>242.864034</td>\n",
|
| 790 |
+
" <td>1</td>\n",
|
| 791 |
+
" </tr>\n",
|
| 792 |
+
" <tr>\n",
|
| 793 |
+
" <th>4</th>\n",
|
| 794 |
+
" <td>78</td>\n",
|
| 795 |
+
" <td>42</td>\n",
|
| 796 |
+
" <td>42</td>\n",
|
| 797 |
+
" <td>20.130175</td>\n",
|
| 798 |
+
" <td>81.604873</td>\n",
|
| 799 |
+
" <td>7.628473</td>\n",
|
| 800 |
+
" <td>262.717340</td>\n",
|
| 801 |
+
" <td>1</td>\n",
|
| 802 |
+
" </tr>\n",
|
| 803 |
+
" </tbody>\n",
|
| 804 |
+
"</table>\n",
|
| 805 |
+
"</div>"
|
| 806 |
+
],
|
| 807 |
+
"text/plain": [
|
| 808 |
+
" N P K temperature humidity ph rainfall crop_num\n",
|
| 809 |
+
"0 90 42 43 20.879744 82.002744 6.502985 202.935536 1\n",
|
| 810 |
+
"1 85 58 41 21.770462 80.319644 7.038096 226.655537 1\n",
|
| 811 |
+
"2 60 55 44 23.004459 82.320763 7.840207 263.964248 1\n",
|
| 812 |
+
"3 74 35 40 26.491096 80.158363 6.980401 242.864034 1\n",
|
| 813 |
+
"4 78 42 42 20.130175 81.604873 7.628473 262.717340 1"
|
| 814 |
+
]
|
| 815 |
+
},
|
| 816 |
+
"execution_count": 11,
|
| 817 |
+
"metadata": {},
|
| 818 |
+
"output_type": "execute_result"
|
| 819 |
+
}
|
| 820 |
+
],
|
| 821 |
+
"source": [
|
| 822 |
+
"crop.drop(['label'],axis=1,inplace=True)\n",
|
| 823 |
+
"crop.head()"
|
| 824 |
+
]
|
| 825 |
+
},
|
| 826 |
+
{
|
| 827 |
+
"cell_type": "markdown",
|
| 828 |
+
"id": "a5494675",
|
| 829 |
+
"metadata": {},
|
| 830 |
+
"source": [
|
| 831 |
+
"# Train Test Split"
|
| 832 |
+
]
|
| 833 |
+
},
|
| 834 |
+
{
|
| 835 |
+
"cell_type": "code",
|
| 836 |
+
"execution_count": 12,
|
| 837 |
+
"id": "5a049f55",
|
| 838 |
+
"metadata": {},
|
| 839 |
+
"outputs": [],
|
| 840 |
+
"source": [
|
| 841 |
+
"X = crop.drop(['crop_num'],axis=1)\n",
|
| 842 |
+
"y = crop['crop_num']"
|
| 843 |
+
]
|
| 844 |
+
},
|
| 845 |
+
{
|
| 846 |
+
"cell_type": "code",
|
| 847 |
+
"execution_count": 13,
|
| 848 |
+
"id": "9d223a69",
|
| 849 |
+
"metadata": {},
|
| 850 |
+
"outputs": [
|
| 851 |
+
{
|
| 852 |
+
"data": {
|
| 853 |
+
"text/html": [
|
| 854 |
+
"<div>\n",
|
| 855 |
+
"<style scoped>\n",
|
| 856 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 857 |
+
" vertical-align: middle;\n",
|
| 858 |
+
" }\n",
|
| 859 |
+
"\n",
|
| 860 |
+
" .dataframe tbody tr th {\n",
|
| 861 |
+
" vertical-align: top;\n",
|
| 862 |
+
" }\n",
|
| 863 |
+
"\n",
|
| 864 |
+
" .dataframe thead th {\n",
|
| 865 |
+
" text-align: right;\n",
|
| 866 |
+
" }\n",
|
| 867 |
+
"</style>\n",
|
| 868 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 869 |
+
" <thead>\n",
|
| 870 |
+
" <tr style=\"text-align: right;\">\n",
|
| 871 |
+
" <th></th>\n",
|
| 872 |
+
" <th>N</th>\n",
|
| 873 |
+
" <th>P</th>\n",
|
| 874 |
+
" <th>K</th>\n",
|
| 875 |
+
" <th>temperature</th>\n",
|
| 876 |
+
" <th>humidity</th>\n",
|
| 877 |
+
" <th>ph</th>\n",
|
| 878 |
+
" <th>rainfall</th>\n",
|
| 879 |
+
" </tr>\n",
|
| 880 |
+
" </thead>\n",
|
| 881 |
+
" <tbody>\n",
|
| 882 |
+
" <tr>\n",
|
| 883 |
+
" <th>0</th>\n",
|
| 884 |
+
" <td>90</td>\n",
|
| 885 |
+
" <td>42</td>\n",
|
| 886 |
+
" <td>43</td>\n",
|
| 887 |
+
" <td>20.879744</td>\n",
|
| 888 |
+
" <td>82.002744</td>\n",
|
| 889 |
+
" <td>6.502985</td>\n",
|
| 890 |
+
" <td>202.935536</td>\n",
|
| 891 |
+
" </tr>\n",
|
| 892 |
+
" <tr>\n",
|
| 893 |
+
" <th>1</th>\n",
|
| 894 |
+
" <td>85</td>\n",
|
| 895 |
+
" <td>58</td>\n",
|
| 896 |
+
" <td>41</td>\n",
|
| 897 |
+
" <td>21.770462</td>\n",
|
| 898 |
+
" <td>80.319644</td>\n",
|
| 899 |
+
" <td>7.038096</td>\n",
|
| 900 |
+
" <td>226.655537</td>\n",
|
| 901 |
+
" </tr>\n",
|
| 902 |
+
" <tr>\n",
|
| 903 |
+
" <th>2</th>\n",
|
| 904 |
+
" <td>60</td>\n",
|
| 905 |
+
" <td>55</td>\n",
|
| 906 |
+
" <td>44</td>\n",
|
| 907 |
+
" <td>23.004459</td>\n",
|
| 908 |
+
" <td>82.320763</td>\n",
|
| 909 |
+
" <td>7.840207</td>\n",
|
| 910 |
+
" <td>263.964248</td>\n",
|
| 911 |
+
" </tr>\n",
|
| 912 |
+
" <tr>\n",
|
| 913 |
+
" <th>3</th>\n",
|
| 914 |
+
" <td>74</td>\n",
|
| 915 |
+
" <td>35</td>\n",
|
| 916 |
+
" <td>40</td>\n",
|
| 917 |
+
" <td>26.491096</td>\n",
|
| 918 |
+
" <td>80.158363</td>\n",
|
| 919 |
+
" <td>6.980401</td>\n",
|
| 920 |
+
" <td>242.864034</td>\n",
|
| 921 |
+
" </tr>\n",
|
| 922 |
+
" <tr>\n",
|
| 923 |
+
" <th>4</th>\n",
|
| 924 |
+
" <td>78</td>\n",
|
| 925 |
+
" <td>42</td>\n",
|
| 926 |
+
" <td>42</td>\n",
|
| 927 |
+
" <td>20.130175</td>\n",
|
| 928 |
+
" <td>81.604873</td>\n",
|
| 929 |
+
" <td>7.628473</td>\n",
|
| 930 |
+
" <td>262.717340</td>\n",
|
| 931 |
+
" </tr>\n",
|
| 932 |
+
" <tr>\n",
|
| 933 |
+
" <th>...</th>\n",
|
| 934 |
+
" <td>...</td>\n",
|
| 935 |
+
" <td>...</td>\n",
|
| 936 |
+
" <td>...</td>\n",
|
| 937 |
+
" <td>...</td>\n",
|
| 938 |
+
" <td>...</td>\n",
|
| 939 |
+
" <td>...</td>\n",
|
| 940 |
+
" <td>...</td>\n",
|
| 941 |
+
" </tr>\n",
|
| 942 |
+
" <tr>\n",
|
| 943 |
+
" <th>2195</th>\n",
|
| 944 |
+
" <td>107</td>\n",
|
| 945 |
+
" <td>34</td>\n",
|
| 946 |
+
" <td>32</td>\n",
|
| 947 |
+
" <td>26.774637</td>\n",
|
| 948 |
+
" <td>66.413269</td>\n",
|
| 949 |
+
" <td>6.780064</td>\n",
|
| 950 |
+
" <td>177.774507</td>\n",
|
| 951 |
+
" </tr>\n",
|
| 952 |
+
" <tr>\n",
|
| 953 |
+
" <th>2196</th>\n",
|
| 954 |
+
" <td>99</td>\n",
|
| 955 |
+
" <td>15</td>\n",
|
| 956 |
+
" <td>27</td>\n",
|
| 957 |
+
" <td>27.417112</td>\n",
|
| 958 |
+
" <td>56.636362</td>\n",
|
| 959 |
+
" <td>6.086922</td>\n",
|
| 960 |
+
" <td>127.924610</td>\n",
|
| 961 |
+
" </tr>\n",
|
| 962 |
+
" <tr>\n",
|
| 963 |
+
" <th>2197</th>\n",
|
| 964 |
+
" <td>118</td>\n",
|
| 965 |
+
" <td>33</td>\n",
|
| 966 |
+
" <td>30</td>\n",
|
| 967 |
+
" <td>24.131797</td>\n",
|
| 968 |
+
" <td>67.225123</td>\n",
|
| 969 |
+
" <td>6.362608</td>\n",
|
| 970 |
+
" <td>173.322839</td>\n",
|
| 971 |
+
" </tr>\n",
|
| 972 |
+
" <tr>\n",
|
| 973 |
+
" <th>2198</th>\n",
|
| 974 |
+
" <td>117</td>\n",
|
| 975 |
+
" <td>32</td>\n",
|
| 976 |
+
" <td>34</td>\n",
|
| 977 |
+
" <td>26.272418</td>\n",
|
| 978 |
+
" <td>52.127394</td>\n",
|
| 979 |
+
" <td>6.758793</td>\n",
|
| 980 |
+
" <td>127.175293</td>\n",
|
| 981 |
+
" </tr>\n",
|
| 982 |
+
" <tr>\n",
|
| 983 |
+
" <th>2199</th>\n",
|
| 984 |
+
" <td>104</td>\n",
|
| 985 |
+
" <td>18</td>\n",
|
| 986 |
+
" <td>30</td>\n",
|
| 987 |
+
" <td>23.603016</td>\n",
|
| 988 |
+
" <td>60.396475</td>\n",
|
| 989 |
+
" <td>6.779833</td>\n",
|
| 990 |
+
" <td>140.937041</td>\n",
|
| 991 |
+
" </tr>\n",
|
| 992 |
+
" </tbody>\n",
|
| 993 |
+
"</table>\n",
|
| 994 |
+
"<p>2200 rows × 7 columns</p>\n",
|
| 995 |
+
"</div>"
|
| 996 |
+
],
|
| 997 |
+
"text/plain": [
|
| 998 |
+
" N P K temperature humidity ph rainfall\n",
|
| 999 |
+
"0 90 42 43 20.879744 82.002744 6.502985 202.935536\n",
|
| 1000 |
+
"1 85 58 41 21.770462 80.319644 7.038096 226.655537\n",
|
| 1001 |
+
"2 60 55 44 23.004459 82.320763 7.840207 263.964248\n",
|
| 1002 |
+
"3 74 35 40 26.491096 80.158363 6.980401 242.864034\n",
|
| 1003 |
+
"4 78 42 42 20.130175 81.604873 7.628473 262.717340\n",
|
| 1004 |
+
"... ... .. .. ... ... ... ...\n",
|
| 1005 |
+
"2195 107 34 32 26.774637 66.413269 6.780064 177.774507\n",
|
| 1006 |
+
"2196 99 15 27 27.417112 56.636362 6.086922 127.924610\n",
|
| 1007 |
+
"2197 118 33 30 24.131797 67.225123 6.362608 173.322839\n",
|
| 1008 |
+
"2198 117 32 34 26.272418 52.127394 6.758793 127.175293\n",
|
| 1009 |
+
"2199 104 18 30 23.603016 60.396475 6.779833 140.937041\n",
|
| 1010 |
+
"\n",
|
| 1011 |
+
"[2200 rows x 7 columns]"
|
| 1012 |
+
]
|
| 1013 |
+
},
|
| 1014 |
+
"execution_count": 13,
|
| 1015 |
+
"metadata": {},
|
| 1016 |
+
"output_type": "execute_result"
|
| 1017 |
+
}
|
| 1018 |
+
],
|
| 1019 |
+
"source": [
|
| 1020 |
+
"X"
|
| 1021 |
+
]
|
| 1022 |
+
},
|
| 1023 |
+
{
|
| 1024 |
+
"cell_type": "code",
|
| 1025 |
+
"execution_count": 14,
|
| 1026 |
+
"id": "d2601fcf",
|
| 1027 |
+
"metadata": {},
|
| 1028 |
+
"outputs": [
|
| 1029 |
+
{
|
| 1030 |
+
"data": {
|
| 1031 |
+
"text/plain": [
|
| 1032 |
+
"0 1\n",
|
| 1033 |
+
"1 1\n",
|
| 1034 |
+
"2 1\n",
|
| 1035 |
+
"3 1\n",
|
| 1036 |
+
"4 1\n",
|
| 1037 |
+
" ..\n",
|
| 1038 |
+
"2195 22\n",
|
| 1039 |
+
"2196 22\n",
|
| 1040 |
+
"2197 22\n",
|
| 1041 |
+
"2198 22\n",
|
| 1042 |
+
"2199 22\n",
|
| 1043 |
+
"Name: crop_num, Length: 2200, dtype: int64"
|
| 1044 |
+
]
|
| 1045 |
+
},
|
| 1046 |
+
"execution_count": 14,
|
| 1047 |
+
"metadata": {},
|
| 1048 |
+
"output_type": "execute_result"
|
| 1049 |
+
}
|
| 1050 |
+
],
|
| 1051 |
+
"source": [
|
| 1052 |
+
"y"
|
| 1053 |
+
]
|
| 1054 |
+
},
|
| 1055 |
+
{
|
| 1056 |
+
"cell_type": "code",
|
| 1057 |
+
"execution_count": 15,
|
| 1058 |
+
"id": "c561ea31",
|
| 1059 |
+
"metadata": {},
|
| 1060 |
+
"outputs": [
|
| 1061 |
+
{
|
| 1062 |
+
"data": {
|
| 1063 |
+
"text/plain": [
|
| 1064 |
+
"(2200,)"
|
| 1065 |
+
]
|
| 1066 |
+
},
|
| 1067 |
+
"execution_count": 15,
|
| 1068 |
+
"metadata": {},
|
| 1069 |
+
"output_type": "execute_result"
|
| 1070 |
+
}
|
| 1071 |
+
],
|
| 1072 |
+
"source": [
|
| 1073 |
+
"y.shape"
|
| 1074 |
+
]
|
| 1075 |
+
},
|
| 1076 |
+
{
|
| 1077 |
+
"cell_type": "code",
|
| 1078 |
+
"execution_count": 16,
|
| 1079 |
+
"id": "caba8efb",
|
| 1080 |
+
"metadata": {},
|
| 1081 |
+
"outputs": [],
|
| 1082 |
+
"source": [
|
| 1083 |
+
"from sklearn.model_selection import train_test_split"
|
| 1084 |
+
]
|
| 1085 |
+
},
|
| 1086 |
+
{
|
| 1087 |
+
"cell_type": "code",
|
| 1088 |
+
"execution_count": 17,
|
| 1089 |
+
"id": "6774a9dd",
|
| 1090 |
+
"metadata": {},
|
| 1091 |
+
"outputs": [],
|
| 1092 |
+
"source": [
|
| 1093 |
+
"X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)"
|
| 1094 |
+
]
|
| 1095 |
+
},
|
| 1096 |
+
{
|
| 1097 |
+
"cell_type": "code",
|
| 1098 |
+
"execution_count": 18,
|
| 1099 |
+
"id": "41b6bcbb",
|
| 1100 |
+
"metadata": {},
|
| 1101 |
+
"outputs": [
|
| 1102 |
+
{
|
| 1103 |
+
"data": {
|
| 1104 |
+
"text/html": [
|
| 1105 |
+
"<div>\n",
|
| 1106 |
+
"<style scoped>\n",
|
| 1107 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 1108 |
+
" vertical-align: middle;\n",
|
| 1109 |
+
" }\n",
|
| 1110 |
+
"\n",
|
| 1111 |
+
" .dataframe tbody tr th {\n",
|
| 1112 |
+
" vertical-align: top;\n",
|
| 1113 |
+
" }\n",
|
| 1114 |
+
"\n",
|
| 1115 |
+
" .dataframe thead th {\n",
|
| 1116 |
+
" text-align: right;\n",
|
| 1117 |
+
" }\n",
|
| 1118 |
+
"</style>\n",
|
| 1119 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 1120 |
+
" <thead>\n",
|
| 1121 |
+
" <tr style=\"text-align: right;\">\n",
|
| 1122 |
+
" <th></th>\n",
|
| 1123 |
+
" <th>N</th>\n",
|
| 1124 |
+
" <th>P</th>\n",
|
| 1125 |
+
" <th>K</th>\n",
|
| 1126 |
+
" <th>temperature</th>\n",
|
| 1127 |
+
" <th>humidity</th>\n",
|
| 1128 |
+
" <th>ph</th>\n",
|
| 1129 |
+
" <th>rainfall</th>\n",
|
| 1130 |
+
" </tr>\n",
|
| 1131 |
+
" </thead>\n",
|
| 1132 |
+
" <tbody>\n",
|
| 1133 |
+
" <tr>\n",
|
| 1134 |
+
" <th>1656</th>\n",
|
| 1135 |
+
" <td>17</td>\n",
|
| 1136 |
+
" <td>16</td>\n",
|
| 1137 |
+
" <td>14</td>\n",
|
| 1138 |
+
" <td>16.396243</td>\n",
|
| 1139 |
+
" <td>92.181519</td>\n",
|
| 1140 |
+
" <td>6.625539</td>\n",
|
| 1141 |
+
" <td>102.944161</td>\n",
|
| 1142 |
+
" </tr>\n",
|
| 1143 |
+
" <tr>\n",
|
| 1144 |
+
" <th>752</th>\n",
|
| 1145 |
+
" <td>37</td>\n",
|
| 1146 |
+
" <td>79</td>\n",
|
| 1147 |
+
" <td>19</td>\n",
|
| 1148 |
+
" <td>27.543848</td>\n",
|
| 1149 |
+
" <td>69.347863</td>\n",
|
| 1150 |
+
" <td>7.143943</td>\n",
|
| 1151 |
+
" <td>69.408782</td>\n",
|
| 1152 |
+
" </tr>\n",
|
| 1153 |
+
" <tr>\n",
|
| 1154 |
+
" <th>892</th>\n",
|
| 1155 |
+
" <td>7</td>\n",
|
| 1156 |
+
" <td>73</td>\n",
|
| 1157 |
+
" <td>25</td>\n",
|
| 1158 |
+
" <td>27.521856</td>\n",
|
| 1159 |
+
" <td>63.132153</td>\n",
|
| 1160 |
+
" <td>7.288057</td>\n",
|
| 1161 |
+
" <td>45.208411</td>\n",
|
| 1162 |
+
" </tr>\n",
|
| 1163 |
+
" <tr>\n",
|
| 1164 |
+
" <th>1041</th>\n",
|
| 1165 |
+
" <td>101</td>\n",
|
| 1166 |
+
" <td>70</td>\n",
|
| 1167 |
+
" <td>48</td>\n",
|
| 1168 |
+
" <td>25.360592</td>\n",
|
| 1169 |
+
" <td>75.031933</td>\n",
|
| 1170 |
+
" <td>6.012697</td>\n",
|
| 1171 |
+
" <td>116.553145</td>\n",
|
| 1172 |
+
" </tr>\n",
|
| 1173 |
+
" <tr>\n",
|
| 1174 |
+
" <th>1179</th>\n",
|
| 1175 |
+
" <td>0</td>\n",
|
| 1176 |
+
" <td>17</td>\n",
|
| 1177 |
+
" <td>30</td>\n",
|
| 1178 |
+
" <td>35.474783</td>\n",
|
| 1179 |
+
" <td>47.972305</td>\n",
|
| 1180 |
+
" <td>6.279134</td>\n",
|
| 1181 |
+
" <td>97.790725</td>\n",
|
| 1182 |
+
" </tr>\n",
|
| 1183 |
+
" <tr>\n",
|
| 1184 |
+
" <th>...</th>\n",
|
| 1185 |
+
" <td>...</td>\n",
|
| 1186 |
+
" <td>...</td>\n",
|
| 1187 |
+
" <td>...</td>\n",
|
| 1188 |
+
" <td>...</td>\n",
|
| 1189 |
+
" <td>...</td>\n",
|
| 1190 |
+
" <td>...</td>\n",
|
| 1191 |
+
" <td>...</td>\n",
|
| 1192 |
+
" </tr>\n",
|
| 1193 |
+
" <tr>\n",
|
| 1194 |
+
" <th>1638</th>\n",
|
| 1195 |
+
" <td>10</td>\n",
|
| 1196 |
+
" <td>5</td>\n",
|
| 1197 |
+
" <td>5</td>\n",
|
| 1198 |
+
" <td>21.213070</td>\n",
|
| 1199 |
+
" <td>91.353492</td>\n",
|
| 1200 |
+
" <td>7.817846</td>\n",
|
| 1201 |
+
" <td>112.983436</td>\n",
|
| 1202 |
+
" </tr>\n",
|
| 1203 |
+
" <tr>\n",
|
| 1204 |
+
" <th>1095</th>\n",
|
| 1205 |
+
" <td>108</td>\n",
|
| 1206 |
+
" <td>94</td>\n",
|
| 1207 |
+
" <td>47</td>\n",
|
| 1208 |
+
" <td>27.359116</td>\n",
|
| 1209 |
+
" <td>84.546250</td>\n",
|
| 1210 |
+
" <td>6.387431</td>\n",
|
| 1211 |
+
" <td>90.812505</td>\n",
|
| 1212 |
+
" </tr>\n",
|
| 1213 |
+
" <tr>\n",
|
| 1214 |
+
" <th>1130</th>\n",
|
| 1215 |
+
" <td>11</td>\n",
|
| 1216 |
+
" <td>36</td>\n",
|
| 1217 |
+
" <td>31</td>\n",
|
| 1218 |
+
" <td>27.920633</td>\n",
|
| 1219 |
+
" <td>51.779659</td>\n",
|
| 1220 |
+
" <td>6.475449</td>\n",
|
| 1221 |
+
" <td>100.258567</td>\n",
|
| 1222 |
+
" </tr>\n",
|
| 1223 |
+
" <tr>\n",
|
| 1224 |
+
" <th>1294</th>\n",
|
| 1225 |
+
" <td>11</td>\n",
|
| 1226 |
+
" <td>124</td>\n",
|
| 1227 |
+
" <td>204</td>\n",
|
| 1228 |
+
" <td>13.429886</td>\n",
|
| 1229 |
+
" <td>80.066340</td>\n",
|
| 1230 |
+
" <td>6.361141</td>\n",
|
| 1231 |
+
" <td>71.400430</td>\n",
|
| 1232 |
+
" </tr>\n",
|
| 1233 |
+
" <tr>\n",
|
| 1234 |
+
" <th>860</th>\n",
|
| 1235 |
+
" <td>32</td>\n",
|
| 1236 |
+
" <td>78</td>\n",
|
| 1237 |
+
" <td>22</td>\n",
|
| 1238 |
+
" <td>23.970814</td>\n",
|
| 1239 |
+
" <td>62.355576</td>\n",
|
| 1240 |
+
" <td>7.007038</td>\n",
|
| 1241 |
+
" <td>53.409060</td>\n",
|
| 1242 |
+
" </tr>\n",
|
| 1243 |
+
" </tbody>\n",
|
| 1244 |
+
"</table>\n",
|
| 1245 |
+
"<p>1760 rows × 7 columns</p>\n",
|
| 1246 |
+
"</div>"
|
| 1247 |
+
],
|
| 1248 |
+
"text/plain": [
|
| 1249 |
+
" N P K temperature humidity ph rainfall\n",
|
| 1250 |
+
"1656 17 16 14 16.396243 92.181519 6.625539 102.944161\n",
|
| 1251 |
+
"752 37 79 19 27.543848 69.347863 7.143943 69.408782\n",
|
| 1252 |
+
"892 7 73 25 27.521856 63.132153 7.288057 45.208411\n",
|
| 1253 |
+
"1041 101 70 48 25.360592 75.031933 6.012697 116.553145\n",
|
| 1254 |
+
"1179 0 17 30 35.474783 47.972305 6.279134 97.790725\n",
|
| 1255 |
+
"... ... ... ... ... ... ... ...\n",
|
| 1256 |
+
"1638 10 5 5 21.213070 91.353492 7.817846 112.983436\n",
|
| 1257 |
+
"1095 108 94 47 27.359116 84.546250 6.387431 90.812505\n",
|
| 1258 |
+
"1130 11 36 31 27.920633 51.779659 6.475449 100.258567\n",
|
| 1259 |
+
"1294 11 124 204 13.429886 80.066340 6.361141 71.400430\n",
|
| 1260 |
+
"860 32 78 22 23.970814 62.355576 7.007038 53.409060\n",
|
| 1261 |
+
"\n",
|
| 1262 |
+
"[1760 rows x 7 columns]"
|
| 1263 |
+
]
|
| 1264 |
+
},
|
| 1265 |
+
"execution_count": 18,
|
| 1266 |
+
"metadata": {},
|
| 1267 |
+
"output_type": "execute_result"
|
| 1268 |
+
}
|
| 1269 |
+
],
|
| 1270 |
+
"source": [
|
| 1271 |
+
"X_train"
|
| 1272 |
+
]
|
| 1273 |
+
},
|
| 1274 |
+
{
|
| 1275 |
+
"cell_type": "markdown",
|
| 1276 |
+
"id": "ab13cdf8",
|
| 1277 |
+
"metadata": {},
|
| 1278 |
+
"source": [
|
| 1279 |
+
"\n",
|
| 1280 |
+
"# Scale the features using MinMaxScaler"
|
| 1281 |
+
]
|
| 1282 |
+
},
|
| 1283 |
+
{
|
| 1284 |
+
"cell_type": "code",
|
| 1285 |
+
"execution_count": 19,
|
| 1286 |
+
"id": "f19981a7",
|
| 1287 |
+
"metadata": {},
|
| 1288 |
+
"outputs": [],
|
| 1289 |
+
"source": [
|
| 1290 |
+
"from sklearn.preprocessing import MinMaxScaler\n",
|
| 1291 |
+
"ms = MinMaxScaler()\n",
|
| 1292 |
+
"\n",
|
| 1293 |
+
"X_train = ms.fit_transform(X_train)\n",
|
| 1294 |
+
"X_test = ms.transform(X_test)"
|
| 1295 |
+
]
|
| 1296 |
+
},
|
| 1297 |
+
{
|
| 1298 |
+
"cell_type": "code",
|
| 1299 |
+
"execution_count": 20,
|
| 1300 |
+
"id": "f3f50c64",
|
| 1301 |
+
"metadata": {},
|
| 1302 |
+
"outputs": [
|
| 1303 |
+
{
|
| 1304 |
+
"data": {
|
| 1305 |
+
"text/plain": [
|
| 1306 |
+
"array([[0.12142857, 0.07857143, 0.045 , ..., 0.9089898 , 0.48532225,\n",
|
| 1307 |
+
" 0.29685161],\n",
|
| 1308 |
+
" [0.26428571, 0.52857143, 0.07 , ..., 0.64257946, 0.56594073,\n",
|
| 1309 |
+
" 0.17630752],\n",
|
| 1310 |
+
" [0.05 , 0.48571429, 0.1 , ..., 0.57005802, 0.58835229,\n",
|
| 1311 |
+
" 0.08931844],\n",
|
| 1312 |
+
" ...,\n",
|
| 1313 |
+
" [0.07857143, 0.22142857, 0.13 , ..., 0.43760347, 0.46198144,\n",
|
| 1314 |
+
" 0.28719815],\n",
|
| 1315 |
+
" [0.07857143, 0.85 , 0.995 , ..., 0.76763665, 0.44420505,\n",
|
| 1316 |
+
" 0.18346657],\n",
|
| 1317 |
+
" [0.22857143, 0.52142857, 0.085 , ..., 0.56099735, 0.54465022,\n",
|
| 1318 |
+
" 0.11879596]])"
|
| 1319 |
+
]
|
| 1320 |
+
},
|
| 1321 |
+
"execution_count": 20,
|
| 1322 |
+
"metadata": {},
|
| 1323 |
+
"output_type": "execute_result"
|
| 1324 |
+
}
|
| 1325 |
+
],
|
| 1326 |
+
"source": [
|
| 1327 |
+
"X_train"
|
| 1328 |
+
]
|
| 1329 |
+
},
|
| 1330 |
+
{
|
| 1331 |
+
"cell_type": "markdown",
|
| 1332 |
+
"id": "752a08ae",
|
| 1333 |
+
"metadata": {},
|
| 1334 |
+
"source": [
|
| 1335 |
+
"# Training Models"
|
| 1336 |
+
]
|
| 1337 |
+
},
|
| 1338 |
+
{
|
| 1339 |
+
"cell_type": "code",
|
| 1340 |
+
"execution_count": 21,
|
| 1341 |
+
"id": "ac6ef55e",
|
| 1342 |
+
"metadata": {},
|
| 1343 |
+
"outputs": [
|
| 1344 |
+
{
|
| 1345 |
+
"name": "stdout",
|
| 1346 |
+
"output_type": "stream",
|
| 1347 |
+
"text": [
|
| 1348 |
+
"Support Vector Machine with accuracy: 0.9681818181818181\n",
|
| 1349 |
+
"Confusion matrix: [[14 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1350 |
+
" [ 0 20 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1351 |
+
" [ 0 0 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1]\n",
|
| 1352 |
+
" [ 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1353 |
+
" [ 0 0 0 0 27 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1354 |
+
" [ 0 0 0 0 0 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1355 |
+
" [ 0 0 0 0 0 0 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1356 |
+
" [ 0 0 0 0 0 0 0 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1357 |
+
" [ 0 0 0 0 0 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1358 |
+
" [ 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1359 |
+
" [ 0 0 0 0 0 0 0 0 0 0 14 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1360 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1361 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 21 0 0 0 0 0 0 0 0 0]\n",
|
| 1362 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 23 0 0 0 0 0 0 0 0]\n",
|
| 1363 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 0 0 0 0 0 0 0]\n",
|
| 1364 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 19 0 0 0 0 0 0]\n",
|
| 1365 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0]\n",
|
| 1366 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 21 0 0 0 0]\n",
|
| 1367 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 20 2 0 0]\n",
|
| 1368 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0 0]\n",
|
| 1369 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 26 0]\n",
|
| 1370 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17]]\n",
|
| 1371 |
+
"==========================================================\n",
|
| 1372 |
+
"K-Nearest Neighbors with accuracy: 0.9704545454545455\n",
|
| 1373 |
+
"Confusion matrix: [[14 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1374 |
+
" [ 0 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1375 |
+
" [ 1 0 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1376 |
+
" [ 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1377 |
+
" [ 0 0 0 0 27 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1378 |
+
" [ 0 0 0 0 0 23 0 0 0 0 0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 0 0 17]]\n",
|
| 1395 |
+
"==========================================================\n",
|
| 1396 |
+
"Random Forest with accuracy: 0.9931818181818182\n",
|
| 1397 |
+
"Confusion matrix: [[17 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1398 |
+
" [ 0 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1399 |
+
" [ 0 0 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1400 |
+
" [ 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1401 |
+
" [ 0 0 0 0 27 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1402 |
+
" [ 0 0 0 0 0 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1403 |
+
" [ 0 0 0 0 0 0 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1404 |
+
" [ 0 0 0 0 0 0 0 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1405 |
+
" [ 0 0 0 0 0 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1406 |
+
" [ 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1407 |
+
" [ 0 0 0 0 0 0 0 0 0 0 14 0 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1408 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0 0 0 0 0 0]\n",
|
| 1409 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 21 0 0 0 0 0 0 0 0 0]\n",
|
| 1410 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 23 0 0 0 0 0 0 0 0]\n",
|
| 1411 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 0 0 0 0 0 0 0]\n",
|
| 1412 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0 0 0 0 0 0]\n",
|
| 1413 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0]\n",
|
| 1414 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 23 0 0 0 0]\n",
|
| 1415 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 23 0 0 0]\n",
|
| 1416 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0 0]\n",
|
| 1417 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 26 0]\n",
|
| 1418 |
+
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17]]\n",
|
| 1419 |
+
"==========================================================\n"
|
| 1420 |
+
]
|
| 1421 |
+
}
|
| 1422 |
+
],
|
| 1423 |
+
"source": [
|
| 1424 |
+
"from sklearn.svm import SVC\n",
|
| 1425 |
+
"from sklearn.neighbors import KNeighborsClassifier\n",
|
| 1426 |
+
"from sklearn.ensemble import RandomForestClassifier\n",
|
| 1427 |
+
"from sklearn.metrics import accuracy_score, confusion_matrix\n",
|
| 1428 |
+
"\n",
|
| 1429 |
+
"# create instances of only the selected models\n",
|
| 1430 |
+
"models = {\n",
|
| 1431 |
+
" 'Support Vector Machine': SVC(),\n",
|
| 1432 |
+
" 'K-Nearest Neighbors': KNeighborsClassifier(),\n",
|
| 1433 |
+
" 'Random Forest': RandomForestClassifier(),\n",
|
| 1434 |
+
"}\n",
|
| 1435 |
+
"\n",
|
| 1436 |
+
"# iterate through the selected models\n",
|
| 1437 |
+
"for name, model in models.items():\n",
|
| 1438 |
+
" model.fit(X_train, y_train)\n",
|
| 1439 |
+
" y_pred = model.predict(X_test)\n",
|
| 1440 |
+
" \n",
|
| 1441 |
+
" print(f\"{name} with accuracy: {accuracy_score(y_test, y_pred)}\")\n",
|
| 1442 |
+
" print(\"Confusion matrix:\", confusion_matrix(y_test, y_pred))\n",
|
| 1443 |
+
" print(\"==========================================================\")\n"
|
| 1444 |
+
]
|
| 1445 |
+
},
|
| 1446 |
+
{
|
| 1447 |
+
"cell_type": "code",
|
| 1448 |
+
"execution_count": 22,
|
| 1449 |
+
"id": "e63aba03-0610-4864-87a1-7f755bdfaf07",
|
| 1450 |
+
"metadata": {},
|
| 1451 |
+
"outputs": [
|
| 1452 |
+
{
|
| 1453 |
+
"name": "stdout",
|
| 1454 |
+
"output_type": "stream",
|
| 1455 |
+
"text": [
|
| 1456 |
+
"Support Vector Machine with accuracy: 0.9681818181818181\n",
|
| 1457 |
+
"K-Nearest Neighbors with accuracy: 0.9704545454545455\n",
|
| 1458 |
+
"Random Forest with accuracy: 0.9931818181818182\n"
|
| 1459 |
+
]
|
| 1460 |
+
},
|
| 1461 |
+
{
|
| 1462 |
+
"data": {
|
| 1463 |
+
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA+kAAAHUCAYAAABGRmklAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAABOEUlEQVR4nO3dd3QU1f//8demN5IQWigpQAyhhF6kKCUgSBeki8TQkY5SVED4iCBNRBSUkvBRuhQRpRlJEJD6IQiCgKGJgCASQi/J/P7gy/5cEiDBhEzg+Thnz2Hv3LnznmXk+No7c9diGIYhAAAAAACQ5eyyugAAAAAAAHAHIR0AAAAAAJMgpAMAAAAAYBKEdAAAAAAATIKQDgAAAACASRDSAQAAAAAwCUI6AAAAAAAmQUgHAAAAAMAkCOkAAAAAAJgEIR0AgCfY1KlTZbFYVKpUqawuJVv6888/NXToUIWGhsrDw0MuLi565pln1K9fPx0+fDiry8t0UVFRslgsOnbsWFaXAgBPDYthGEZWFwEAADJH2bJltWfPHknS1q1bVaVKlSyuKPvYvn27GjduLMMw1Lt3b1WtWlVOTk46ePCgvvzyS+3bt08XLlzI6jIz1blz5xQfH69y5crJ2dk5q8sBgKcCIR0AgCfUzp07ValSJTVq1Ejffvutunbtqs8//zyry0rV1atX5ebmltVlWCUmJqpYsWJydHTUli1bVKhQoRR9vvrqK7388stZUF3mu3btmlxcXGSxWLK6FAB46nC7OwAAT6jZs2dLksaNG6dq1app4cKFunr1aop+f/zxh7p16yY/Pz85OTmpQIECevnll/Xnn39a+yQkJGjQoEEqUqSInJ2dlTdvXjVs2FC//vqrJCkmJkYWi0UxMTE2Yx87dkwWi0VRUVHWtvDwcHl4eGjv3r164YUXlCNHDoWFhUmS1q9fr2bNmqlQoUJycXFRUFCQunfvrr/++itF3b/++qvatWunfPnyydnZWf7+/nr11Vd148YNHTt2TA4ODho7dmyK/TZu3CiLxaIlS5bc97ObOXOmzpw5o/Hjx6ca0CWlCOgrV65U1apV5ebmphw5cqhevXr66aefbPq8++67slgs+vnnn9WqVSt5eXnJx8dHAwcO1O3bt3Xw4EE1aNBAOXLkUGBgoMaPH2+z/93P+csvv9TAgQPl6+srV1dX1axZU7t377bpu3PnTrVt21aBgYFydXVVYGCg2rVrp+PHj9v0u3tL+7p16xQREaE8efLIzc1NN27cSPV29927d6tx48bKmzevnJ2dVaBAATVq1EgnT5609rl+/bqGDRumwoULy8nJSQULFtTrr7+uhIQEm2MHBgaqcePGWrNmjcqXLy9XV1eFhIRozpw59/27AYAnHSEdAIAn0LVr17RgwQJVqlRJpUqVUkREhC5dupQimP7xxx+qVKmSli9froEDB2r16tWaMmWKvLy8rLdyX7p0STVq1NBnn32m1157Td98841mzJih4OBgnT59+pHqu3nzppo2bao6dero66+/1qhRoyRJ8fHxqlq1qqZPn65169ZpxIgR2rZtm2rUqKFbt25Z99+zZ48qVaqkrVu3avTo0Vq9erXGjh2rGzdu6ObNmwoMDFTTpk01Y8YMJSUl2Rx72rRpKlCggF566aX71rdu3TrZ29urSZMmaTqf+fPnq1mzZ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nT5/WRx99lGp9nTt31pEjRxQbG2ttu3LlihYvXqzOnTvLMAw1atRIZ86c0Xfffaddu3apfPnyCgsLs95Z8O2336pFixZq1KiRdu/erejoaFWsWFHSnaBcqFAhjR49WqdPn9bp06clSbt27VLr1q3Vtm1b7d27V++++66GDx+uqKgom/omTJigUqVKadeuXRo+fPgDP+vXXntNkZGR1vdz5sxRREREin5XrlzRwIEDtWPHDkVHR8vOzk4vvfSSkpOTJUmXL19WzZo1derUKa1cuVJ79uzR4MGDrdslKT4+XitWrNCqVau0atUqxcbGaty4cQ+sb9KkSapYsaJ2796tXr16qWfPnvr1118l3bkOateuLQ8PD23cuFGbNm2Sh4eHGjRokOodBDdu3FBiYqLNCwAAAAAyi0OWHdjBQVFRUeratatmzJih8uXLq2bNmmrbtq1Kly6d7vFGjhypevXqSZLmzp2rQoUKafny5WrdurWkO7emT5s2TVWqVLH2KV68uLZv367KlStr4sSJCg8PV69evSRJAwcO1NatWzVx4kTrbLkktW/f3iaQHj16VJKUN29eeXt737e+EiVKqEqVKoqMjFStWrUkSYsXL1ZSUpLatWunDRs2aO/evTp79qycnZ0lSRMnTtSKFSv01VdfqVu3bhozZozatm2rUaNGWcctU6aMpDu3fdvb2ytHjhzy9fW1bp88ebLCwsKswTs4OFj79+/XhAkTbGb969SpozfeeCNNn3XHjh01bNgw650Omzdv1sKFC613N9zVsmVLm/ezZ89W3rx5tX//fpUqVUrz58/XuXPntGPHDvn4+EiSgoKCbPZJTk5WVFSU9Zb2jh07Kjo6WmPGjLlvfQ0bNrT+PQ4ZMkQffvihYmJiFBISooULF8rOzk6zZs2y3m0QGRkpb29vxcTE6IUXXrAZa+zYsTafNwAAAABkpix/Jv3uLGr9+vUVExOj8uXLp5jlTYuqVata/+zj46NixYrpwIED1jYHBwfrrLN0Z7E2b29va58DBw6oevXqNmNWr17dZgxJNmOkV+fOnfXVV19Zb9eeM2eOWrRoIW9vb+3atUuXL19Wrly5rHcZeHh46OjRo9ZbxOPi4hQWFpauY97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7q4qVaooJibGuv38+fNq166dChUqJDc3N4WGhmrBggU2Y9SqVUu9e/fWwIEDlTt3btWrV0+StH//fjVs2FAeHh7Kly+fOnbsqL/++su631dffaXQ0FC5uroqV65cqlu3rq5cuaJ3331Xc+fO1ddff21dP+CfNd2rbt268vX11dixYx/4eWzZskXPP/+8XF1d5efnp759++rKlSvW7YGBgZoyZYr1/a+//qoaNWrIxcVFJUqU0Pfffy+LxZJidv/IkSOqXbu23NzcVKZMGf30008pjr1ixQoFBwfLxcVF9erV0++//26zffr06SpatKicnJxUrFgxffHFFzbbLRaLZsyYoWbNmsnd3V3vvfeeLly4oA4dOihPnjxydXXVM888o8jIyAd+BgAAAADwOKQppP/www/Wlds3bNigH374IcXrbrsZDR06VP/5z3+0atUqtWzZ8qH927Vrp6CgoAf+7vtrr72mzZs3a+HChfr555/VqlUrNWjQQIcPH5YkXb9+XRUqVNCqVau0b98+devWTR07dtS2bdtsxpk7d64cHBy0efNmffbZZzp9+rRq1qypsmXLaufOnVqzZo3+/PNPtW7dWpJ0+vRptWvXThERETpw4IBiYmLUokULGYahN954Q61bt1aDBg10+vRpnT59WtWqVbvvOdjb2+v999/Xxx9/rJMnT6baZ+/evapfv75atGihn3/+WYsWLdKmTZvUu3fvVPsnJyerefPmcnNz07Zt2/T555/r7bffTrXv22+/rTfeeENxcXEKDg5Wu3btdPv2bev2q1evasyYMZo7d642b96sxMREtW3b1rp9+fLl6tevnwYNGqR9+/ape/fueu2117Rhwwab44wcOVLNmjXT3r17FRERoeHDh2v//v1avXq1Dhw4oOnTpyt37typ1njjxo1sdbcIAAAAgOwtTc+k16xZU5J0+/ZtxcTEKCIiQn5+fplaWEZZvXq1vv76a0VHR6tOnTpp2sdisWjcuHFq0qSJBgwYoKJFi9psj4+P14IFC3Ty5EkVKFBAkvTGG29ozZo1ioyM1Pvvv6+CBQvqjTfesO7Tp08frVmzRkuWLFGVKlWs7UFBQRo/frz1/YgRI1S+fHm9//771rY5c+bIz89Phw4d0uXLl3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a9euVcGCBR+6X+XKldWiRQubnyiT7qxwn5SUpLNnz+q5555Ldd8ff/xRzZo10yuvvCLpTvg8fPiwihcv/sBjli9fXkuXLlVgYKAcHFL/67FYLKpevbqqV6+uESNGKCAgQMuXL9fAgQPl5OT0SHc6jBs3TmXLllVwcHCKen755RcFBQWlaZyQkBCdOHFCf/75p/Llyyfpzk+0PYrbt29r586d1pn4gwcPKiEhwXpnQfHixbVp0ya9+uqr1n22bNny0M9YurMifXh4uMLDw/Xcc8/pzTffzJIV/QEAAADgn9Id0nv27ClJmjx5coptFovFtLfCFypUSDExMTZB3cvL66H7jRkzRiVLlrQJzMHBwerQoYNeffVVTZo0SeXKldNff/2lH374QaGhoWrYsKGCgoK0dOlSbdmyRTlz5tTkyZN15syZhwbI119/XTNnzlS7du305ptvKnfu3Prtt9+0cOFCzZw5Uzt37lR0dLReeOEF5c2bV9u2bdO5c+es4wYGBmrt2rU6ePCgcuXKJS8vrzT9pn1oaKg6dOigjz/+2KZ9yJAhevbZZ/X666+ra9eucnd314EDB7R+/foUfSWpXr16Klq0qDp16qTx48fr0qVL1oXj0jrDfpejo6P69OmjqVOnytHRUb1799azzz5rDe1vvvmmWrdurfLlyyssLEzffPONli1bpu+///6B444YMUIVKlRQyZIldePGDa1atSpNwR4AAAAAMlu6nkmX7swI3+9l1oB+V8GCBRUbG6uEhATVq1dPCQkJD90nODhYERERun79uk17ZGSkXn31VQ0aNEjFihVT06ZNtW3bNuuCesOHD1f58uVVv3591apVS76+vmrevPlDj1egQAFt3rxZSUlJql+/vkqVKqV+/frJy8tLdnZ28vT01MaNG9WwYUMFBwfrnXfe0aRJk/Tiiy9Kkrp27apixYqpYsWKypMnjzZv3pzmz+c///mPDMOwaStdurRiY2N1+PBhPffccypXrpyGDx9ufYb8Xvb29lqxYoUuX76sSpUqqUuXLnrnnXckKcUicw/j5uamIUOGqH379qpatapcXV21cOFC6/bmzZvro48+0oQJE1SyZEl99tlnioyMVK1atR44rpOTk4YNG6bSpUvr+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158uTRpUuXdOXKFWvb3WfOH+T8+fM6cOCA3nnnHYWFhal48eK6cOGCTZ/SpUsrLi5Of//9933H6dKli77//nt9+umnunXrls2CdwCAJxcz6QAAIFtatWqVLly4oM6dO8vLy8tm28svv6zZs2frww8/VFhYmIoWLaq2bdvq9u3bWr16tQYPHqzAwEB16tRJERERmjp1qsqUKaPjx4/r7Nmzat26tapUqSI3Nze99dZb6tOnj7Zv355i5fjU5MyZU7ly5dLnn3+u/Pnz68SJExo6dKhNn3bt2un9999X8+bNNXbsWOXPn1+7d+9WgQIFVLVqVUlS8eLF9eyzz2rIkCGKiIh46Ow7AODJwEw6AADIlmbPnq26deumCOjSnYXb4uLi5OnpqSVLlmjlypUqW7as6tSpo23btln7TZ8+XS+//LJ69eqlkJAQde3a1Tpz7uPjoy+//FLfffedQkNDtWDBAr377rsPrcvOzk4LFy7Url27VKpUKQ0YMEATJkyw6ePk5KR169Ypb968atiwoUJDQzVu3DjZ29vb9OvcubNu3rypiIiIR/iEAADZkcXgxzYBAABMacyYMVq4cKH27t2b1aUAAB4TZtIBAABM5vLly9qxY4c+/vhj9e3bN6vLAQA8RoR0AAAAk+ndu7dq1KihmjVrcqs7ADxluN0dAAAAAACTYCYdAAAAAACTIKQDAAAAAGAShHQAAAAAAEyCkA4AAAAAgEkQ0gEAAAAAMAlCOgAAAAAAJkFIBwAAAADAJAjpAAAAAACYxP8DkACKSHdH9d8AAAAASUVORK5CYII=",
|
| 1464 |
+
"text/plain": [
|
| 1465 |
+
"<Figure size 1000x500 with 1 Axes>"
|
| 1466 |
+
]
|
| 1467 |
+
},
|
| 1468 |
+
"metadata": {},
|
| 1469 |
+
"output_type": "display_data"
|
| 1470 |
+
}
|
| 1471 |
+
],
|
| 1472 |
+
"source": [
|
| 1473 |
+
"import matplotlib.pyplot as plt\n",
|
| 1474 |
+
"import seaborn as sns\n",
|
| 1475 |
+
"from sklearn.svm import SVC\n",
|
| 1476 |
+
"from sklearn.neighbors import KNeighborsClassifier\n",
|
| 1477 |
+
"from sklearn.ensemble import RandomForestClassifier\n",
|
| 1478 |
+
"from sklearn.metrics import accuracy_score, confusion_matrix\n",
|
| 1479 |
+
"\n",
|
| 1480 |
+
"# create instances of only the selected models\n",
|
| 1481 |
+
"models = {\n",
|
| 1482 |
+
" 'Support Vector Machine': SVC(),\n",
|
| 1483 |
+
" 'K-Nearest Neighbors': KNeighborsClassifier(),\n",
|
| 1484 |
+
" 'Random Forest': RandomForestClassifier(),\n",
|
| 1485 |
+
"}\n",
|
| 1486 |
+
"\n",
|
| 1487 |
+
"# to store model names and accuracies for plotting\n",
|
| 1488 |
+
"model_names = []\n",
|
| 1489 |
+
"accuracies = []\n",
|
| 1490 |
+
"\n",
|
| 1491 |
+
"# iterate through the selected models\n",
|
| 1492 |
+
"for name, model in models.items():\n",
|
| 1493 |
+
" model.fit(X_train, y_train)\n",
|
| 1494 |
+
" y_pred = model.predict(X_test)\n",
|
| 1495 |
+
" \n",
|
| 1496 |
+
" accuracy = accuracy_score(y_test, y_pred)\n",
|
| 1497 |
+
" model_names.append(name)\n",
|
| 1498 |
+
" accuracies.append(accuracy)\n",
|
| 1499 |
+
" \n",
|
| 1500 |
+
" print(f\"{name} with accuracy: {accuracy}\")\n",
|
| 1501 |
+
" \n",
|
| 1502 |
+
"\n",
|
| 1503 |
+
"# set up the DataFrame for Seaborn\n",
|
| 1504 |
+
"import pandas as pd\n",
|
| 1505 |
+
"results_df = pd.DataFrame({'Algorithm': model_names, 'Accuracy': accuracies})\n",
|
| 1506 |
+
"\n",
|
| 1507 |
+
"# plot the accuracies using Seaborn\n",
|
| 1508 |
+
"plt.figure(figsize=(10, 5), dpi=100)\n",
|
| 1509 |
+
"sns.barplot(x='Accuracy', y='Algorithm', data=results_df, palette='dark')\n",
|
| 1510 |
+
"plt.title('Accuracy Comparison')\n",
|
| 1511 |
+
"plt.xlabel('Accuracy')\n",
|
| 1512 |
+
"plt.ylabel('Algorithm')\n",
|
| 1513 |
+
"plt.xlim(0, 1) # assuming accuracy is between 0 and 1\n",
|
| 1514 |
+
"plt.show()"
|
| 1515 |
+
]
|
| 1516 |
+
},
|
| 1517 |
+
{
|
| 1518 |
+
"cell_type": "code",
|
| 1519 |
+
"execution_count": 23,
|
| 1520 |
+
"id": "4659be4d",
|
| 1521 |
+
"metadata": {},
|
| 1522 |
+
"outputs": [
|
| 1523 |
+
{
|
| 1524 |
+
"data": {
|
| 1525 |
+
"text/plain": [
|
| 1526 |
+
"0.9931818181818182"
|
| 1527 |
+
]
|
| 1528 |
+
},
|
| 1529 |
+
"execution_count": 23,
|
| 1530 |
+
"metadata": {},
|
| 1531 |
+
"output_type": "execute_result"
|
| 1532 |
+
}
|
| 1533 |
+
],
|
| 1534 |
+
"source": [
|
| 1535 |
+
"rfc = RandomForestClassifier()\n",
|
| 1536 |
+
"rfc.fit(X_train,y_train)\n",
|
| 1537 |
+
"ypred = rfc.predict(X_test)\n",
|
| 1538 |
+
"accuracy_score(y_test,ypred)"
|
| 1539 |
+
]
|
| 1540 |
+
},
|
| 1541 |
+
{
|
| 1542 |
+
"cell_type": "markdown",
|
| 1543 |
+
"id": "859d9922",
|
| 1544 |
+
"metadata": {},
|
| 1545 |
+
"source": [
|
| 1546 |
+
"# Predictive System"
|
| 1547 |
+
]
|
| 1548 |
+
},
|
| 1549 |
+
{
|
| 1550 |
+
"cell_type": "code",
|
| 1551 |
+
"execution_count": 24,
|
| 1552 |
+
"id": "17f3a3fe",
|
| 1553 |
+
"metadata": {},
|
| 1554 |
+
"outputs": [],
|
| 1555 |
+
"source": [
|
| 1556 |
+
"def recommendation(N, P, K, temperature, humidity, ph, rainfall):\n",
|
| 1557 |
+
" features = np.array([[N, P, K, temperature, humidity, ph, rainfall]])\n",
|
| 1558 |
+
" transformed_features = ms.transform(features) # Use transform only\n",
|
| 1559 |
+
" prediction = rfc.predict(transformed_features)\n",
|
| 1560 |
+
" return prediction[0]"
|
| 1561 |
+
]
|
| 1562 |
+
},
|
| 1563 |
+
{
|
| 1564 |
+
"cell_type": "code",
|
| 1565 |
+
"execution_count": 25,
|
| 1566 |
+
"id": "64ffd9d3",
|
| 1567 |
+
"metadata": {},
|
| 1568 |
+
"outputs": [
|
| 1569 |
+
{
|
| 1570 |
+
"name": "stdout",
|
| 1571 |
+
"output_type": "stream",
|
| 1572 |
+
"text": [
|
| 1573 |
+
"Kidneybeans is a best crop to be cultivated \n"
|
| 1574 |
+
]
|
| 1575 |
+
},
|
| 1576 |
+
{
|
| 1577 |
+
"name": "stderr",
|
| 1578 |
+
"output_type": "stream",
|
| 1579 |
+
"text": [
|
| 1580 |
+
"E:\\anaconda\\Lib\\site-packages\\sklearn\\base.py:493: UserWarning: X does not have valid feature names, but MinMaxScaler was fitted with feature names\n",
|
| 1581 |
+
" warnings.warn(\n"
|
| 1582 |
+
]
|
| 1583 |
+
}
|
| 1584 |
+
],
|
| 1585 |
+
"source": [
|
| 1586 |
+
"# new inputs\n",
|
| 1587 |
+
"\n",
|
| 1588 |
+
"\n",
|
| 1589 |
+
"N = 40\n",
|
| 1590 |
+
"P = 50\n",
|
| 1591 |
+
"k = 50\n",
|
| 1592 |
+
"temperature = 40.0\n",
|
| 1593 |
+
"humidity = 20\n",
|
| 1594 |
+
"ph = 100\n",
|
| 1595 |
+
"rainfall = 100\n",
|
| 1596 |
+
"\n",
|
| 1597 |
+
"predict = recommendation(N,P,k,temperature,humidity,ph,rainfall)\n",
|
| 1598 |
+
"\n",
|
| 1599 |
+
"crop_dict = {1: \"Rice\", 2: \"Maize\", 3: \"Jute\", 4: \"Cotton\", 5: \"Coconut\", 6: \"Papaya\", 7: \"Orange\",\n",
|
| 1600 |
+
" 8: \"Apple\", 9: \"Muskmelon\", 10: \"Watermelon\", 11: \"Grapes\", 12: \"Mango\", 13: \"Banana\",\n",
|
| 1601 |
+
" 14: \"Pomegranate\", 15: \"Lentil\", 16: \"Blackgram\", 17: \"Mungbean\", 18: \"Mothbeans\",\n",
|
| 1602 |
+
" 19: \"Pigeonpeas\", 20: \"Kidneybeans\", 21: \"Chickpea\", 22: \"Coffee\"}\n",
|
| 1603 |
+
"\n",
|
| 1604 |
+
"if predict in crop_dict:\n",
|
| 1605 |
+
" crop = crop_dict[predict]\n",
|
| 1606 |
+
" print(\"{} is a best crop to be cultivated \".format(crop))\n",
|
| 1607 |
+
"else:\n",
|
| 1608 |
+
" print(\"Sorry are not able to recommend a proper crop for this environment\")"
|
| 1609 |
+
]
|
| 1610 |
+
},
|
| 1611 |
+
{
|
| 1612 |
+
"cell_type": "code",
|
| 1613 |
+
"execution_count": 26,
|
| 1614 |
+
"id": "2ea8ffda",
|
| 1615 |
+
"metadata": {},
|
| 1616 |
+
"outputs": [
|
| 1617 |
+
{
|
| 1618 |
+
"name": "stdout",
|
| 1619 |
+
"output_type": "stream",
|
| 1620 |
+
"text": [
|
| 1621 |
+
"Banana is a best crop to be cultivated \n"
|
| 1622 |
+
]
|
| 1623 |
+
},
|
| 1624 |
+
{
|
| 1625 |
+
"name": "stderr",
|
| 1626 |
+
"output_type": "stream",
|
| 1627 |
+
"text": [
|
| 1628 |
+
"E:\\anaconda\\Lib\\site-packages\\sklearn\\base.py:493: UserWarning: X does not have valid feature names, but MinMaxScaler was fitted with feature names\n",
|
| 1629 |
+
" warnings.warn(\n"
|
| 1630 |
+
]
|
| 1631 |
+
}
|
| 1632 |
+
],
|
| 1633 |
+
"source": [
|
| 1634 |
+
"# new inputs 2\n",
|
| 1635 |
+
"\n",
|
| 1636 |
+
"\n",
|
| 1637 |
+
"N = 100\n",
|
| 1638 |
+
"P = 90\n",
|
| 1639 |
+
"k = 100\n",
|
| 1640 |
+
"temperature = 50.0\n",
|
| 1641 |
+
"humidity = 90.0\n",
|
| 1642 |
+
"ph = 100\n",
|
| 1643 |
+
"rainfall = 202.0\n",
|
| 1644 |
+
"\n",
|
| 1645 |
+
"predict = recommendation(N,P,k,temperature,humidity,ph,rainfall)\n",
|
| 1646 |
+
"\n",
|
| 1647 |
+
"crop_dict = {1: \"Rice\", 2: \"Maize\", 3: \"Jute\", 4: \"Cotton\", 5: \"Coconut\", 6: \"Papaya\", 7: \"Orange\",\n",
|
| 1648 |
+
" 8: \"Apple\", 9: \"Muskmelon\", 10: \"Watermelon\", 11: \"Grapes\", 12: \"Mango\", 13: \"Banana\",\n",
|
| 1649 |
+
" 14: \"Pomegranate\", 15: \"Lentil\", 16: \"Blackgram\", 17: \"Mungbean\", 18: \"Mothbeans\",\n",
|
| 1650 |
+
" 19: \"Pigeonpeas\", 20: \"Kidneybeans\", 21: \"Chickpea\", 22: \"Coffee\"}\n",
|
| 1651 |
+
"\n",
|
| 1652 |
+
"if predict in crop_dict:\n",
|
| 1653 |
+
" crop = crop_dict[predict]\n",
|
| 1654 |
+
" print(\"{} is a best crop to be cultivated \".format(crop))\n",
|
| 1655 |
+
"else:\n",
|
| 1656 |
+
" print(\"Sorry are not able to recommend a proper crop for this environment\")"
|
| 1657 |
+
]
|
| 1658 |
+
},
|
| 1659 |
+
{
|
| 1660 |
+
"cell_type": "code",
|
| 1661 |
+
"execution_count": 27,
|
| 1662 |
+
"id": "d0dccd4e",
|
| 1663 |
+
"metadata": {},
|
| 1664 |
+
"outputs": [
|
| 1665 |
+
{
|
| 1666 |
+
"name": "stdout",
|
| 1667 |
+
"output_type": "stream",
|
| 1668 |
+
"text": [
|
| 1669 |
+
"Orange is a best crop to be cultivated \n"
|
| 1670 |
+
]
|
| 1671 |
+
},
|
| 1672 |
+
{
|
| 1673 |
+
"name": "stderr",
|
| 1674 |
+
"output_type": "stream",
|
| 1675 |
+
"text": [
|
| 1676 |
+
"E:\\anaconda\\Lib\\site-packages\\sklearn\\base.py:493: UserWarning: X does not have valid feature names, but MinMaxScaler was fitted with feature names\n",
|
| 1677 |
+
" warnings.warn(\n"
|
| 1678 |
+
]
|
| 1679 |
+
}
|
| 1680 |
+
],
|
| 1681 |
+
"source": [
|
| 1682 |
+
"# new inputs 2\n",
|
| 1683 |
+
"N = 10\n",
|
| 1684 |
+
"P = 10\n",
|
| 1685 |
+
"k = 10\n",
|
| 1686 |
+
"temperature = 15.0\n",
|
| 1687 |
+
"humidity = 80.0\n",
|
| 1688 |
+
"ph = 4.5\n",
|
| 1689 |
+
"rainfall = 10.0\n",
|
| 1690 |
+
"\n",
|
| 1691 |
+
"predict = recommendation(N,P,k,temperature,humidity,ph,rainfall)\n",
|
| 1692 |
+
"\n",
|
| 1693 |
+
"crop_dict = {1: \"Rice\", 2: \"Maize\", 3: \"Jute\", 4: \"Cotton\", 5: \"Coconut\", 6: \"Papaya\", 7: \"Orange\",\n",
|
| 1694 |
+
" 8: \"Apple\", 9: \"Muskmelon\", 10: \"Watermelon\", 11: \"Grapes\", 12: \"Mango\", 13: \"Banana\",\n",
|
| 1695 |
+
" 14: \"Pomegranate\", 15: \"Lentil\", 16: \"Blackgram\", 17: \"Mungbean\", 18: \"Mothbeans\",\n",
|
| 1696 |
+
" 19: \"Pigeonpeas\", 20: \"Kidneybeans\", 21: \"Chickpea\", 22: \"Coffee\"}\n",
|
| 1697 |
+
"\n",
|
| 1698 |
+
"if predict in crop_dict:\n",
|
| 1699 |
+
" crop = crop_dict[predict]\n",
|
| 1700 |
+
" print(\"{} is a best crop to be cultivated \".format(crop))\n",
|
| 1701 |
+
"else:\n",
|
| 1702 |
+
" print(\"Sorry are not able to recommend a proper crop for this environment\")"
|
| 1703 |
+
]
|
| 1704 |
+
},
|
| 1705 |
+
{
|
| 1706 |
+
"cell_type": "code",
|
| 1707 |
+
"execution_count": 28,
|
| 1708 |
+
"id": "6761fdaf-6bd8-464e-b61a-2cff2f98e08d",
|
| 1709 |
+
"metadata": {},
|
| 1710 |
+
"outputs": [
|
| 1711 |
+
{
|
| 1712 |
+
"name": "stdout",
|
| 1713 |
+
"output_type": "stream",
|
| 1714 |
+
"text": [
|
| 1715 |
+
"Papaya is the best crop to be cultivated.\n"
|
| 1716 |
+
]
|
| 1717 |
+
},
|
| 1718 |
+
{
|
| 1719 |
+
"name": "stderr",
|
| 1720 |
+
"output_type": "stream",
|
| 1721 |
+
"text": [
|
| 1722 |
+
"E:\\anaconda\\Lib\\site-packages\\sklearn\\base.py:493: UserWarning: X does not have valid feature names, but MinMaxScaler was fitted with feature names\n",
|
| 1723 |
+
" warnings.warn(\n"
|
| 1724 |
+
]
|
| 1725 |
+
}
|
| 1726 |
+
],
|
| 1727 |
+
"source": [
|
| 1728 |
+
"N = 40 # Nitrogen\n",
|
| 1729 |
+
"P = 45 # Phosphorus\n",
|
| 1730 |
+
"K = 40 # Potassium\n",
|
| 1731 |
+
"temperature = 20.0 # Celsius\n",
|
| 1732 |
+
"humidity = 80.0 # Percentage\n",
|
| 1733 |
+
"ph = 6.0 # pH\n",
|
| 1734 |
+
"rainfall = 150.0 # mm\n",
|
| 1735 |
+
"\n",
|
| 1736 |
+
"predict = recommendation(N, P, K, temperature, humidity, ph, rainfall)\n",
|
| 1737 |
+
"\n",
|
| 1738 |
+
"if predict in crop_dict:\n",
|
| 1739 |
+
" crop = crop_dict[predict]\n",
|
| 1740 |
+
" print(\"{} is the best crop to be cultivated.\".format(crop))\n",
|
| 1741 |
+
"else:\n",
|
| 1742 |
+
" print(\"Sorry, we are not able to recommend a proper crop for this environment.\")"
|
| 1743 |
+
]
|
| 1744 |
+
},
|
| 1745 |
+
{
|
| 1746 |
+
"cell_type": "code",
|
| 1747 |
+
"execution_count": 29,
|
| 1748 |
+
"id": "fa3d3b8c",
|
| 1749 |
+
"metadata": {},
|
| 1750 |
+
"outputs": [],
|
| 1751 |
+
"source": [
|
| 1752 |
+
"import pickle\n",
|
| 1753 |
+
"pickle.dump(rfc,open('model.pkl','wb'))\n",
|
| 1754 |
+
"pickle.dump(ms,open('minmaxscaler.pkl','wb'))"
|
| 1755 |
+
]
|
| 1756 |
+
},
|
| 1757 |
+
{
|
| 1758 |
+
"cell_type": "code",
|
| 1759 |
+
"execution_count": null,
|
| 1760 |
+
"id": "a55a48a3",
|
| 1761 |
+
"metadata": {},
|
| 1762 |
+
"outputs": [],
|
| 1763 |
+
"source": []
|
| 1764 |
+
},
|
| 1765 |
+
{
|
| 1766 |
+
"cell_type": "code",
|
| 1767 |
+
"execution_count": null,
|
| 1768 |
+
"id": "c97733fc",
|
| 1769 |
+
"metadata": {},
|
| 1770 |
+
"outputs": [],
|
| 1771 |
+
"source": []
|
| 1772 |
+
}
|
| 1773 |
+
],
|
| 1774 |
+
"metadata": {
|
| 1775 |
+
"kernelspec": {
|
| 1776 |
+
"display_name": "Python 3 (ipykernel)",
|
| 1777 |
+
"language": "python",
|
| 1778 |
+
"name": "python3"
|
| 1779 |
+
},
|
| 1780 |
+
"language_info": {
|
| 1781 |
+
"codemirror_mode": {
|
| 1782 |
+
"name": "ipython",
|
| 1783 |
+
"version": 3
|
| 1784 |
+
},
|
| 1785 |
+
"file_extension": ".py",
|
| 1786 |
+
"mimetype": "text/x-python",
|
| 1787 |
+
"name": "python",
|
| 1788 |
+
"nbconvert_exporter": "python",
|
| 1789 |
+
"pygments_lexer": "ipython3",
|
| 1790 |
+
"version": "3.12.3"
|
| 1791 |
+
}
|
| 1792 |
+
},
|
| 1793 |
+
"nbformat": 4,
|
| 1794 |
+
"nbformat_minor": 5
|
| 1795 |
+
}
|
Crop_recommendation.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
Dockerfile
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Python 3.9 as the base image
|
| 2 |
+
FROM python:3.9
|
| 3 |
+
|
| 4 |
+
# Set the working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Copy all project files
|
| 8 |
+
COPY . /app
|
| 9 |
+
|
| 10 |
+
# Install dependencies
|
| 11 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
+
|
| 13 |
+
# Expose the port Flask runs on
|
| 14 |
+
EXPOSE 7860
|
| 15 |
+
|
| 16 |
+
# Start Flask app using Gunicorn
|
| 17 |
+
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]
|
README.md
CHANGED
|
@@ -1,10 +1,32 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
|
|
|
| 8 |
---
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: AgroAssist
|
| 3 |
+
emoji: 🌾
|
| 4 |
+
colorFrom: green
|
| 5 |
+
colorTo: yellow
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
+
short_description: A smart crop recommendation system using machine learning
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# AgroAssist - Crop Recommendation System
|
| 12 |
+
|
| 13 |
+
A smart crop recommendation system that helps farmers choose the best crops based on soil conditions and environmental factors.
|
| 14 |
+
|
| 15 |
+
## Features
|
| 16 |
+
- AI-powered crop recommendations
|
| 17 |
+
- Soil analysis (NPK values)
|
| 18 |
+
- Climate assessment
|
| 19 |
+
- 22+ crop varieties supported
|
| 20 |
+
- Interactive data visualization
|
| 21 |
+
|
| 22 |
+
## Technical Stack
|
| 23 |
+
- Flask
|
| 24 |
+
- Scikit-learn
|
| 25 |
+
- NumPy
|
| 26 |
+
- Pandas
|
| 27 |
+
- Bootstrap
|
| 28 |
+
- PowerBI integration
|
| 29 |
+
|
| 30 |
+
## Directory Structure
|
| 31 |
+
|
| 32 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from flask import Flask, render_template, request
|
| 2 |
+
import numpy as np
|
| 3 |
+
import pandas as pd
|
| 4 |
+
import pickle
|
| 5 |
+
import os
|
| 6 |
+
from config import IMAGE_BASE_URL
|
| 7 |
+
from image_utils import get_base64_images
|
| 8 |
+
|
| 9 |
+
app = Flask(__name__)
|
| 10 |
+
|
| 11 |
+
# Load images once at startup
|
| 12 |
+
IMAGES = get_base64_images()
|
| 13 |
+
|
| 14 |
+
# Add this function
|
| 15 |
+
@app.context_processor
|
| 16 |
+
def utility_processor():
|
| 17 |
+
def get_image_url(path):
|
| 18 |
+
return IMAGE_BASE_URL + path
|
| 19 |
+
return dict(get_image_url=get_image_url, images=IMAGES)
|
| 20 |
+
|
| 21 |
+
# Update model loading with error handling
|
| 22 |
+
try:
|
| 23 |
+
model = pickle.load(open('model.pkl', 'rb'))
|
| 24 |
+
sc = pickle.load(open('standscaler.pkl', 'rb'))
|
| 25 |
+
ms = pickle.load(open('minmaxscaler.pkl', 'rb'))
|
| 26 |
+
except Exception as e:
|
| 27 |
+
print(f"Error loading models: {e}")
|
| 28 |
+
# Provide default/dummy models if loading fails
|
| 29 |
+
from sklearn.ensemble import RandomForestClassifier
|
| 30 |
+
model = RandomForestClassifier()
|
| 31 |
+
from sklearn.preprocessing import StandardScaler, MinMaxScaler
|
| 32 |
+
sc = StandardScaler()
|
| 33 |
+
ms = MinMaxScaler()
|
| 34 |
+
|
| 35 |
+
# Define routes
|
| 36 |
+
@app.route('/')
|
| 37 |
+
def home():
|
| 38 |
+
return render_template('home.html')
|
| 39 |
+
|
| 40 |
+
@app.route('/info')
|
| 41 |
+
def info():
|
| 42 |
+
return render_template('info.html')
|
| 43 |
+
|
| 44 |
+
@app.route('/recommendation', methods=['GET', 'POST'])
|
| 45 |
+
def recommendation():
|
| 46 |
+
result = None
|
| 47 |
+
N = P = K = temp = humidity = ph = rainfall = None
|
| 48 |
+
|
| 49 |
+
if request.method == 'POST':
|
| 50 |
+
try:
|
| 51 |
+
N = float(request.form['Nitrogen'])
|
| 52 |
+
P = float(request.form['Phosporus'])
|
| 53 |
+
K = float(request.form['Potassium'])
|
| 54 |
+
temp = float(request.form['Temperature'])
|
| 55 |
+
humidity = float(request.form['Humidity'])
|
| 56 |
+
ph = float(request.form['Ph'])
|
| 57 |
+
rainfall = float(request.form['Rainfall'])
|
| 58 |
+
|
| 59 |
+
feature_list = [N, P, K, temp, humidity, ph, rainfall]
|
| 60 |
+
single_pred = np.array(feature_list).reshape(1, -1)
|
| 61 |
+
|
| 62 |
+
scaled_features = ms.transform(single_pred)
|
| 63 |
+
final_features = sc.transform(scaled_features)
|
| 64 |
+
prediction = model.predict(final_features)
|
| 65 |
+
|
| 66 |
+
crop_dict = {1: "Rice", 2: "Maize", 3: "Jute", 4: "Cotton", 5: "Coconut", 6: "Papaya", 7: "Orange",
|
| 67 |
+
8: "Apple", 9: "Muskmelon", 10: "Watermelon", 11: "Grapes", 12: "Mango", 13: "Banana",
|
| 68 |
+
14: "Pomegranate", 15: "Lentil", 16: "Blackgram", 17: "Mungbean", 18: "Mothbeans",
|
| 69 |
+
19: "Pigeonpeas", 20: "Kidneybeans", 21: "Chickpea", 22: "Coffee"}
|
| 70 |
+
|
| 71 |
+
if prediction[0] in crop_dict:
|
| 72 |
+
crop = crop_dict[prediction[0]]
|
| 73 |
+
result = "{} is the best crop to be cultivated right there".format(crop)
|
| 74 |
+
else:
|
| 75 |
+
result = "Sorry, we could not determine the best crop to be cultivated with the provided data."
|
| 76 |
+
except Exception as e:
|
| 77 |
+
result = f"An error occurred: {str(e)}"
|
| 78 |
+
|
| 79 |
+
return render_template('recommendation.html', result=result, N=N, P=P, K=K, temp=temp, humidity=humidity, ph=ph, rainfall=rainfall)
|
| 80 |
+
|
| 81 |
+
if __name__ == "__main__":
|
| 82 |
+
app.run(host="0.0.0.0", port=7860)
|
config.py
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Base URL for images
|
| 2 |
+
IMAGE_BASE_URL = "https://raw.githubusercontent.com/YOUR_USERNAME/YOUR_REPO/main/static/images/"
|
crop22_powerbi.pbix
ADDED
|
Binary file (194 kB). View file
|
|
|
crop2_powerbi.pbix
ADDED
|
Binary file (193 kB). View file
|
|
|
git
ADDED
|
File without changes
|
image_utils.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import base64
|
| 2 |
+
import os
|
| 3 |
+
|
| 4 |
+
def get_base64_images():
|
| 5 |
+
images = {}
|
| 6 |
+
static_dir = 'static/images'
|
| 7 |
+
|
| 8 |
+
# Logo and banner
|
| 9 |
+
with open(os.path.join(static_dir, 'logo.png'), 'rb') as f:
|
| 10 |
+
images['logo'] = base64.b64encode(f.read()).decode()
|
| 11 |
+
|
| 12 |
+
with open(os.path.join(static_dir, 'banner.png'), 'rb') as f:
|
| 13 |
+
images['banner'] = base64.b64encode(f.read()).decode()
|
| 14 |
+
|
| 15 |
+
# Crop images
|
| 16 |
+
crops_dir = os.path.join(static_dir, 'crops')
|
| 17 |
+
for image_file in os.listdir(crops_dir):
|
| 18 |
+
if image_file.endswith(('.jpg', '.png')):
|
| 19 |
+
with open(os.path.join(crops_dir, image_file), 'rb') as f:
|
| 20 |
+
images[image_file.split('.')[0]] = base64.b64encode(f.read()).decode()
|
| 21 |
+
|
| 22 |
+
return images
|
minmaxscaler.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:65e53de7d1cfb340ff19db259755347561272c4c4fd9837eee5b19b259f90159
|
| 3 |
+
size 901
|
model.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:16a4730e9ab6813c3ff2ba81c61b53d85e38f0aad0823f93a87cd41bd4fa39b7
|
| 3 |
+
size 3641102
|
requirements.txt
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
flask==2.0.1
|
| 2 |
+
numpy==1.21.0
|
| 3 |
+
pandas==1.3.0
|
| 4 |
+
scikit-learn==0.24.2
|
| 5 |
+
gunicorn==20.1.0
|
| 6 |
+
requests
|
standscaler.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:034d859860b10c9e2f3f3fd06cadb7a274488a2fb90be8262c20b5351ebccf4f
|
| 3 |
+
size 617
|
static/apple.jpg
ADDED
|
Git LFS Details
|
static/bananan.jpg
ADDED
|
Git LFS Details
|
static/banner.png
ADDED
|
Git LFS Details
|
static/black.jpg
ADDED
|
Git LFS Details
|
static/chik.jpg
ADDED
|
Git LFS Details
|
static/coconut.jpg
ADDED
|
Git LFS Details
|
static/coffe.jpg
ADDED
|
Git LFS Details
|
static/cotton.jpg
ADDED
|
Git LFS Details
|
static/crop.png
ADDED
|
Git LFS Details
|
static/cropp.jpg
ADDED
|
Git LFS Details
|
static/grapes.jpg
ADDED
|
Git LFS Details
|
static/jute.jpg
ADDED
|
Git LFS Details
|
static/kidney.jpg
ADDED
|
Git LFS Details
|
static/lent.jpg
ADDED
|
Git LFS Details
|
static/logo.png
ADDED
|
Git LFS Details
|
static/maize.jpg
ADDED
|
Git LFS Details
|
static/mango.jpg
ADDED
|
Git LFS Details
|
static/moth.jpg
ADDED
|
Git LFS Details
|
static/mung.jpg
ADDED
|
Git LFS Details
|
static/muskmelon].jpg
ADDED
|
Git LFS Details
|
static/orange.jpg
ADDED
|
Git LFS Details
|
static/papaya.jpg
ADDED
|
Git LFS Details
|
static/peas.jpg
ADDED
|
Git LFS Details
|
static/pomo.jpg
ADDED
|
Git LFS Details
|
static/rice.jpg
ADDED
|
Git LFS Details
|
static/watermelon.jpg
ADDED
|
Git LFS Details
|
templates/home.html
ADDED
|
@@ -0,0 +1,812 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Crop Recommendation System</title>
|
| 7 |
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet">
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
|
| 9 |
+
|
| 10 |
+
<style>
|
| 11 |
+
/* Banner styling */
|
| 12 |
+
.banner {
|
| 13 |
+
background-color: #ffffff; /* Placeholder background color */
|
| 14 |
+
height: 85vh; /* 60% of viewport height */
|
| 15 |
+
width: 1500px;
|
| 16 |
+
border-radius: 10px; /* Rounded corners */
|
| 17 |
+
display: flex;
|
| 18 |
+
justify-content: center;
|
| 19 |
+
align-items: center;
|
| 20 |
+
margin: 20px auto; /* Centered with some margin */
|
| 21 |
+
max-width: 1500px; /* Maximum width for the banner */
|
| 22 |
+
box-shadow: 0 3px 15px rgba(255, 255, 255, 0.1); /* Optional shadow */
|
| 23 |
+
position: relative; /* Needed for absolute positioning of button */
|
| 24 |
+
}
|
| 25 |
+
.banner img {
|
| 26 |
+
max-width: 75%; /* Responsive image */n
|
| 27 |
+
max-height: 75%; /* Prevents overflow */
|
| 28 |
+
border-radius: 20px; /* Match the banner's rounded corners */
|
| 29 |
+
}
|
| 30 |
+
.predict-button {
|
| 31 |
+
position: absolute; /* Position relative to the banner */
|
| 32 |
+
left: 35%; /* Align to the left */
|
| 33 |
+
top: 70; /* Align vertically */
|
| 34 |
+
transform: translateY(-50%); /* Center the button vertically */
|
| 35 |
+
background-color: #003400; /* Dark green color */
|
| 36 |
+
color: rgb(255, 255, 255); /* Button text color */
|
| 37 |
+
border: none; /* Remove border */
|
| 38 |
+
text-decoration: none;
|
| 39 |
+
padding: 12px 35px; /* Button padding */
|
| 40 |
+
border-radius: 5px; /* Rounded corners */
|
| 41 |
+
font-size: 20px;
|
| 42 |
+
font-weight: 700;
|
| 43 |
+
}
|
| 44 |
+
.info-section {
|
| 45 |
+
padding: 20px;
|
| 46 |
+
background-color: #f8f9fa; /* Light grey background for the info section */
|
| 47 |
+
border-radius: 10px; /* Rounded corners */
|
| 48 |
+
margin: 100px auto; /* 100px margin */
|
| 49 |
+
max-width: 1200px; /* Maximum width for the info section */
|
| 50 |
+
}
|
| 51 |
+
.info-section h3 {
|
| 52 |
+
font-weight: 600; /* Bold heading */
|
| 53 |
+
margin-bottom: 15px; /* Spacing below the heading */
|
| 54 |
+
}
|
| 55 |
+
.info-section h4 {
|
| 56 |
+
font-weight: 500; /* Medium weight for subheading */
|
| 57 |
+
margin-top: 15px; /* Spacing above the subheading */
|
| 58 |
+
}
|
| 59 |
+
.info-section p {
|
| 60 |
+
margin-bottom: 15px; /* Spacing below paragraphs */
|
| 61 |
+
|
| 62 |
+
}
|
| 63 |
+
.crop-list {
|
| 64 |
+
max-height: 400px;
|
| 65 |
+
overflow-y: auto;
|
| 66 |
+
padding: 15px;
|
| 67 |
+
}
|
| 68 |
+
.crop-item {
|
| 69 |
+
display: flex;
|
| 70 |
+
align-items: center;
|
| 71 |
+
margin-bottom: 15px;
|
| 72 |
+
}
|
| 73 |
+
.crop-image {
|
| 74 |
+
display: block;
|
| 75 |
+
margin: 0 auto;
|
| 76 |
+
width: 260px;
|
| 77 |
+
height: 260px;
|
| 78 |
+
object-fit: cover;
|
| 79 |
+
border-radius: 9px;
|
| 80 |
+
}
|
| 81 |
+
.nav-item {
|
| 82 |
+
font-weight: 500;
|
| 83 |
+
}
|
| 84 |
+
.navbar {
|
| 85 |
+
background-color: #0d1025;
|
| 86 |
+
padding: 0.5rem 1rem;
|
| 87 |
+
position: sticky;
|
| 88 |
+
top: 0;
|
| 89 |
+
z-index: 1000;
|
| 90 |
+
min-height: 65px;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
.navbar-brand {
|
| 94 |
+
display: flex;
|
| 95 |
+
align-items: center;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
.logo-img {
|
| 99 |
+
width: 50px;
|
| 100 |
+
height: 50px;
|
| 101 |
+
transition: transform 0.3s;
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
.navbar-toggler {
|
| 105 |
+
border: 1px solid rgba(255,255,255,0.1);
|
| 106 |
+
padding: 0.25rem 0.75rem;
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
.navbar-toggler:focus {
|
| 110 |
+
box-shadow: none;
|
| 111 |
+
outline: none;
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
.navbar-collapse {
|
| 115 |
+
flex-grow: 0;
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
.navbar-nav {
|
| 119 |
+
align-items: center;
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
.nav-link {
|
| 123 |
+
color: white !important;
|
| 124 |
+
padding: 0.5rem 1rem !important;
|
| 125 |
+
margin: 0 0.2rem;
|
| 126 |
+
border-radius: 5px;
|
| 127 |
+
transition: all 0.3s ease;
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
.nav-link:hover {
|
| 131 |
+
background-color: rgba(255, 255, 255, 0.1);
|
| 132 |
+
transform: translateY(-2px);
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
.brand-text {
|
| 136 |
+
color: #737373;
|
| 137 |
+
margin-left: 1rem;
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
/* Fix predict button size */
|
| 141 |
+
.predict-button {
|
| 142 |
+
position: absolute;
|
| 143 |
+
left: 31%;
|
| 144 |
+
transform: translateX(-50%);
|
| 145 |
+
bottom: 25%;
|
| 146 |
+
white-space: nowrap;
|
| 147 |
+
padding: 12px 35px;
|
| 148 |
+
font-size: 18px;
|
| 149 |
+
background-color: #003400;
|
| 150 |
+
color: white;
|
| 151 |
+
border: none;
|
| 152 |
+
border-radius: 5px;
|
| 153 |
+
transition: all 0.3s ease;
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
.predict-button:hover {
|
| 157 |
+
transform: translateX(-50%) translateY(-2px);
|
| 158 |
+
box-shadow: 0 4px 12px rgba(0,0,0,0.2);
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
@media (max-width: 991px) {
|
| 162 |
+
.navbar-collapse {
|
| 163 |
+
background-color: #0d1025;
|
| 164 |
+
padding: 1rem;
|
| 165 |
+
border-radius: 0 0 10px 10px;
|
| 166 |
+
position: absolute;
|
| 167 |
+
top: 100%;
|
| 168 |
+
left: 0;
|
| 169 |
+
right: 0;
|
| 170 |
+
z-index: 1000;
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
.nav-link {
|
| 174 |
+
text-align: center;
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
.brand-text {
|
| 178 |
+
margin: 0.5rem 0;
|
| 179 |
+
text-align: center;
|
| 180 |
+
display: block;
|
| 181 |
+
}
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
/* Responsive Banner Styles */
|
| 185 |
+
.banner {
|
| 186 |
+
width: 100%;
|
| 187 |
+
max-width: 1500px;
|
| 188 |
+
height: auto;
|
| 189 |
+
min-height: 60vh;
|
| 190 |
+
margin: 1rem auto;
|
| 191 |
+
padding: 1rem;
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
/* Responsive Card Grid */
|
| 195 |
+
.crop-image {
|
| 196 |
+
width: 100%;
|
| 197 |
+
height: 200px;
|
| 198 |
+
object-fit: cover;
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
.card {
|
| 202 |
+
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
| 203 |
+
margin-bottom: 1rem;
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
.card:hover {
|
| 207 |
+
transform: translateY(-5px);
|
| 208 |
+
box-shadow: 0 5px 15px rgba(0,0,0,0.3);
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
/* Media Queries */
|
| 212 |
+
@media (max-width: 768px) {
|
| 213 |
+
.banner {
|
| 214 |
+
height: 50vh;
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
.predict-button {
|
| 218 |
+
font-size: 16px;
|
| 219 |
+
padding: 8px 20px;
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
.logo-img {
|
| 223 |
+
width: 50px;
|
| 224 |
+
height: 50px;
|
| 225 |
+
}
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
@media (max-width: 576px) {
|
| 229 |
+
.banner {
|
| 230 |
+
height: 40vh;
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
.info-section {
|
| 234 |
+
padding: 1rem;
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
.crop-image {
|
| 238 |
+
height: 150px;
|
| 239 |
+
}
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
/* Card hover effects */
|
| 243 |
+
.card {
|
| 244 |
+
border: none;
|
| 245 |
+
box-shadow: 0 2px 15px rgba(0,0,0,0.1);
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
.card:hover {
|
| 249 |
+
transform: translateY(-5px);
|
| 250 |
+
box-shadow: 0 5px 20px rgba(0,0,0,0.2);
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
/* Info section improvements */
|
| 254 |
+
.info-section {
|
| 255 |
+
background: linear-gradient(145deg, #ffffff, #f8f9fa);
|
| 256 |
+
box-shadow: 0 4px 15px rgba(0,0,0,0.05);
|
| 257 |
+
}
|
| 258 |
+
|
| 259 |
+
.info-section ul li {
|
| 260 |
+
margin-bottom: 1rem;
|
| 261 |
+
padding-left: 1rem;
|
| 262 |
+
position: relative;
|
| 263 |
+
}
|
| 264 |
+
|
| 265 |
+
.info-section ul li::before {
|
| 266 |
+
content: "•";
|
| 267 |
+
color: #003400;
|
| 268 |
+
font-weight: bold;
|
| 269 |
+
position: absolute;
|
| 270 |
+
left: -1rem;
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
/* Crop list improvements */
|
| 274 |
+
.crop-list {
|
| 275 |
+
scrollbar-width: thin;
|
| 276 |
+
scrollbar-color: #003400 #f0f0f0;
|
| 277 |
+
}
|
| 278 |
+
|
| 279 |
+
.crop-list::-webkit-scrollbar {
|
| 280 |
+
width: 8px;
|
| 281 |
+
}
|
| 282 |
+
|
| 283 |
+
.crop-list::-webkit-scrollbar-track {
|
| 284 |
+
background: #f0f0f0;
|
| 285 |
+
border-radius: 10px;
|
| 286 |
+
}
|
| 287 |
+
|
| 288 |
+
.crop-list::-webkit-scrollbar-thumb {
|
| 289 |
+
background-color: #003400;
|
| 290 |
+
border-radius: 10px;
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
/* Footer improvements */
|
| 294 |
+
footer {
|
| 295 |
+
background: linear-gradient(to right, #0d1025, #1a1a2e);
|
| 296 |
+
padding: 2rem 0;
|
| 297 |
+
}
|
| 298 |
+
|
| 299 |
+
footer p {
|
| 300 |
+
margin: 0.5rem 0;
|
| 301 |
+
opacity: 0.9;
|
| 302 |
+
}
|
| 303 |
+
|
| 304 |
+
.flow-section {
|
| 305 |
+
padding: 3rem 0;
|
| 306 |
+
}
|
| 307 |
+
|
| 308 |
+
.flow-card {
|
| 309 |
+
background: white;
|
| 310 |
+
padding: 2rem;
|
| 311 |
+
border-radius: 15px;
|
| 312 |
+
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
|
| 313 |
+
text-align: center;
|
| 314 |
+
transition: all 0.3s ease;
|
| 315 |
+
height: 100%;
|
| 316 |
+
position: relative;
|
| 317 |
+
}
|
| 318 |
+
|
| 319 |
+
.flow-card:hover {
|
| 320 |
+
transform: translateY(-10px);
|
| 321 |
+
box-shadow: 0 8px 25px rgba(0,0,0,0.2);
|
| 322 |
+
}
|
| 323 |
+
|
| 324 |
+
.flow-card::after {
|
| 325 |
+
content: "→";
|
| 326 |
+
position: absolute;
|
| 327 |
+
right: -25px;
|
| 328 |
+
top: 50%;
|
| 329 |
+
transform: translateY(-50%);
|
| 330 |
+
font-size: 2rem;
|
| 331 |
+
color: #003400;
|
| 332 |
+
font-weight: bold;
|
| 333 |
+
}
|
| 334 |
+
|
| 335 |
+
.flow-card:last-child::after {
|
| 336 |
+
display: none;
|
| 337 |
+
}
|
| 338 |
+
|
| 339 |
+
.flow-icon {
|
| 340 |
+
width: 80px;
|
| 341 |
+
height: 80px;
|
| 342 |
+
background: #003400;
|
| 343 |
+
border-radius: 50%;
|
| 344 |
+
display: flex;
|
| 345 |
+
align-items: center;
|
| 346 |
+
justify-content: center;
|
| 347 |
+
margin: 0 auto 1.5rem;
|
| 348 |
+
}
|
| 349 |
+
|
| 350 |
+
.flow-icon i {
|
| 351 |
+
font-size: 2rem;
|
| 352 |
+
color: white;
|
| 353 |
+
}
|
| 354 |
+
|
| 355 |
+
.flow-card h4 {
|
| 356 |
+
color: #003400;
|
| 357 |
+
margin-bottom: 1rem;
|
| 358 |
+
}
|
| 359 |
+
|
| 360 |
+
.flow-card p {
|
| 361 |
+
color: #666;
|
| 362 |
+
font-size: 0.95rem;
|
| 363 |
+
line-height: 1.5;
|
| 364 |
+
}
|
| 365 |
+
|
| 366 |
+
@media (max-width: 768px) {
|
| 367 |
+
.flow-card::after {
|
| 368 |
+
content: "↓";
|
| 369 |
+
right: 50%;
|
| 370 |
+
bottom: -25px;
|
| 371 |
+
top: auto;
|
| 372 |
+
transform: translateX(50%);
|
| 373 |
+
}
|
| 374 |
+
|
| 375 |
+
.flow-card {
|
| 376 |
+
margin-bottom: 2rem;
|
| 377 |
+
}
|
| 378 |
+
}
|
| 379 |
+
|
| 380 |
+
/* Add Features Section */
|
| 381 |
+
.features-section {
|
| 382 |
+
padding: 3rem 0;
|
| 383 |
+
}
|
| 384 |
+
|
| 385 |
+
.feature-card {
|
| 386 |
+
background: white;
|
| 387 |
+
border-radius: 15px;
|
| 388 |
+
padding: 2rem;
|
| 389 |
+
height: 100%;
|
| 390 |
+
position: relative;
|
| 391 |
+
overflow: hidden;
|
| 392 |
+
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
|
| 393 |
+
transition: all 0.3s ease;
|
| 394 |
+
}
|
| 395 |
+
|
| 396 |
+
.feature-card:hover {
|
| 397 |
+
transform: translateY(-10px);
|
| 398 |
+
box-shadow: 0 8px 25px rgba(0,0,0,0.2);
|
| 399 |
+
}
|
| 400 |
+
|
| 401 |
+
.feature-icon {
|
| 402 |
+
width: 70px;
|
| 403 |
+
height: 70px;
|
| 404 |
+
background: linear-gradient(135deg, #003400, #006400);
|
| 405 |
+
border-radius: 50%;
|
| 406 |
+
display: flex;
|
| 407 |
+
align-items: center;
|
| 408 |
+
justify-content: center;
|
| 409 |
+
margin-bottom: 1.5rem;
|
| 410 |
+
transition: all 0.3s ease;
|
| 411 |
+
}
|
| 412 |
+
|
| 413 |
+
.feature-card:hover .feature-icon {
|
| 414 |
+
transform: scale(1.1) rotate(5deg);
|
| 415 |
+
}
|
| 416 |
+
|
| 417 |
+
.feature-icon i {
|
| 418 |
+
font-size: 1.8rem;
|
| 419 |
+
color: white;
|
| 420 |
+
}
|
| 421 |
+
|
| 422 |
+
.feature-content h4 {
|
| 423 |
+
color: #003400;
|
| 424 |
+
margin-bottom: 1rem;
|
| 425 |
+
font-weight: 600;
|
| 426 |
+
}
|
| 427 |
+
|
| 428 |
+
.feature-content p {
|
| 429 |
+
color: #666;
|
| 430 |
+
font-size: 0.95rem;
|
| 431 |
+
line-height: 1.5;
|
| 432 |
+
}
|
| 433 |
+
|
| 434 |
+
.feature-hover {
|
| 435 |
+
position: absolute;
|
| 436 |
+
bottom: -40px;
|
| 437 |
+
left: 0;
|
| 438 |
+
right: 0;
|
| 439 |
+
background: linear-gradient(135deg, #003400, #006400);
|
| 440 |
+
padding: 0.5rem;
|
| 441 |
+
text-align: center;
|
| 442 |
+
transition: all 0.3s ease;
|
| 443 |
+
opacity: 0;
|
| 444 |
+
}
|
| 445 |
+
|
| 446 |
+
.feature-card:hover .feature-hover {
|
| 447 |
+
bottom: 0;
|
| 448 |
+
opacity: 1;
|
| 449 |
+
}
|
| 450 |
+
|
| 451 |
+
.hover-text {
|
| 452 |
+
color: white;
|
| 453 |
+
font-size: 0.9rem;
|
| 454 |
+
font-weight: 500;
|
| 455 |
+
}
|
| 456 |
+
|
| 457 |
+
@media (max-width: 768px) {
|
| 458 |
+
.feature-card {
|
| 459 |
+
margin-bottom: 2rem;
|
| 460 |
+
}
|
| 461 |
+
}
|
| 462 |
+
</style>
|
| 463 |
+
</head>
|
| 464 |
+
<body>
|
| 465 |
+
<nav class="navbar navbar-expand-lg navbar-dark">
|
| 466 |
+
<div class="container-fluid">
|
| 467 |
+
<a href="/" class="navbar-brand">
|
| 468 |
+
<img src="data:image/png;base64,{{ images['logo'] }}" alt="AgroAssist Logo" class="logo-img">
|
| 469 |
+
</a>
|
| 470 |
+
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent">
|
| 471 |
+
<span class="navbar-toggler-icon"></span>
|
| 472 |
+
</button>
|
| 473 |
+
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
| 474 |
+
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
| 475 |
+
<li class="nav-item">
|
| 476 |
+
<a class="nav-link" href="/"><i class="fas fa-house"></i> Home</a>
|
| 477 |
+
</li>
|
| 478 |
+
<li class="nav-item">
|
| 479 |
+
<a class="nav-link" href="/recommendation"><i class="fas fa-seedling"></i> Recommend</a>
|
| 480 |
+
</li>
|
| 481 |
+
<li class="nav-item">
|
| 482 |
+
<a class="nav-link" href="/info"><i class="fas fa-chart-bar"></i> Statistics</a>
|
| 483 |
+
</li>
|
| 484 |
+
</ul>
|
| 485 |
+
<span class="navbar-text brand-text">AgroAssist</span>
|
| 486 |
+
</div>
|
| 487 |
+
</div>
|
| 488 |
+
</nav>
|
| 489 |
+
|
| 490 |
+
|
| 491 |
+
<!-- Banner Section -->
|
| 492 |
+
<div class="banner">
|
| 493 |
+
<img src="data:image/png;base64,{{ images['banner'] }}" alt="Banner Image">
|
| 494 |
+
<a href="/recommendation" class="predict-button">Click to Predict →</a> <!-- Button added here -->
|
| 495 |
+
</div>
|
| 496 |
+
|
| 497 |
+
<!-- Information Section -->
|
| 498 |
+
|
| 499 |
+
|
| 500 |
+
<!-- Add this after the info-section div -->
|
| 501 |
+
<div class="container flow-section my-5">
|
| 502 |
+
<h3 class="text-center mb-5">How AgroAssist Works</h3>
|
| 503 |
+
<div class="row">
|
| 504 |
+
<div class="col-md-4 mb-4">
|
| 505 |
+
<div class="flow-card">
|
| 506 |
+
<div class="flow-icon">
|
| 507 |
+
<i class="fas fa-flask"></i>
|
| 508 |
+
</div>
|
| 509 |
+
<h4>1. Soil Analysis</h4>
|
| 510 |
+
<p>Input your soil's NPK values and we'll analyze the nutrient content to determine soil health.</p>
|
| 511 |
+
</div>
|
| 512 |
+
</div>
|
| 513 |
+
<div class="col-md-4 mb-4">
|
| 514 |
+
<div class="flow-card">
|
| 515 |
+
<div class="flow-icon">
|
| 516 |
+
<i class="fas fa-cloud-sun"></i>
|
| 517 |
+
</div>
|
| 518 |
+
<h4>2. Climate Assessment</h4>
|
| 519 |
+
<p>We evaluate temperature, humidity, and rainfall patterns to assess environmental conditions.</p>
|
| 520 |
+
</div>
|
| 521 |
+
</div>
|
| 522 |
+
<div class="col-md-4 mb-4">
|
| 523 |
+
<div class="flow-card">
|
| 524 |
+
<div class="flow-icon">
|
| 525 |
+
<i class="fas fa-leaf"></i>
|
| 526 |
+
</div>
|
| 527 |
+
<h4>3. Smart Recommendation</h4>
|
| 528 |
+
<p>Our AI model processes the data to suggest the most suitable crops for your farm.</p>
|
| 529 |
+
</div>
|
| 530 |
+
</div>
|
| 531 |
+
</div>
|
| 532 |
+
</div>
|
| 533 |
+
|
| 534 |
+
<!-- Add Features Section -->
|
| 535 |
+
<div class="container features-section my-5">
|
| 536 |
+
<h3 class="text-center mb-5">Key Features</h3>
|
| 537 |
+
<div class="row">
|
| 538 |
+
<div class="col-md-4 mb-4">
|
| 539 |
+
<div class="feature-card">
|
| 540 |
+
<div class="feature-icon">
|
| 541 |
+
<i class="fas fa-robot"></i>
|
| 542 |
+
</div>
|
| 543 |
+
<div class="feature-content">
|
| 544 |
+
<h4>AI-Powered Analysis</h4>
|
| 545 |
+
<p>Advanced machine learning algorithms analyze your farm's conditions to provide accurate crop recommendations.</p>
|
| 546 |
+
</div>
|
| 547 |
+
<div class="feature-hover">
|
| 548 |
+
<span class="hover-text">Uses Random Forest Algorithm</span>
|
| 549 |
+
</div>
|
| 550 |
+
</div>
|
| 551 |
+
</div>
|
| 552 |
+
<div class="col-md-4 mb-4">
|
| 553 |
+
<div class="feature-card">
|
| 554 |
+
<div class="feature-icon">
|
| 555 |
+
<i class="fas fa-chart-line"></i>
|
| 556 |
+
</div>
|
| 557 |
+
<div class="feature-content">
|
| 558 |
+
<h4>Data Visualization</h4>
|
| 559 |
+
<p>Interactive charts and graphs help you understand crop requirements and environmental conditions.</p>
|
| 560 |
+
</div>
|
| 561 |
+
<div class="feature-hover">
|
| 562 |
+
<span class="hover-text">PowerBI Integration</span>
|
| 563 |
+
</div>
|
| 564 |
+
</div>
|
| 565 |
+
</div>
|
| 566 |
+
<div class="col-md-4 mb-4">
|
| 567 |
+
<div class="feature-card">
|
| 568 |
+
<div class="feature-icon">
|
| 569 |
+
<i class="fas fa-mobile-alt"></i>
|
| 570 |
+
</div>
|
| 571 |
+
<div class="feature-content">
|
| 572 |
+
<h4>Mobile Responsive</h4>
|
| 573 |
+
<p>Access the system from any device - desktop, tablet, or mobile phone with full functionality.</p>
|
| 574 |
+
</div>
|
| 575 |
+
<div class="feature-hover">
|
| 576 |
+
<span class="hover-text">Cross-Platform Compatible</span>
|
| 577 |
+
</div>
|
| 578 |
+
</div>
|
| 579 |
+
</div>
|
| 580 |
+
<div class="col-md-4 mb-4">
|
| 581 |
+
<div class="feature-card">
|
| 582 |
+
<div class="feature-icon">
|
| 583 |
+
<i class="fas fa-database"></i>
|
| 584 |
+
</div>
|
| 585 |
+
<div class="feature-content">
|
| 586 |
+
<h4>Comprehensive Database</h4>
|
| 587 |
+
<p>Extensive database of crops with their optimal growing conditions and requirements.</p>
|
| 588 |
+
</div>
|
| 589 |
+
<div class="feature-hover">
|
| 590 |
+
<span class="hover-text">20+ Crop Varieties</span>
|
| 591 |
+
</div>
|
| 592 |
+
</div>
|
| 593 |
+
</div>
|
| 594 |
+
<div class="col-md-4 mb-4">
|
| 595 |
+
<div class="feature-card">
|
| 596 |
+
<div class="feature-icon">
|
| 597 |
+
<i class="fas fa-cloud-sun-rain"></i>
|
| 598 |
+
</div>
|
| 599 |
+
<div class="feature-content">
|
| 600 |
+
<h4>Climate Analysis</h4>
|
| 601 |
+
<p>Considers temperature, humidity, and rainfall patterns for optimal crop selection.</p>
|
| 602 |
+
</div>
|
| 603 |
+
<div class="feature-hover">
|
| 604 |
+
<span class="hover-text">Real-time Weather Data</span>
|
| 605 |
+
</div>
|
| 606 |
+
</div>
|
| 607 |
+
</div>
|
| 608 |
+
<div class="col-md-4 mb-4">
|
| 609 |
+
<div class="feature-card">
|
| 610 |
+
<div class="feature-icon">
|
| 611 |
+
<i class="fas fa-leaf"></i>
|
| 612 |
+
</div>
|
| 613 |
+
<div class="feature-content">
|
| 614 |
+
<h4>Soil Health Analysis</h4>
|
| 615 |
+
<p>Evaluates soil nutrients (NPK) and pH levels to ensure optimal growing conditions.</p>
|
| 616 |
+
</div>
|
| 617 |
+
<div class="feature-hover">
|
| 618 |
+
<span class="hover-text">Detailed Soil Reports</span>
|
| 619 |
+
</div>
|
| 620 |
+
</div>
|
| 621 |
+
</div>
|
| 622 |
+
</div>
|
| 623 |
+
</div>
|
| 624 |
+
|
| 625 |
+
<!-- Crop Scrolling List -->
|
| 626 |
+
<h3 class="text-center mt-5">Our Crops</h3>
|
| 627 |
+
<div class="container">
|
| 628 |
+
<div class="row justify-content-center">
|
| 629 |
+
<div class="col-md-8 crop-list mx-auto">
|
| 630 |
+
<div class="row">
|
| 631 |
+
<div class="col-6 col-md-4 mb-4">
|
| 632 |
+
<div class="card">
|
| 633 |
+
<img src="data:image/jpeg;base64,{{ images['rice'] }}" class="card-img-top crop-image" alt="Rice">
|
| 634 |
+
<div class="card-body text-center">
|
| 635 |
+
<h5 class="card-title">Rice</h5>
|
| 636 |
+
</div>
|
| 637 |
+
</div>
|
| 638 |
+
</div>
|
| 639 |
+
<div class="col-6 col-md-4 mb-4">
|
| 640 |
+
<div class="card">
|
| 641 |
+
<img src="data:image/jpeg;base64,{{ images['cotton'] }}" class="card-img-top crop-image" alt="Cotton">
|
| 642 |
+
<div class="card-body text-center">
|
| 643 |
+
<h5 class="card-title">Cotton</h5>
|
| 644 |
+
</div>
|
| 645 |
+
</div>
|
| 646 |
+
</div>
|
| 647 |
+
<div class="col-6 col-md-4 mb-4">
|
| 648 |
+
<div class="card">
|
| 649 |
+
<img src="data:image/jpeg;base64,{{ images['jute'] }}" class="card-img-top crop-image" alt="Jute">
|
| 650 |
+
<div class="card-body text-center">
|
| 651 |
+
<h5 class="card-title">Jute</h5>
|
| 652 |
+
</div>
|
| 653 |
+
</div>
|
| 654 |
+
</div>
|
| 655 |
+
<div class="col-6 col-md-4 mb-4">
|
| 656 |
+
<div class="card">
|
| 657 |
+
<img src="data:image/jpeg;base64,{{ images['papaya'] }}" class="card-img-top crop-image" alt="Papaya">
|
| 658 |
+
<div class="card-body text-center">
|
| 659 |
+
<h5 class="card-title">Papaya</h5>
|
| 660 |
+
</div>
|
| 661 |
+
</div>
|
| 662 |
+
</div>
|
| 663 |
+
<div class="col-6 col-md-4 mb-4">
|
| 664 |
+
<div class="card">
|
| 665 |
+
<img src="data:image/jpeg;base64,{{ images['maize'] }}" class="card-img-top crop-image" alt="Maize">
|
| 666 |
+
<div class="card-body text-center">
|
| 667 |
+
<h5 class="card-title">Maize</h5>
|
| 668 |
+
</div>
|
| 669 |
+
</div>
|
| 670 |
+
</div>
|
| 671 |
+
<div class="col-6 col-md-4 mb-4">
|
| 672 |
+
<div class="card">
|
| 673 |
+
<img src="data:image/jpeg;base64,{{ images['moth'] }}" class="card-img-top crop-image" alt="Moth Bean">
|
| 674 |
+
<div class="card-body text-center">
|
| 675 |
+
<h5 class="card-title">Moth Bean</h5>
|
| 676 |
+
</div>
|
| 677 |
+
</div>
|
| 678 |
+
</div>
|
| 679 |
+
<div class="col-6 col-md-4 mb-4">
|
| 680 |
+
<div class="card">
|
| 681 |
+
<img src="data:image/jpeg;base64,{{ images['black'] }}" class="card-img-top crop-image" alt="Black Gram">
|
| 682 |
+
<div class="card-body text-center">
|
| 683 |
+
<h5 class="card-title">Black Gram</h5>
|
| 684 |
+
</div>
|
| 685 |
+
</div>
|
| 686 |
+
</div>
|
| 687 |
+
<div class="col-6 col-md-4 mb-4">
|
| 688 |
+
<div class="card">
|
| 689 |
+
<img src="data:image/jpeg;base64,{{ images['kidney'] }}" class="card-img-top crop-image" alt="Kidney Beans">
|
| 690 |
+
<div class="card-body text-center">
|
| 691 |
+
<h5 class="card-title">Kidney Beans</h5>
|
| 692 |
+
</div>
|
| 693 |
+
</div>
|
| 694 |
+
</div>
|
| 695 |
+
<div class="col-6 col-md-4 mb-4">
|
| 696 |
+
<div class="card">
|
| 697 |
+
<img src="data:image/jpeg;base64,{{ images['peas'] }}" class="card-img-top crop-image" alt="Pigeon Peas">
|
| 698 |
+
<div class="card-body text-center">
|
| 699 |
+
<h5 class="card-title">Pigeon Peas</h5>
|
| 700 |
+
</div>
|
| 701 |
+
</div>
|
| 702 |
+
</div>
|
| 703 |
+
<div class="col-6 col-md-4 mb-4">
|
| 704 |
+
<div class="card">
|
| 705 |
+
<img src="data:image/jpeg;base64,{{ images['pomo'] }}" class="card-img-top crop-image" alt="Pomegranate">
|
| 706 |
+
<div class="card-body text-center">
|
| 707 |
+
<h5 class="card-title">Pomegranate</h5>
|
| 708 |
+
</div>
|
| 709 |
+
</div>
|
| 710 |
+
</div>
|
| 711 |
+
<div class="col-6 col-md-4 mb-4">
|
| 712 |
+
<div class="card">
|
| 713 |
+
<img src="data:image/jpeg;base64,{{ images['coffe'] }}" class="card-img-top crop-image" alt="Coffee">
|
| 714 |
+
<div class="card-body text-center">
|
| 715 |
+
<h5 class="card-title">Coffee</h5>
|
| 716 |
+
</div>
|
| 717 |
+
</div>
|
| 718 |
+
</div>
|
| 719 |
+
<div class="col-6 col-md-4 mb-4">
|
| 720 |
+
<div class="card">
|
| 721 |
+
<img src="data:image/jpeg;base64,{{ images['muskmelon'] }}" class="card-img-top crop-image" alt="Muskmelon">
|
| 722 |
+
<div class="card-body text-center">
|
| 723 |
+
<h5 class="card-title">Muskmelon</h5>
|
| 724 |
+
</div>
|
| 725 |
+
</div>
|
| 726 |
+
</div>
|
| 727 |
+
<div class="col-6 col-md-4 mb-4">
|
| 728 |
+
<div class="card">
|
| 729 |
+
<img src="data:image/jpeg;base64,{{ images['watermelon'] }}" class="card-img-top crop-image" alt="Watermelon">
|
| 730 |
+
<div class="card-body text-center">
|
| 731 |
+
<h5 class="card-title">Watermelon</h5>
|
| 732 |
+
</div>
|
| 733 |
+
</div>
|
| 734 |
+
</div>
|
| 735 |
+
<div class="col-6 col-md-4 mb-4">
|
| 736 |
+
<div class="card">
|
| 737 |
+
<img src="data:image/jpeg;base64,{{ images['chik'] }}" class="card-img-top crop-image" alt="Chickpea">
|
| 738 |
+
<div class="card-body text-center">
|
| 739 |
+
<h5 class="card-title">Chickpea</h5>
|
| 740 |
+
</div>
|
| 741 |
+
</div>
|
| 742 |
+
</div>
|
| 743 |
+
<div class="col-6 col-md-4 mb-4">
|
| 744 |
+
<div class="card">
|
| 745 |
+
<img src="data:image/jpeg;base64,{{ images['bananan'] }}" class="card-img-top crop-image" alt="Banana">
|
| 746 |
+
<div class="card-body text-center">
|
| 747 |
+
<h5 class="card-title">Banana</h5>
|
| 748 |
+
</div>
|
| 749 |
+
</div>
|
| 750 |
+
</div>
|
| 751 |
+
<div class="col-6 col-md-4 mb-4">
|
| 752 |
+
<div class="card">
|
| 753 |
+
<img src="data:image/jpeg;base64,{{ images['apple'] }}" class="card-img-top crop-image" alt="Apple">
|
| 754 |
+
<div class="card-body text-center">
|
| 755 |
+
<h5 class="card-title">Apple</h5>
|
| 756 |
+
</div>
|
| 757 |
+
</div>
|
| 758 |
+
</div>
|
| 759 |
+
<div class="col-6 col-md-4 mb-4">
|
| 760 |
+
<div class="card">
|
| 761 |
+
<img src="data:image/jpeg;base64,{{ images['grapes'] }}" class="card-img-top crop-image" alt="Grapes">
|
| 762 |
+
<div class="card-body text-center">
|
| 763 |
+
<h5 class="card-title">Grapes</h5>
|
| 764 |
+
</div>
|
| 765 |
+
</div>
|
| 766 |
+
</div>
|
| 767 |
+
<div class="col-6 col-md-4 mb-4">
|
| 768 |
+
<div class="card">
|
| 769 |
+
<img src="data:image/jpeg;base64,{{ images['orange'] }}" class="card-img-top crop-image" alt="Orange">
|
| 770 |
+
<div class="card-body text-center">
|
| 771 |
+
<h5 class="card-title">Orange</h5>
|
| 772 |
+
</div>
|
| 773 |
+
</div>
|
| 774 |
+
</div>
|
| 775 |
+
<div class="col-6 col-md-4 mb-4">
|
| 776 |
+
<div class="card">
|
| 777 |
+
<img src="data:image/jpeg;base64,{{ images['coconut'] }}" class="card-img-top crop-image" alt="Coconut">
|
| 778 |
+
<div class="card-body text-center">
|
| 779 |
+
<h5 class="card-title">Coconut</h5>
|
| 780 |
+
</div>
|
| 781 |
+
</div>
|
| 782 |
+
</div>
|
| 783 |
+
<div class="col-6 col-md-4 mb-4">
|
| 784 |
+
<div class="card">
|
| 785 |
+
<img src="data:image/jpeg;base64,{{ images['mango'] }}" class="card-img-top crop-image" alt="Mango">
|
| 786 |
+
<div class="card-body text-center">
|
| 787 |
+
<h5 class="card-title">Mango</h5>
|
| 788 |
+
</div>
|
| 789 |
+
</div>
|
| 790 |
+
</div>
|
| 791 |
+
<div class="col-6 col-md-4 mb-4">
|
| 792 |
+
<div class="card">
|
| 793 |
+
<img src="data:image/jpeg;base64,{{ images['lent'] }}" class="card-img-top crop-image" alt="Lentil">
|
| 794 |
+
<div class="card-body text-center">
|
| 795 |
+
<h5 class="card-title">Lentil</h5>
|
| 796 |
+
</div>
|
| 797 |
+
</div>
|
| 798 |
+
</div>
|
| 799 |
+
</div>
|
| 800 |
+
</div>
|
| 801 |
+
</div>
|
| 802 |
+
</div>
|
| 803 |
+
|
| 804 |
+
<!-- Optional Footer -->
|
| 805 |
+
<footer class="bg-dark text-white text-center py-3 mt-5">
|
| 806 |
+
<p>© 2024-25 AgroAssist. All rights reserved.</p>
|
| 807 |
+
<p> created by Gunjankumar Choudhari</p>
|
| 808 |
+
</footer>
|
| 809 |
+
|
| 810 |
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
|
| 811 |
+
</body>
|
| 812 |
+
</html>
|
templates/info.html
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Crops Info Dashboard</title>
|
| 7 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.3/css/bootstrap.min.css">
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
|
| 9 |
+
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@700&display=swap" rel="stylesheet">
|
| 10 |
+
<style>
|
| 11 |
+
.custom-font {
|
| 12 |
+
font-family: 'Poppins', sans-serif;
|
| 13 |
+
font-size: 2.5rem;
|
| 14 |
+
color: #003400;
|
| 15 |
+
margin: 1rem 0;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
body {
|
| 19 |
+
background-color: #f4f4f9;
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
/* Navbar Styles */
|
| 23 |
+
.navbar {
|
| 24 |
+
background-color: #0d1025;
|
| 25 |
+
padding: 0.5rem 1rem;
|
| 26 |
+
position: sticky;
|
| 27 |
+
top: 0;
|
| 28 |
+
z-index: 1000;
|
| 29 |
+
min-height: 65px;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
.navbar-brand {
|
| 33 |
+
display: flex;
|
| 34 |
+
align-items: center;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
.logo-img {
|
| 38 |
+
width: 50px;
|
| 39 |
+
height: 50px;
|
| 40 |
+
transition: transform 0.3s;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
.navbar-toggler {
|
| 44 |
+
border: 1px solid rgba(255,255,255,0.1);
|
| 45 |
+
padding: 0.25rem 0.75rem;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
.navbar-toggler:focus {
|
| 49 |
+
box-shadow: none;
|
| 50 |
+
outline: none;
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
.navbar-collapse {
|
| 54 |
+
flex-grow: 0;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
.navbar-nav {
|
| 58 |
+
align-items: center;
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
.nav-link {
|
| 62 |
+
color: white !important;
|
| 63 |
+
padding: 0.5rem 1rem !important;
|
| 64 |
+
margin: 0 0.2rem;
|
| 65 |
+
border-radius: 5px;
|
| 66 |
+
transition: all 0.3s ease;
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
.nav-link:hover {
|
| 70 |
+
background-color: rgba(255, 255, 255, 0.1);
|
| 71 |
+
transform: translateY(-2px);
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
.brand-text {
|
| 75 |
+
color: #737373;
|
| 76 |
+
margin-left: 1rem;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
@media (max-width: 991px) {
|
| 80 |
+
.navbar-collapse {
|
| 81 |
+
background-color: #0d1025;
|
| 82 |
+
padding: 1rem;
|
| 83 |
+
border-radius: 0 0 10px 10px;
|
| 84 |
+
position: absolute;
|
| 85 |
+
top: 100%;
|
| 86 |
+
left: 0;
|
| 87 |
+
right: 0;
|
| 88 |
+
z-index: 1000;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
.nav-link {
|
| 92 |
+
text-align: center;
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
.brand-text {
|
| 96 |
+
margin: 0.5rem 0;
|
| 97 |
+
text-align: center;
|
| 98 |
+
display: block;
|
| 99 |
+
}
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
/* Dashboard Card Styles */
|
| 103 |
+
.dashboard-card {
|
| 104 |
+
background: white;
|
| 105 |
+
border-radius: 10px;
|
| 106 |
+
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
| 107 |
+
margin-bottom: 2rem;
|
| 108 |
+
transition: all 0.3s ease;
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
.dashboard-card:hover {
|
| 112 |
+
transform: translateY(-5px);
|
| 113 |
+
box-shadow: 0 6px 12px rgba(0,0,0,0.15);
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
/* Chart Description Styles */
|
| 117 |
+
.chart-desc {
|
| 118 |
+
padding: 2rem;
|
| 119 |
+
background: linear-gradient(145deg, #ffffff, #f8f9fa);
|
| 120 |
+
border-radius: 15px;
|
| 121 |
+
box-shadow: 0 4px 15px rgba(0,0,0,0.05);
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
.chart-desc h3 {
|
| 125 |
+
color: #003400;
|
| 126 |
+
margin-bottom: 1.5rem;
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
.chart-desc p {
|
| 130 |
+
margin-bottom: 1rem;
|
| 131 |
+
padding-left: 1.5rem;
|
| 132 |
+
position: relative;
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
.chart-desc i {
|
| 136 |
+
color: #003400;
|
| 137 |
+
margin-right: 10px;
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
/* Iframe Styles */
|
| 141 |
+
iframe {
|
| 142 |
+
width: 100%;
|
| 143 |
+
min-height: 600px;
|
| 144 |
+
border-radius: 15px;
|
| 145 |
+
box-shadow: 0 4px 20px rgba(0,0,0,0.1);
|
| 146 |
+
border: none;
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
/* Footer Styles */
|
| 150 |
+
footer {
|
| 151 |
+
background: linear-gradient(to right, #0d1025, #1a1a2e);
|
| 152 |
+
padding: 2rem 0;
|
| 153 |
+
margin-top: 3rem;
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
footer p {
|
| 157 |
+
margin: 0.5rem 0;
|
| 158 |
+
opacity: 0.9;
|
| 159 |
+
}
|
| 160 |
+
</style>
|
| 161 |
+
</head>
|
| 162 |
+
<body>
|
| 163 |
+
|
| 164 |
+
<!-- Navbar -->
|
| 165 |
+
<nav class="navbar navbar-expand-lg navbar-dark">
|
| 166 |
+
<div class="container-fluid">
|
| 167 |
+
<a href="/" class="navbar-brand">
|
| 168 |
+
<img src="data:image/png;base64,{{ images['logo'] }}" alt="AgroAssist Logo" class="logo-img">
|
| 169 |
+
</a>
|
| 170 |
+
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent">
|
| 171 |
+
<span class="navbar-toggler-icon"></span>
|
| 172 |
+
</button>
|
| 173 |
+
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
| 174 |
+
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
| 175 |
+
<li class="nav-item">
|
| 176 |
+
<a class="nav-link" href="/"><i class="fas fa-house"></i> Home</a>
|
| 177 |
+
</li>
|
| 178 |
+
<li class="nav-item">
|
| 179 |
+
<a class="nav-link" href="/recommendation"><i class="fas fa-seedling"></i> Recommend</a>
|
| 180 |
+
</li>
|
| 181 |
+
<li class="nav-item">
|
| 182 |
+
<a class="nav-link" href="/info"><i class="fas fa-chart-bar"></i> Statistics</a>
|
| 183 |
+
</li>
|
| 184 |
+
</ul>
|
| 185 |
+
<span class="navbar-text brand-text">AgroAssist</span>
|
| 186 |
+
</div>
|
| 187 |
+
</div>
|
| 188 |
+
</nav>
|
| 189 |
+
|
| 190 |
+
<!-- Update the chart description section -->
|
| 191 |
+
<div class="container mt-4">
|
| 192 |
+
<div class="chart-desc">
|
| 193 |
+
<h3 class="text-center">Charts Description</h3>
|
| 194 |
+
<p><i class="fas fa-chart-bar"></i><strong>Nitrogen, Potassium, and Phosphorus of Crops:</strong> This chart shows the nutrient levels of various crops.</p>
|
| 195 |
+
<p><i class="fas fa-thermometer-half"></i><strong>Temperature and Humidity of Crops:</strong> This plot visualizes the optimal temperature and humidity for different crops.</p>
|
| 196 |
+
<p><i class="fas fa-flask"></i><strong>Average pH by Crop Label:</strong> This chart displays the average pH values for crops, helping with soil suitability.</p>
|
| 197 |
+
</div>
|
| 198 |
+
</div>
|
| 199 |
+
<br>
|
| 200 |
+
|
| 201 |
+
<!-- Power BI Embed Section -->
|
| 202 |
+
<div class="container mt-5">
|
| 203 |
+
<h1 class="text-center custom-font">Crops Information Dashboard</h1> <!-- Apply custom class -->
|
| 204 |
+
<iframe title="crop22_powerbi" width="100%" height="600px" src="https://app.powerbi.com/view?r=eyJrIjoiYzc4YTM2NTMtZjZmNi00NDAzLTg0MzktZTY3YjQ0NzVkNTYzIiwidCI6IjBkMDRhNmQxLWFlNDctNGZjZS04MTgxLWMxYTQwNzI5MTNiYiJ9" frameborder="0" allowfullscreen="true"></iframe>
|
| 205 |
+
</div>
|
| 206 |
+
|
| 207 |
+
<!-- Optional Footer -->
|
| 208 |
+
<footer class="bg-dark text-white text-center py-3 mt-5">
|
| 209 |
+
<p>© 2024-25 AgroAssist. All rights reserved.</p>
|
| 210 |
+
<p> created by Gunjankumar Choudhari</p>
|
| 211 |
+
</footer>
|
| 212 |
+
|
| 213 |
+
<!-- Bootstrap JS -->
|
| 214 |
+
<!-- Add these before closing body tag in all templates -->
|
| 215 |
+
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
|
| 216 |
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.min.js"></script>
|
| 217 |
+
</body>
|
| 218 |
+
</html>
|
templates/recommendation.html
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
|
| 4 |
+
<head>
|
| 5 |
+
<meta charset="UTF-8">
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
+
<title>Crop Recommendation</title>
|
| 8 |
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
| 9 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
|
| 10 |
+
|
| 11 |
+
<style>
|
| 12 |
+
.navbar {
|
| 13 |
+
background-color: #0d1025;
|
| 14 |
+
padding: 0.5rem 1rem;
|
| 15 |
+
position: sticky;
|
| 16 |
+
top: 0;
|
| 17 |
+
z-index: 1000;
|
| 18 |
+
min-height: 65px;
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
.navbar-brand {
|
| 22 |
+
display: flex;
|
| 23 |
+
align-items: center;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
.logo-img {
|
| 27 |
+
width: 50px;
|
| 28 |
+
height: 50px;
|
| 29 |
+
transition: transform 0.3s;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
.navbar-toggler {
|
| 33 |
+
border: 1px solid rgba(255,255,255,0.1);
|
| 34 |
+
padding: 0.25rem 0.75rem;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
.navbar-toggler:focus {
|
| 38 |
+
box-shadow: none;
|
| 39 |
+
outline: none;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
.navbar-collapse {
|
| 43 |
+
flex-grow: 0;
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
.navbar-nav {
|
| 47 |
+
align-items: center;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
.nav-link {
|
| 51 |
+
color: white !important;
|
| 52 |
+
padding: 0.5rem 1rem !important;
|
| 53 |
+
margin: 0 0.2rem;
|
| 54 |
+
border-radius: 5px;
|
| 55 |
+
transition: all 0.3s ease;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
.nav-link:hover {
|
| 59 |
+
background-color: rgba(255, 255, 255, 0.1);
|
| 60 |
+
transform: translateY(-2px);
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
.brand-text {
|
| 64 |
+
color: #737373;
|
| 65 |
+
margin-left: 1rem;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
@media (max-width: 991px) {
|
| 69 |
+
.navbar-collapse {
|
| 70 |
+
background-color: #0d1025;
|
| 71 |
+
padding: 1rem;
|
| 72 |
+
border-radius: 0 0 10px 10px;
|
| 73 |
+
position: absolute;
|
| 74 |
+
top: 100%;
|
| 75 |
+
left: 0;
|
| 76 |
+
right: 0;
|
| 77 |
+
z-index: 1000;
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
.nav-link {
|
| 81 |
+
text-align: center;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
.brand-text {
|
| 85 |
+
margin: 0.5rem 0;
|
| 86 |
+
text-align: center;
|
| 87 |
+
display: block;
|
| 88 |
+
}
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
/* Responsive Form Styles */
|
| 92 |
+
.form-control {
|
| 93 |
+
margin-bottom: 1rem;
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
.btn {
|
| 97 |
+
margin: 0.5rem;
|
| 98 |
+
padding: 0.5rem 2rem;
|
| 99 |
+
transition: all 0.3s ease;
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
.btn:hover {
|
| 103 |
+
transform: translateY(-2px);
|
| 104 |
+
box-shadow: 0 2px 8px rgba(0,0,0,0.2);
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
/* Media Queries */
|
| 108 |
+
@media (max-width: 768px) {
|
| 109 |
+
.container {
|
| 110 |
+
padding: 1rem;
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
h1 {
|
| 114 |
+
font-size: 1.8rem;
|
| 115 |
+
}
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
@media (max-width: 576px) {
|
| 119 |
+
.btn {
|
| 120 |
+
width: 100%;
|
| 121 |
+
margin: 0.5rem 0;
|
| 122 |
+
}
|
| 123 |
+
}
|
| 124 |
+
</style>
|
| 125 |
+
</head>
|
| 126 |
+
|
| 127 |
+
<body>
|
| 128 |
+
<nav class="navbar navbar-expand-lg navbar-dark" style="background-color: #0d1025; height: 65px;">
|
| 129 |
+
<div class="container-fluid">
|
| 130 |
+
<a href="/" class="navbar-brand">
|
| 131 |
+
<img src="data:image/png;base64,{{ images['logo'] }}" alt="AgroAssist Logo" class="me-2" style="width: 80px; height: 80px;">
|
| 132 |
+
</a>
|
| 133 |
+
|
| 134 |
+
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
| 135 |
+
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
| 136 |
+
<li class="nav-item">
|
| 137 |
+
<a class="nav-link active" aria-current="page" href="/"><i class="fa-solid fa-house"></i>Home</a>
|
| 138 |
+
</li>
|
| 139 |
+
<li class="nav-item">
|
| 140 |
+
<a class="nav-link" style="color: white;" href="/recommendation"><i class="fas fa-seedling"></i>Recommend</a>
|
| 141 |
+
</li>
|
| 142 |
+
<li class="nav-item">
|
| 143 |
+
<a class="nav-link" style="color: white;" href="/info"><i class="fas fa-chart-bar"></i>Statistics</a>
|
| 144 |
+
</li>
|
| 145 |
+
</ul>
|
| 146 |
+
<a class="navbar-brand ms-auto" style="color: #737373;">AgroAssist</a>
|
| 147 |
+
</div>
|
| 148 |
+
</div>
|
| 149 |
+
</nav>
|
| 150 |
+
|
| 151 |
+
|
| 152 |
+
|
| 153 |
+
<div class="container mt-5">
|
| 154 |
+
<h1 class="text-center">Crop Recommendation System</h1>
|
| 155 |
+
<form id="cropRecommendationForm" action="/recommendation" method="POST">
|
| 156 |
+
<div class="row mt-4">
|
| 157 |
+
<div class="col-md-4">
|
| 158 |
+
<label for="Nitrogen">Nitrogen</label>
|
| 159 |
+
<input type="number" step="0.01" id="Nitrogen" name="Nitrogen" placeholder="Enter Nitrogen" class="form-control" required value="{{ N }}">
|
| 160 |
+
</div>
|
| 161 |
+
<div class="col-md-4">
|
| 162 |
+
<label for="Phosporus">Phosphorus</label>
|
| 163 |
+
<input type="number" step="0.01" id="Phosporus" name="Phosporus" placeholder="Enter Phosphorus" class="form-control" required value="{{ P }}">
|
| 164 |
+
</div>
|
| 165 |
+
<div class="col-md-4">
|
| 166 |
+
<label for="Potassium">Potassium</label>
|
| 167 |
+
<input type="number" step="0.01" id="Potassium" name="Potassium" placeholder="Enter Potassium" class="form-control" required value="{{ K }}">
|
| 168 |
+
</div>
|
| 169 |
+
</div>
|
| 170 |
+
<div class="row mt-4">
|
| 171 |
+
<div class="col-md-4">
|
| 172 |
+
<label for="Temperature">Temperature (°C)</label>
|
| 173 |
+
<input type="number" step="0.01" id="Temperature" name="Temperature" placeholder="Enter Temperature" class="form-control" required value="{{ temp }}">
|
| 174 |
+
</div>
|
| 175 |
+
<div class="col-md-4">
|
| 176 |
+
<label for="Humidity">Humidity (%)</label>
|
| 177 |
+
<input type="number" step="0.01" id="Humidity" name="Humidity" placeholder="Enter Humidity" class="form-control" required value="{{ humidity }}">
|
| 178 |
+
</div>
|
| 179 |
+
<div class="col-md-4">
|
| 180 |
+
<label for="Ph">pH</label>
|
| 181 |
+
<input type="number" step="0.01" id="Ph" name="Ph" placeholder="Enter pH" class="form-control" required value="{{ ph }}">
|
| 182 |
+
</div>
|
| 183 |
+
</div>
|
| 184 |
+
<div class="row mt-4">
|
| 185 |
+
<div class="col-md-4">
|
| 186 |
+
<label for="Rainfall">Rainfall (mm/year)</label>
|
| 187 |
+
<input type="number" step="0.01" id="Rainfall" name="Rainfall" placeholder="Enter Rainfall" class="form-control" required value="{{ rainfall }}">
|
| 188 |
+
</div>
|
| 189 |
+
<div class="col-md-12 mt-4 text-center">
|
| 190 |
+
<button type="submit" class="btn btn-success">Get Recommendation</button>
|
| 191 |
+
<button type="button" class="btn btn-danger" onclick="resetForm()">Reset</button>
|
| 192 |
+
</div>
|
| 193 |
+
</div>
|
| 194 |
+
</form>
|
| 195 |
+
|
| 196 |
+
{% if result %}
|
| 197 |
+
<div class="mt-4 alert alert-success">
|
| 198 |
+
<h4>{{ result }}</h4>
|
| 199 |
+
</div>
|
| 200 |
+
{% endif %}
|
| 201 |
+
|
| 202 |
+
<div class="alert alert-info mt-4">
|
| 203 |
+
<h5>Input Parameter Information</h5>
|
| 204 |
+
<ul>
|
| 205 |
+
<li>Nitrogen: 0 - 150 kg/ha</li>
|
| 206 |
+
<li>Phosphorus: 0 - 150 kg/ha</li>
|
| 207 |
+
<li>Potassium: 0 - 150 kg/ha</li>
|
| 208 |
+
<li>Temperature: 0 - 45 °C</li>
|
| 209 |
+
<li>Humidity: 0 - 100%</li>
|
| 210 |
+
<li>pH: 0 - 14</li>
|
| 211 |
+
<li>Rainfall: 100 - 3000 mm/year</li>
|
| 212 |
+
</ul>
|
| 213 |
+
</div>
|
| 214 |
+
</div>
|
| 215 |
+
|
| 216 |
+
<footer class="bg-dark text-white text-center py-3 mt-5">
|
| 217 |
+
<p>© 2024-25 AgroAssist. All rights reserved.</p>
|
| 218 |
+
<p> created by Gunjankumar Choudhari</p>
|
| 219 |
+
</footer>
|
| 220 |
+
|
| 221 |
+
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
|
| 222 |
+
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
|
| 223 |
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.min.js"></script>
|
| 224 |
+
<script>
|
| 225 |
+
function resetForm() {
|
| 226 |
+
// Clear all input fields
|
| 227 |
+
document.getElementById('cropRecommendationForm').reset();
|
| 228 |
+
// Clear the result display
|
| 229 |
+
const resultElement = document.querySelector('.mt-4.alert-success');
|
| 230 |
+
if (resultElement) {
|
| 231 |
+
resultElement.remove();
|
| 232 |
+
}
|
| 233 |
+
// Optional user feedback
|
| 234 |
+
alert("Form has been reset.");
|
| 235 |
+
}
|
| 236 |
+
</script>
|
| 237 |
+
</body>
|
| 238 |
+
|
| 239 |
+
</html>
|