Skip to content

gagalyash/laptop-price-predictor

Repository files navigation

Laptop Prices Predictor

  • Designed a web app that predicts the price of the laptop given the configurations.
  • Scraped the laptops data from kaggle using python and Opendatasets package.
  • Developed Linear, Lasso, and Random Forest Regressors using GridsearchCV to get the best model.
  • Deployed the Machine Learning model using streamlit library on Heroku.

Links and Resources Used

  • Streamlit Library: https://www.streamlit.io/
  • Dataset Link: https://www.kaggle.com/ionaskel/laptop-prices/
  • heroku Platform: https://www.heroku.com/
  • Packages: pandas, numpy, matplotlib, seaborn, sklearn, pickle, streamlit
  • Feature Engineering

    We go through all the features one by one and keep adding new features. I have made the following changes and created new variables:

    • RAM - Made columns for Ram Capacity in GB
    • Processor - Made columns for Name of the Processor, Type of the Processor, Generation
    • Operating System - Parsed the Operating System from this column and made a new column
    • Storage - Made new columns for the type of Disk Drive and the capacity of the Disk Drive
    • Display - Made new columns for the size of the laptop(in inches) and touchscreen
    • Description - Made new columns for the company and IPS

    Data Preprocessing

    There are a few columns which are categorical here but they actually contain numerical values.So we need to convert few categorical columns to numerical columns. These are ram, weight, hdd, ssd.

    Model Building

  • Traditional Method
  • Used scikit-learn library for the Machine Learning tasks. Applied label encoding and converted the categorical variables into numerical ones.Then I splited the data into training and test sets with a test size of 20%. I tried different regression models ( Linear Regression, Random Forest Regression, XGBoost) and evaluated them using Mean Absolute Error.

    Model Deployment