NYC Data Science Academy| Blog
Bootcamps
Lifetime Job Support Available Financing Available
Bootcamps
Data Science with Machine Learning Flagship ๐Ÿ† Data Analytics Bootcamp Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lesson
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories Testimonials Alumni Directory Alumni Exclusive Study Program
Courses
View Bundled Courses
Financing Available
Bootcamp Prep Popular ๐Ÿ”ฅ Data Science Mastery Data Science Launchpad with Python View AI Courses Generative AI for Everyone New ๐ŸŽ‰ Generative AI for Finance New ๐ŸŽ‰ Generative AI for Marketing New ๐ŸŽ‰
Bundle Up
Learn More and Save More
Combination of data science courses.
View Data Science Courses
Beginner
Introductory Python
Intermediate
Data Science Python: Data Analysis and Visualization Popular ๐Ÿ”ฅ Data Science R: Data Analysis and Visualization
Advanced
Data Science Python: Machine Learning Popular ๐Ÿ”ฅ Data Science R: Machine Learning Designing and Implementing Production MLOps New ๐ŸŽ‰ Natural Language Processing for Production (NLP) New ๐ŸŽ‰
Find Inspiration
Get Course Recommendation Must Try ๐Ÿ’Ž An Ultimate Guide to Become a Data Scientist
For Companies
For Companies
Corporate Offerings Hiring Partners Candidate Portfolio Hire Our Graduates
Students Work
Students Work
All Posts Capstone Data Visualization Machine Learning Python Projects R Projects
Tutorials
About
About
About Us Accreditation Contact Us Join Us FAQ Webinars Subscription An Ultimate Guide to
Become a Data Scientist
    Login
NYC Data Science Acedemy
Bootcamps
Courses
Students Work
About
Bootcamps
Bootcamps
Data Science with Machine Learning Flagship
Data Analytics Bootcamp
Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lessons
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook
Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories
Testimonials
Alumni Directory
Alumni Exclusive Study Program
Courses
Bundles
financing available
View All Bundles
Bootcamp Prep
Data Science Mastery
Data Science Launchpad with Python NEW!
View AI Courses
Generative AI for Everyone
Generative AI for Finance
Generative AI for Marketing
View Data Science Courses
View All Professional Development Courses
Beginner
Introductory Python
Intermediate
Python: Data Analysis and Visualization
R: Data Analysis and Visualization
Advanced
Python: Machine Learning
R: Machine Learning
Designing and Implementing Production MLOps
Natural Language Processing for Production (NLP)
For Companies
Corporate Offerings
Hiring Partners
Candidate Portfolio
Hire Our Graduates
Students Work
All Posts
Capstone
Data Visualization
Machine Learning
Python Projects
R Projects
About
Accreditation
About Us
Contact Us
Join Us
FAQ
Webinars
Subscription
An Ultimate Guide to Become a Data Scientist
Tutorials
Data Analytics
  • Learn Pandas
  • Learn NumPy
  • Learn SciPy
  • Learn Matplotlib
Machine Learning
  • Boosting
  • Random Forest
  • Linear Regression
  • Decision Tree
  • PCA
Interview by Companies
  • JPMC
  • Google
  • Facebook
Artificial Intelligence
  • Learn Generative AI
  • Learn ChatGPT-3.5
  • Learn ChatGPT-4
  • Learn Google Bard
Coding
  • Learn Python
  • Learn SQL
  • Learn MySQL
  • Learn NoSQL
  • Learn PySpark
  • Learn PyTorch
Interview Questions
  • Python Hard
  • R Easy
  • R Hard
  • SQL Easy
  • SQL Hard
  • Python Easy
Data Science Blog > Machine Learning > Laptop Recommendation Machine Learning System

Laptop Recommendation Machine Learning System

Jayce Jiang
Posted on Sep 24, 2019

Have you wonders what makes a laptop expensive? Which specs have the most significant impact on the price? I will be answering these questions through machine learning.

Introduction

Laptop has become one of the most essential and used items in our daily life. However, I am sure that you have struggled to choose the personal laptop that fits your needs? With the overwhelming amount of specifications and brand names on the market, it becomes difficult for laptop makers to sell their products and for customers to pick their laptop.

