"""
# Crop Recommendation Model
##### Author: Aakash Prasad

### Data fields
##### N - ratio of Nitrogen content in soil
##### P - ratio of Phosphorous content in soil
##### K - ratio of Potassium content in soil
##### temperature - temperature in degree Celsius
##### humidity - relative humidity in %
##### ph - ph value of the soil
##### rainfall - rainfall in mm


#### Here a model is trained from these historical recommendations, in order to provide an autonomous crop selection based on the above variables.

"""
import numpy as np, pandas as pd
import warnings
warnings.filterwarnings('ignore')
df=pd.read_csv('../input/crop-recommendation-dataset/Crop_recommendation.csv')
df.head()
y=df.pop('label')
X=df
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, train_size=0.7, test_size=0.3, random_state=100)
from sklearn.linear_model import LogisticRegression
clf = LogisticRegression(random_state=0, multi_class='ovr')
model= clf.fit(X_train,y_train)
model.score(X_test,y_test)
model.predict(X_train)
"""
 ### In order to get the crop to be grown use **model.predict(your_dataset)** and it will give you the recommendation with an accuracy of around 97.5%
"""
#"your_dataset" should contains columns in same form and order (N ,P ,K ,temperature ,humidity ,ph ,rainfall), load the data and see the recommendation