Back to Portfolio

Laptop Price Prediction

Machine Learning 2023
Python Scikit-learn XGBoost Pandas NumPy
Laptop Price Prediction Feature Importance Feature Importance

About the Project

The laptop market is influenced by numerous factors including brand reputation, hardware specifications, market demand, and technological advancements. Predicting laptop prices accurately is challenging due to the complexity and variability of these factors.

This project leverages a data-driven approach using machine learning algorithms to develop a robust model for accurate laptop price predictions, providing valuable insights for consumers and sellers alike.

Dataset Description

  • Company: Name of the company
  • TypeName: Type of laptop (Notebook, Gaming, Ultrabook, etc.)
  • Inches: Size of the laptop
  • ScreenResolution: Laptop screen resolution
  • Cpu: Processor specifications
  • Ram: Amount of RAM
  • Memory: Storage capacity/type
  • Gpu: Graphics processor specifications
  • OpSys: Operating system installed
  • Weight: Laptop weight
  • Price: Target variable for prediction

Technical Details

Data Cleaning and Insights

  • Removed units (e.g., GB from RAM column, kg from Weight column) and changed data types accordingly
  • Most common laptop type is Notebook (55.8%), likely due to its affordability
  • Created a new column, PPI (Pixels Per Inch), to measure display sharpness and clarity
  • Touchscreen laptops tend to be priced higher
  • Most people prefer laptops with 8GB RAM, likely due to budget considerations
  • Nvidia processors are generally more expensive

Algorithms Used

Evaluated multiple machine learning models:
  • Linear Models: Linear Regression, Ridge, Lasso
  • Nearest Neighbors: KNeighborsRegressor
  • Tree-Based Models: Decision Tree, Random Forest, Gradient Boosting, AdaBoost, Extra Trees
  • Support Vector Machines: SVR
  • Boosting Algorithms: XGBRegressor

Preprocessing Techniques

  • One-Hot Encoding for categorical features
  • Column Transformation for different feature types
  • Label Encoding for ordinal features
  • Feature Scaling using StandardScaler