Laptop price prediction project

To introduce the concepts of regression, we’ll use a example. In this case, the objective is to predict the price of a laptop to provide our users with the best automatic price recommendations.

For this purpose:

  1. We need to download and analyze a dataset on laptop price, decide which features are the most important.
  2. If is necessary perform some data transformation
  3. Splitting the dataset into training, validation and testing sets. This way, we can perform the validation strategy to make sure out model produces accurate predictions.
  4. Then we implement a linear regressor.

The dataset:

image.png

The dataset can be downloaded from the following link:

<aside> 🔗

https://www.kaggle.com/datasets/juanmerinobermejo/laptops-price-dataset

</aside>

To download the dataset using Python, we can the following way:

First, we need to install the Kaggle API from the terminal:

!pip install kaggle

The next step is download the dataset using Kaggle API:

!kaggle datasets download -d juanmerinobermejo/laptops-price-dataset
# if necessary, use the option "-p <your_pathfile>" to specify the folder location where 
# the dataset will be downloaded

To unzip the files, we can perform the following commands:

!unzip -o laptops-price-dataset.zip