--- license: mit datasets: - custom metrics: - mean_squared_error - mean_absolute_error - r2_score model_name: Random Forest Regressor for Crop Nutrient Prediction tags: - random-forest - regression - agriculture - soil-nutrients --- # Random Forest Regressor for Crop Nutrient Prediction ## Overview This model predicts the nutrient needs (Nitrogen, Phosphorus, Potassium) for various crops based on features like crop type, target yield, field size, and soil properties. It is trained using a Random Forest Regressor. ## Training Data The model was trained on a custom dataset containing the following features: - Crop Name - Target Yield - Field Size - pH (water) - Organic Carbon - Total Nitrogen - Phosphorus (M3) - Potassium (exch.) - Soil moisture The target variables are: - Nitrogen (N) Need - Phosphorus (P2O5) Need - Potassium (K2O) Need ## Model Training The model was trained using a Random Forest Regressor. Below are the steps taken for training: 1. Data preprocessing: handling missing values, scaling numerical features, and one-hot encoding categorical features. 2. Splitting the dataset into training and testing sets. 3. Training the Random Forest model on the training set. 4. Evaluating the model on the test set. ## Evaluation Metrics The model was evaluated using the following metrics: - Mean Squared Error (MSE) - Mean Absolute Error (MAE) - R-squared (R2) Score ## How to Use ### Installation To install the necessary packages, run: ```bash pip install -r requirements.txt