Ever wondered how much your dream laptop should cost? π€
This project is a Machine Learning model that predicts the price of a laptop based on its configuration β things like RAM, CPU, GPU, brand, OS, touchscreen, weight, and more.
I trained this model using a dataset of laptops and deployed it with a simple interface so you can test it yourself! π
β Try it out here! π
- Cleaned the dataset by dropping unnecessary columns like
Cpu,Cpu Name,Memory(after feature engineering). - Extracted useful features such as:
- Whether the screen is Touchscreen or not
- Whether it has an IPS panel
- Screen resolution & PPI
- Encoded categorical variables like Company, TypeName, OS, GPU Brand using
OneHotEncoder.
- Handled missing values & ensured consistent formatting for numerical + categorical columns.
- Target variable: Laptop Price (log-transformed for stability).
- Used a Pipeline for preprocessing + model training.
- Steps:
ColumnTransformerβ One-hot encoding for categorical features.RandomForestRegressoras the main model.
- Hyperparameters tuned:
n_estimators=100max_depth=15max_features=0.75max_samples=0.5
- Evaluated on test data.
- π RΒ² Score: ~0.86
- π Mean Absolute Error (MAE): ~0.19 (after taking exp back from log)
Pretty solid for predicting real-world laptop prices .
- Python
- Scikit-learn (ML model)
- Pandas, NumPy (data wrangling)
- Matplotlib, Seaborn (EDA & plots)
- Streamlit (for deployment / frontend)