Skip to content

Latest commit

 

History

History
52 lines (45 loc) · 1.86 KB

File metadata and controls

52 lines (45 loc) · 1.86 KB

ML---Soil-Quality

A machine learning model to predict soil fertility based on elemental soil analysis

The-5-Components-of-Healthy-Soil-1024x682

Requirments

Requirments

Data

Data Source

Raw Data is published on kaggle

Atrributes

  • N - ratio of Nitrogen (NH4+) content in soil
  • P - ratio of Phosphorous (P) content in soil
  • K - ratio of Potassium (K) content in soil
  • ph - soil acidity (pH)
  • ec - electrical conductivity
  • oc - organic carbon
  • S - sulfur (S)
  • zn - Zinc (Zn)
  • fe - Iron (Fe)
  • cu - Copper (Cu)
  • Mn - Manganese (Mn)
  • B - Boron (B)
  • fertility: categorical (0 "Less Fertile", 1 "Fertile", 2 "Highly Fertile")

Resource/Situational Constraints

  • Lack of Data about our region
  • Lack of some classes
  • Lack of experience in agriculutral science

Process followed

  • Searched for a dataset from another country
  • Creating additional instances for the least appearing class
  • monitored by an experienced specialist

Code

  1. Import liberaries and modules
  2. Naive approuch with RandomForestClassifier and raw data(accuracy = 88%)
  3. Data Exploration for modified data
  4. Choose a model
    • SupportVectorClassifier
    • RandomForestClassifier
    • GaussianNB
    • KNeighborsClassifier
    • DecisionTreeClassifier
  5. GridSearch
  6. Train a RandomForestClassifier (accuracy = 97%)
  7. Save the model