Why should we care about this problem? In 2019, estimable of 166 million units of laptops were sold and shipped in 2019 (International Data Corporation). The average selling price for a laptop sits at around 629 U.S. Dollars. The global laptop market size is calculated to be around 100 billion dollars and with an anticipated market size of 108.9 billion by 2025, according to a study by Grand View Research. Laptops will continue to rise in demand as growing spending capacities of consumers and upsurge in demand for technologically advanced products. As laptops are selling across the world, people and manufacturers alike will have to be knowledgeable and competitive.

Project Motivation:

  1. Quantify what quantity quality of a laptop contributes the most across the 3 categories of laptop.
  2. Discover laptop trends across different brands, types, and performances.
  3. Predict laptop prices base on quantity quality such as ram space, storage amount and type, CPU and GPU relative performance, brand, type, and screen size.
  4. KNN Recommendation System - laptop recommendation based on specifications.

Data Acquisition: Web Scraping

The amount of scraping needed to scrape the target market are insurmountable. To simplify the analysis and data collections, I decided to focus mainly on three categories of laptop data to gather: Personal, Business, and Gaming. For the machining learning perspective, I scrape my training datasets from Newegg and BestBuy, and my test datasets from B&H Photovideo.

From these three websites, I scrape the specifications and price of three categories of laptop. Specifications from the lap ranges from their screen size to their refresh rate to their CPU. Fig 1 shows the field of data I scrape from Newegg, Bestbuy, and B&H Video. In total, there were around 10 datasets from the three websites, and each of the datasets was around 1000-4000 rows and 40 columns. With a total of around 20000 rows and 40 columns.

Data Cleaning:

As expected, datasets from different website has different formatting and columns name for the data. For example, in the Newegg datasets (Fig.2), there are a total of 38 columns and 6000 rows. To simplify the cleaning process, I combine the personal, business, and gaming laptop datasets from the same website into one data frame.

(Fig.2)

First, I take a look at the total number of missing values and fill some missing values based on logical principles. For instance, I replace all missing SSD and HDD with zero, because some computers do not have an SSD or HDD. Besides, the majority of personal computers does not contain a dedicated graphics card; therefore, I replace those with 0 and compare them in a different category. After filling in as many missing values as I can, I remove all columns with more than 10% missing values, shown in Fig.3.

Then, I remove all row with null CPU, RAM, and 0 total storage capacity, because no computer can run with a CPU, storage, and RAM. These randomly missing data are due to new products where specs are not available or/and employees did not post the specs according to the posting guidelines.

Next, I check the type of variable in each column, and almost all columns are string objects. Thus, the cleaning process begins, I converted every column that has a number, such as the weight, storage, dimension, screen size, etc. into quantitative variables.

The computer algorithm has a hard time understanding words such as intel 9720X and Nvidia GTX1080. What is next is convert CPU and GPU string into a quantitative figure. To convert GPU and CPU into standard benchmark data, I scrape cpubenchmark.net/ and videocardbenchmark.net/ to get all of the respective benchmark numbers. (Shown in Fig.4)

Fig.4 A sample of the CPU benchmark score

I use the Knuth-Morris-Pratt string search algorithm to maximum efficiency of the search algorithm and manage to convert around 99% of the CPU and GPU column into actual benchmarks. With this step completed, some visualizations are created using python's Seaborn package.

Data Visualization and Trend Discussion

Brand Price Trend

The brand trend for the three different types of laptops: business, personal, and gaming.

For Business laptops, Apple and Lenovo have the highest mean and median price. It is not surprising since Lenovo owns Thinkpads and apple have their 13.3 and 15 inches MacBook Pro line. Dell, HP, and Acer, these three brands have a much lower average laptop price. It makes sense since these three companies are known for cheaper and has a much more traditional laptop feel and design.

For Gaming laptops, it is no surprise, in the year 2019, Razer, Gigabyte and Alienware have the highest mean and median price in the gaming category. Razer blade laptop and Alienware have dominated the high-end gaming laptop market for years. There are, however, many outliers in this category of laptop. For example, MSI, ASUS, Razer, and Gigabyte all have that one series of super-high-end laptops that gear toward these customers.

