Machine Learning notebook for laptop price prediction using Google Colab and Scikit-learn.
💻 Laptop Price Prediction - Algerian Market
A Machine Learning project developed entirely using Google Colab to estimate
the prices of laptops available in the Algerian market.
The dataset mainly focuses on laptops priced up to approximately
120,000 DZD (12 million centimes) .
📖 Overview
This project uses several Machine Learning regression algorithms to predict laptop prices based on their hardware specifications.
The models are trained and evaluated using the same dataset, then compared using the
Root Mean Squared Error (RMSE) metric to automatically select the best-performing model.
The final model predicts the estimated market price of a laptop from its encoded hardware specifications.
🚀 Technologies
Google Colab
Python 3
Pandas
NumPy
Scikit-learn
Matplotlib
🤖 Regression Models
K-Nearest Neighbors (KNN)
Linear Regression
Ridge Regression
Lasso Regression
Decision Tree Regressor
Random Forest Regressor
Gradient Boosting Regressor
📊 Model Performance (RMSE)
Algorithm
Parameters
RMSE (DA)
KNN
k=3, metric='manhattan'
4247.97
Linear Regression
fit_intercept=True
494.71
Decision Tree
max_depth=8
4601.72
Random Forest
800 Trees
5098.88
Gradient Boosting
300 Estimators
2096.82
Ridge Regression
alpha=1
8548.40
Lasso Regression ⭐
alpha=0.01
487.47
✅ Lasso Regression achieved the best performance and was selected as the final prediction model.
📑 Dataset Encoding Reference
All categorical features are encoded using numeric values to simplify preprocessing and improve model performance.
The following tables explain the encoding used throughout the dataset.
Brand (model)
Code
Brand
1 Dell
2 HP
3 Lenovo
4 Asus
Processor (CPU)
Code
Processor
2 Intel Core i3
4 Intel Core i5
6 Intel Core i7
Storage Type (Type_Rom)
Code
Type
0 HDD
1 SSD
Touch Screen (Tactile)
Code
Value
0 No
1 Yes
Other Features
Feature
Description
generation
CPU generation (e.g. 8 = 8th Generatio …