Used-car prices depend on a mix of numerical and categorical features, so a useful model needs preprocessing before training.
Machine learning
Used Car Price Prediction
A Python project for predicting used BMW prices from vehicle data.
The project follows a practical ML workflow: raw CSV data, cleaning, exploratory plots, train/test split, OneHotEncoder preprocessing, model training, and evaluation.
Overview
This project shows my current practical data-science workflow. The public repository does not include a README yet, so the portfolio describes only what is visible in the source code.
The Problem
A used-car model has to handle both numeric features such as mileage and engine size, and categorical features such as model, fuel type, and transmission.
The Approach
The script reads BMW vehicle data, records basic dataset information, cleans the dataframe, creates exploratory plots, splits data into train and test sets, then transforms categorical columns before training.
Technical Implementation
Pandas handles CSV loading and cleaning. scikit-learn handles train/test splitting, ColumnTransformer preprocessing, OneHotEncoder categorical encoding, Linear Regression, RandomForestRegressor, and model metrics.
Interesting Challenges
The project deals with common tabular-data issues: duplicate rows, missing numerical values, invalid mileage and price ranges, categorical columns, and outliers grouped by model and year.
What I Learned
The useful part of the project is not just fitting a model; it is seeing how much work sits around the model in cleaning, preparing, checking, and evaluating the data.
Future Improvements
The next step would be to add a README, save repeatable evaluation output, compare more models in a cleaner experiment structure, and separate plotting from the command-line training script.