The Inflation Predictor ML Flask Web App is designed to predict the inflation rate based on key economic indicators such as GDP and the unemployment rate. This project leverages machine learning techniques to provide an interactive web-based tool for economic forecasting and analysis.
- Data Collection: Collect historical data on GDP, unemployment rates, and inflation rates.
- Data Preprocessing: Clean and normalize the data to prepare it for model training.
- Model Training: Train a neural network model using the preprocessed data.
- Model Evaluation: Evaluate the model's performance using metrics like mean squared error (MSE) and R² score.
- Model Deployment: Deploy the trained model using a Flask web application, allowing users to input new data and receive predictions.
Flask is a lightweight web framework for Python that is used to build web applications. It is designed to be simple and easy to use, making it ideal for small to medium-sized projects. Flask provides the necessary tools to set up web routes, handle HTTP requests, and integrate with machine learning models.
The architecture of the Inflation Predictor ML Flask Web App consists of the following components:
- Frontend: A simple web interface built using HTML and CSS, allowing users to input economic indicators and receive predicted inflation rates.
- Backend: A Flask application that handles user input, processes data, and serves the prediction results. The backend integrates the trained machine learning model to generate predictions.
- Model: A neural network model trained using TensorFlow/Keras, which is responsible for predicting the inflation rate based on input features.
- Data Storage: The dataset used for training the model is stored in CSV format, and the trained model is saved as an HDF5 file. The scaler used for data normalization is saved using the pickle module.
The following libraries are used in this project:
- Pandas: For data manipulation and analysis.
- Scikit-learn: For data preprocessing, model evaluation, and splitting the dataset.
- TensorFlow/Keras: For building and training the neural network model.
- Pickle: For saving and loading the scaler object.
- Flask: For creating the web application.
To set up and run the Inflation Predictor ML Flask Web App, follow these steps:
-
Clone the Repository:
git clone https://github.com/yourusername/inflation-predictor-ml-flask.git cd inflation-predictor-ml-flask
-
Install Dependencies:
pip install -r requirements.txt
-
Run the Flask App:
python app.py
-
Access the Web App: Open your web browser and navigate to
http://127.0.0.1:8000
to access the Inflation Predictor ML Flask Web App.
This project presents a basic machine learning model for predicting the inflation rate, implemented as a prototype using Flask. While it demonstrates the potential of using economic indicators such as GDP and the unemployment rate for forecasting inflation, it is not accurate enough for real-world applications. To predict the actual inflation rate with higher accuracy, more comprehensive data and a more sophisticated model would be required. This prototype serves as a foundational step towards developing a robust inflation prediction tool, highlighting the need for further data collection and model refinement.
For those interested in the model creation aspect of this project, you can access the repository containing the model creation code and assets using the following link: Inflation Predictor Model Repository.