This project aims to predict rainfall in California using three machine learning models: XGBoost, SARIMA, and Random Forest.
-
Data Preprocessing:
- Clean and preprocess the input datasets (
final_data.csvandRainfall_Dataset.csv) using scripts in theScriptsdirectory. - Feature engineering and exploratory data analysis are conducted to prepare the data for modeling.
- Clean and preprocess the input datasets (
-
Model Development:
- Train and evaluate three models:
- XGBoost: Developed and evaluated in
xgb_model.ipynb. - SARIMA: Implemented in
time_series_model.py. - Random Forest: Code integrated in the respective Python scripts (3 different files).
- XGBoost: Developed and evaluated in
- Train and evaluate three models:
-
Forecasting:
- Generate rainfall forecasts at the county level (
County_Forecasts/) and the station level (Station_Forecasts/).
- Generate rainfall forecasts at the county level (
-
Visualization and Metrics:
- Generate visualizations and calculate evaluation metrics in notebooks like
barplot_metrics.ipynbandmetrics_df.ipynb.
- Generate visualizations and calculate evaluation metrics in notebooks like
- A powerful gradient boosting algorithm designed for structured data. Used to generate accurate forecasts at both county and station levels.
- A statistical time series forecasting method that extends ARIMA by accounting for seasonality.
- An ensemble learning method based on decision trees. Useful for making robust predictions on complex datasets.
Ensure you have Python installed. Clone the repository and navigate to the project directory.
Install required Python libraries using requirements.txt:
pip install -r requirements.txt- Preprocessing and Training:
- Use the Jupyter notebooks in the
Scripts/directory to preprocess data and train the models.
- Use the Jupyter notebooks in the
- Forecasting:
- Run the
.pyfiles in theScripts/directory to generate forecasts for counties and stations using different models.
- Run the
The forecast results are saved in the County_Forecasts/ and Station_Forecasts/ directories as text files.