This project aims to develop a predictive model for truck suspension performance using linear regression. The model takes various input parameters related to truck specifications and predicts a performance metric. Additionally, the project includes a Streamlit web application that allows users to interactively input data and receive predictions. The application also leverages OpenAI's API to provide maintenance insights based on the predicted performance.
- Predicts truck suspension performance based on user inputs.
- Provides maintenance recommendations using OpenAI's API.
- User-friendly interface built with Streamlit.
- Python: Programming language used for development.
- Streamlit: Framework for building the web application.
- Scikit-learn: Library for machine learning algorithms.
- OpenAI API: For generating maintenance insights.
- Pandas: For data manipulation and analysis.
- Joblib: For saving and loading the trained model.
-
Clone this repository:
git clone https://github.com/SagarFall2022/Machine-Learning.git cd Truck Suspension Performance Prediction/
-
Create a virtual environment and activate it:
python -m venv venv
- On Windows use:
venv\Scripts\activate
- On macOS/Linux use:
source venv/bin/activate
- On Windows use:
-
Install the required packages:
pip install -r requirements.txt
-
Set your OpenAI API key in your environment variables:
- On macOS/Linux:
export OPENAI_API_KEY='your_openai_api_key'
- On Windows use:
set OPENAI_API_KEY='your_openai_api_key'
- On macOS/Linux:
-
Open your terminal or command prompt.
-
Navigate to the project directory:
cd path/to/my_truck_project/
-
Run the Streamlit app:
streamlit run app.py
-
Interact with the application:
- A new tab will open in your default web browser displaying the Streamlit application.
- Input your truck parameters and click the "Predict Performance" button to receive predictions and maintenance insights.
The model is trained using synthetic data generated within the project. The training process includes:
- Data generation
- Model training using Linear Regression
- Saving the trained model for future predictions
During training, the model's coefficients and R² score are printed to provide insights into its performance.
This application can be deployed using platforms like Streamlit Sharing, Heroku, or AWS. Ensure all environment variables are correctly set in your deployment environment.