For Personal laptops, again, expensive brand laptops such as Razer, Gigabyte, Alienware, Apple, and MSI are amount the top 5 of the highest mean and median price laptops. While austere style personal laptops are majority controlled by brands such as HP, Huawei, Lenovo, Dell, Asus, and Acer.


Screen Size Frequency

In 2019, the preferred screen size is 15.6 inches for all three types of laptop. It is not a surprise to see no gaming laptop below 15.6 inches since gaming below the 15.6 inches ruining the gaming experiences. Also, there are very few business laptops that around 15.6 inches, because portability is a high valued specification in the work environment. Finally, for the laptop listed in 2019, there are very few that are below the screen size of 13.3 inches.

CPU and GPU regression graph vs. Weight

The weight and performance of a laptop are one of the most crucial specification customer looks for. As one can expect, the heavier the laptop, the performance of CPU and GPU also increases. More space and weight means faster and better hardware. However, in 2019, the high-end laptop is no longer as constricted as before; there are many high-speed CPU available for between the 2 to 4 lbs. (SUPER LIGHT).

On the other hand, if one is looking at the GPU, there is still a limitation on 2019's technology. If you are looking for a high-gear GPU, the lowest weight is around 4 lbs. As expected, the laptop's graphics card takes precious space and other additional hardware, such as fans, to properly function. Thus, the weight limitation for high-end GPU laptop in 2019 is around 4 lbs.

CPU and GPU regression graph vs. Price Trend

CPU and GPU benchmarks are directly proportional to the price of the laptop. However, it is possible in 2019 to purchase highly CPU and GPU focus laptop for around the 1000 dollar range. This is a prime example of Moore's Exponential Growth Law. Around 8 years ago, a 3000 dollars laptop would only get a CPU and GPU of benchmark around 2500 and 2000. In 2019, one can expect a CPU and GPU benchmark around 21000 and 19000, respectively. Around a 10X increase in just 8 years.

Use Machine Learning to predict price and build a recommendation

Price Prediction and Model Accuracy

I want to see if a laptop from Newegg and Bestbuy can accurately predict the price of the laptop from B&H VideoPhoto. Before fitting a linear model, I first dummify some of the variables and created custom featuring engineering to reduce the complexity of the model. Then, I normalize all variables with a skewness higher than 0.15. Then I split the data into training and test set, using Newegg and Bestbuy laptop as the training set, and using B&H VideoPhoto as another. I want to see if the model can predict laptop prices across the websites.

Ridge Linear Regression

XBGboosting Regression

The first image was the residual plot from using Ridge Linear Regression after parameter tuning using grid search cross-validation; it receives an r^2 of 0.69.

The second image was the residual plot from XBGboosting Regression. After parameter tuning using a 5-fold cv grid search, it receives a model score of 0.79 on the testing data.

From these two residual plots of these two models, one can see that there are a couple of outliers that completely throw both models entirely off. However, overall, both models perform fairly decent and further suggest that all three website has very similar prices laptop.

K-Nearest Neighbor Recommender

With the linear model, we were able to predict the price of the computer-based on its spec. The next thing that interests me was to build a recommendation system based using a K-Nearest K Nearest Neighbors model. K-nearest neighbors which rely on euclidean distance requires data to be scale.

I use Min Max Scalers to scale my dataset before putting it in the KNN model.

Critical points on Min-Max Scalers:

  • We subtract the min from all values and marking a scale from Min to Max.
  • Divide it by the difference between Min and Max
  • Result is that our values will go from zero to 1
  • Downside is that we will have lower standard deviations and it suppresses the effect of outliers

From the picture below, I was able to create a recommendation based on the user input. In this case, I was looking for a 15.6inch MSI gaming lapto

I check the recommendations and well, it works! It recommended my current laptop that I research for a few weeks to get. To my surprise, despite such a simple approach, the recommender does pick up the difference between different laptop specs.

Future Work

In the interest of further analyzing other factors that increase/decrease laptop price and understand review affect on laptop price, it would be of interest to:

  1. Scrape the average rating and review a summary of each laptop and use sentimental analysis to rank each of the laptops.
  2. Create more feature engineering relating different specifications, such as whether the laptop contains a USB-C port or what version of Bluetooth support.
  3. Use and test different types of scalers on the data-set and understand its effect on the model prediction.

