Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consumer Price Indexes Prediction #453

Merged
merged 3 commits into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
274 changes: 274 additions & 0 deletions Consumer Index Prediction/Datasets/index.csv

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Consumer Index Prediction/Images/bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Consumer Index Prediction/Images/correlation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Consumer Index Prediction/Images/graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5,161 changes: 5,161 additions & 0 deletions Consumer Index Prediction/Model/Consumer_Price_Prediction.ipynb

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions Consumer Index Prediction/Model/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## Consumer Index Prediction

### Introduction

Predicting future consumer indices is crucial for economic forecasting and financial planning. This project explores various machine learning models for this task, including Random Forest, Decision Tree, Logistic Regression, and compares them to Deep Learning methods. Additionally, visualizations with Matplotlib and Seaborn enhance the analysis.

### Technologies

* Python 3.x
* TensorFlow (Deep Learning)
* Scikit-learn (Random Forest, Decision Tree, Logistic Regression)
* Matplotlib (Visualization)
* Seaborn (Statistical Visualization)
* Pandas (Data Manipulation)
* NumPy (Numerical Calculations)

### Data

The data is downloaded from the kaggle website (https://www.kaggle.com/datasets/satyampd/consumer-price-index-india-inflation-data).
### Model Training and Evaluation

1. **Data Preprocessing:** Clean, scale, and prepare the data for each model.
2. **Model Implementation:**
* **Random Forest:** Train a Random Forest Regressor with hyperparameter tuning.
* **Decision Tree:** Train a Decision Tree Regressor with hyperparameter tuning.
* **Logistic Regression:** Train a Logistic Regression model (if predicting binary outcome).
* **Deep Learning (optional):** Build and train a Deep Neural Network for regression or classification.
3. **Evaluation:** Compare model performance using metrics like Mean Squared Error (MSE), R-squared, or F1-score (depending on the task).
4. **Visualization:**
* Plot actual vs. predicted consumer index values for each model.
* Visualize feature importance in Random Forest and Decision Tree.
* Analyze model residuals to identify potential biases.

### Conclusion

* While Deep Learning models often achieve high accuracy, simpler models like Random Forest and Decision Trees can be effective for consumer index prediction, especially with careful feature selection and hyperparameter tuning.
* Logistic Regression can be suitable for predicting binary outcomes, such as whether the index will rise or fall.
* Visualization plays a crucial role in understanding model behavior, identifying potential issues, and communicating insights.

### Next Steps

* Explore feature engineering and dimensionality reduction techniques.
* Implement ensemble methods like stacking for improved performance.
* Apply the models to real-world data and monitor their accuracy over time.
11 changes: 11 additions & 0 deletions Consumer Index Prediction/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
The python latest version needs to install (above 3.9)

The library needs to install:-
1. numpy
2. pandas
3. matplotlib.pyplot
4. seaborn
5. tensorflow

The Jupiter notebook needs to install by using anaconda or vscode for a better view.

Loading