How shreyashkumar07/crop-yield-prediction-app works
Main Modules/Components
• User Interface (UI): Represented by the Streamlit app (app.py) which accepts user inputs (e.g., area, crop type, year, rainfall, pesticides, and temperature) and displays results.
• Data Processing Components:
• Preprocessing objects — scaler (scaler.pkl), label encoder (label_encoder_area.pkl), and one-hot encoder (one_hot_encoder_item.pkl) – used to properly format user input.
• Prediction Engine: The pre-trained MLP regressor model (mlp_regressor.pkl) that receives processed inputs and outputs a crop yield prediction.
• Data Source: The historical dataset file (yield_df.csv) is the foundation on which the model was trained (also referenced in the “Crop Prediction MLP.ipynb” notebook).
• Supplementary Materials:
• The Jupyter Notebook showing data preprocessing and model training.
• A demo video (“Crop Cast Demo.mp4”) that explains usage or showcases the system in action.
• License and README showing setup instructions and project overview.
Interactions/Flow
• That user inputs collected from the UI are first sent to the preprocessing block:
• Prediction Engine: Using the pre-trained MLP model, this component takes the transformed input data and returns a crop yield prediction.
• Finally, the prediction is passed back to the UI where it is displayed to the user.
Architectural Patterns and Design Principles
• Modular Design: Each step (UI, preprocessing, prediction) is separated into distinct components for clarity and maintenance.
• Reusability and Extensibility: The design incorporates pre-trained assets so that the prediction pipeline can be updated with improved models or preprocessing techniques without major rework.
Technologies and Key Files
• Streamlit (app.py) for building the interactive web interface.
• Scikit-learn / Joblib for handling the serialization and deserialization of the model and preprocessor objects.
• Jupyter Notebook (Crop Prediction MLP.ipynb) provides background on training and evaluation, which supports the production deployment.
• CSV dataset (yield_df.csv) as the data source for model training.
• Additionally, the demo video and license documentation are part of the repository, giving context to usage and rights.
• Below that, branch into two flows:
• Side notes for offline components like the “Crop Prediction MLP.ipynb” demonstrating model training and evaluation, and “yield_df.csv” indicating data sources.