Jayce is currently working on these new data science projects. If you are a huge basketball fan or just a data nerd, check out his basketball player cluster analysis and NBA player comparison tool.

The skills the authors demonstrated here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.

About Author

Jayce Jiang

Jayce Jiang is previously an NYC Data Science Fellow and Data Engineer with a Dual Bachelors Degree in Aerospace and Mechanical Engineering from the University of Florida. He currently a founder of Strictly By The Numbers, www.strictlybythenumbers.com, and...
View all posts by Jayce Jiang >

Leave a Comment

Cancel reply

You must be logged in to post a comment.

No comments found.

View Posts by Categories

All Posts 2399 posts
AI 7 posts
AI Agent 2 posts
AI-based hotel recommendation 1 posts
AIForGood 1 posts
Alumni 60 posts
Animated Maps 1 posts
APIs 41 posts
Artificial Intelligence 2 posts
Artificial Intelligence 2 posts
AWS 13 posts
Banking 1 posts
Big Data 50 posts
Branch Analysis 1 posts
Capstone 206 posts
Career Education 7 posts
CLIP 1 posts
Community 72 posts
Congestion Zone 1 posts
Content Recommendation 1 posts
Cosine SImilarity 1 posts
Data Analysis 5 posts
Data Engineering 1 posts
Data Engineering 3 posts
Data Science 7 posts
Data Science News and Sharing 73 posts
Data Visualization 324 posts
Events 5 posts
Featured 37 posts
Function calling 1 posts
FutureTech 1 posts
Generative AI 5 posts
Hadoop 13 posts
Image Classification 1 posts
Innovation 2 posts
Kmeans Cluster 1 posts
LLM 6 posts
Machine Learning 364 posts
Marketing 1 posts
Meetup 144 posts
MLOPs 1 posts
Model Deployment 1 posts
Nagamas69 1 posts
NLP 1 posts
OpenAI 5 posts
OpenNYC Data 1 posts
pySpark 1 posts
Python 16 posts
Python 458 posts
Python data analysis 4 posts
Python Shiny 2 posts
R 404 posts
R Data Analysis 1 posts
R Shiny 560 posts
R Visualization 445 posts
RAG 1 posts
RoBERTa 1 posts
semantic rearch 2 posts
Spark 17 posts
SQL 1 posts
Streamlit 2 posts
Student Works 1687 posts
Tableau 12 posts
TensorFlow 3 posts
Traffic 1 posts
User Preference Modeling 1 posts
Vector database 2 posts
Web Scraping 483 posts
wukong138 1 posts

Our Recent Popular Posts

AI 4 AI: ChatGPT Unifies My Blog Posts
by Vinod Chugani
Dec 18, 2022
Meet Your Machine Learning Mentors: Kyle Gallatin
by Vivian Zhang
Nov 4, 2020
NICU Admissions and CCHD: Predicting Based on Data Analysis
by Paul Lee, Aron Berke, Bee Kim, Bettina Meier and Ira Villar
Jan 7, 2020

View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day ChatGPT citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay football gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income industry Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI

NYC Data Science Academy

NYC Data Science Academy teaches data science, trains companies and their employees to better profit from data, excels at big data project consulting, and connects trained Data Scientists to our industry.

NYC Data Science Academy is licensed by New York State Education Department.

Get detailed curriculum information about our
amazing bootcamp!

Please enter a valid email address
Sign up completed. Thank you!

Offerings

  • HOME
  • DATA SCIENCE BOOTCAMP
  • ONLINE DATA SCIENCE BOOTCAMP
  • Professional Development Courses
  • CORPORATE OFFERINGS
  • HIRING PARTNERS
  • About

  • About Us
  • Alumni
  • Blog
  • FAQ
  • Contact Us
  • Refund Policy
  • Join Us
  • SOCIAL MEDIA

    ยฉ 2025 NYC Data Science Academy
    All rights reserved. | Site Map
    Privacy Policy | Terms of Service
    Bootcamp Application