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

Pre Owned Car Price Predictor Project Added #211

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 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
2,714 changes: 2,714 additions & 0 deletions models/BitcoinPricePrediction/BTC-USD.csv

Large diffs are not rendered by default.

Large diffs are not rendered by default.

816 changes: 816 additions & 0 deletions models/BitcoinPricePrediction/Bitcoin Price Prediction LSTM.ipynb

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions models/BitcoinPricePrediction/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## Bitcoin Price Prediction using LSTM
This repository contains an implementation of a Long Short-Term Memory (LSTM) model for predicting Bitcoin prices using historical data. The model is built using Keras and TensorFlow. It predicts the closing price of Bitcoin by training on past data and evaluating its performance on a test set. The results are evaluated using common regression metrics such as R², RMSE, MAE, and others.

## **Dataset**
The dataset used in this project is historical Bitcoin price data downloaded from a public source. The file BTC-USD.csv contains columns such as Date, Open, High, Low, Close, Adj Close, and Volume. The prediction is based solely on the Close price of Bitcoin.

**Dataset Preprocessing:**
* Missing values are handled.
* The Date column is converted into datetime format and set as the index.
* The closing prices are normalized using MinMaxScaler for better model performance.

## Model Architecture
The implemented model is a multi-layer LSTM neural network that includes dropout layers to reduce overfitting. Here's an overview of the model:

**Input Layer:** Time series data reshaped to 3D for LSTM layers.
**LSTM Layers:** Two LSTM layers with 200 and 160 units, respectively, with return_sequences enabled in the first layer.
**Dropout:** Added after each LSTM layer to prevent overfitting.
**Dense Layers:** Two Dense layers; the final layer has 1 neuron for regression output (predicted closing price).

## Model Hyperparameters
**Batch Size:** 32
**Epochs:** 50
**Loss Function:** Mean Squared Error (MSE)
**Optimizer:** Adam
**Metrics:** Mean Absolute Percentage Error (MAPE)

## Evaluation Metrics
The model is evaluated using several regression metrics, including:

* **R² Score:** Measures the proportion of variance in the dependent variable that is predictable.
* **RMSE:** Root Mean Squared Error, used to measure the differences between predicted and observed values.
* **MSE:** Mean Squared Error, similar to RMSE but without square rooting.
* **MAE:** Mean Absolute Error, the average of the absolute errors between actual and predicted values.
* **MATE:** Median Absolute Error, a robust measure of error.
* **SMATE:** Scaled Mean Absolute Error, normalized version of MAE.

A detailed comparison of the training and testing set metrics is included in the project.

817 changes: 817 additions & 0 deletions models/Pre Owned Car Price Predictor/Cleaned_Car_data.csv

Large diffs are not rendered by default.

Binary file not shown.
63 changes: 63 additions & 0 deletions models/Pre Owned Car Price Predictor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Pre-Owned Car Price Predictor

## Overview
The **Pre-Owned Car Price Predictor** is a machine learning project aimed at predicting the prices of pre-owned cars based on various features such as make, model, year, mileage, and fuel type. This tool helps potential buyers and sellers get an accurate price estimation for used cars, enabling informed decision-making in the car resale market.

## Features
- **Comprehensive Dataset Analysis**: The project uses a dataset with essential car details, including make, model, year, mileage, fuel type, and price, for model training.
- **Model Performance Evaluation**: The model's performance is measured using Mean Absolute Error (MAE) and R-squared metrics to ensure accurate predictions.

## Technologies Used
- **Python**: The primary programming language used in the project.
- **Machine Learning**: Predictive modeling to estimate car prices based on user inputs.
- **Scikit-Learn**: Used for model building and evaluation.
- **Pandas and NumPy**: Data manipulation and preprocessing.
- **Matplotlib and Seaborn**: Data visualization for analyzing relationships and trends within the data.

## Skills Demonstrated
1. **Data Preprocessing**: Cleaning and transforming raw data for analysis and model training.
2. **Data Manipulation**: Extracting meaningful features and organizing data for the model.
3. **Data Visualization**: Using plots and charts to understand data distributions and correlations.
4. **Data Cleaning**: Handling missing values and removing outliers to improve model accuracy.
5. **Statistical Analysis**: Assessing relationships between features and the target variable.
6. **Machine Learning Modeling**: Building and evaluating predictive models.
7. **Problem Solving**: Developing a solution for price prediction in a real-world context.

## Data Sources

- **Data Preprocessing**: Extensive preprocessing was required to clean the data, handle missing values, and engineer features for analysis.

## Model Training and Evaluation
- The machine learning model was trained using a **Linear Regression** algorithm, achieving an accuracy of **86%** on the test set.
- **Model Pipeline**: A robust pipeline was built to automate preprocessing and model training steps, making the solution scalable.
- **Hyperparameter Tuning**: Parameters were optimized to enhance the model's accuracy and generalization.

## Getting Started

### Prerequisites
- Python 3.x
- Required packages listed in `requirements.txt`

### Installation
1. Clone the repository:
```bash
git clone https://github.com/yashasvini121/predictive-calc
```
2. Navigate to the project directory:
```bash
cd car-price-predictor
```
3. Install the required packages:
```bash
pip install -r requirements.txt
```

## Project Structure
- `LinearRegressionModel.pkl`: Serialized machine learning model.
- `Cleaned_Car_data.csv`: The cleaned dataset used for training.


## Acknowledgments

- **Libraries and Tools**: Python, Scikit-Learn, Pandas, NumPy, Matplotlib, and Seaborn for their support in building this project.

Large diffs are not rendered by default.

Loading
Loading