This project demonstrates the deployment of a Ridge regression model using Flask. The application serves predictions via a web interface and an API endpoint, enabling users to input data and receive predictions in real-time.
application.py
: The main Flask application file that handles requests, loads the model and scaler, and renders the web pages.models/ridge.pkl
: The pre-trained Ridge regression model saved as a pickle file.models/scaler.pkl
: The standard scaler for feature scaling, also saved as a pickle file.templates/index.html
: HTML file for the main user interface.
- Python 3.x
- Flask
- Scikit-learn
- Pandas, Numpy
- Pickle (for loading model files)
-
Clone the repository:
git clone https://github.com/harishbalajib/LinearRegression.git cd LinearRegression
-
Install the required packages:
pip install -r requirements.txt
-
Ensure the
models
directory contains theridge.pkl
andscaler.pkl
files for the model and scaler, respectively.
Start the Flask application with:
python application.py
This will start a local server. Open a browser and navigate to http://127.0.0.1:5000/
to access the web interface.
- Web Interface: The main page allows you to input data for predictions. Enter the data in the form fields and submit to get predictions from the Ridge regression model.
- API Endpoint: You can also send a POST request to the
/PredictData
endpoint with JSON data to receive predictions.
Feel free to open issues or submit pull requests with improvements or new features.
This project is licensed under the MIT License.