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 > R Shiny > Value-based PC Part Selection

Value-based PC Part Selection

Sam O'Mullane
Posted on May 14, 2017

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

The final PC build application can be accessed via this link.

For people looking for more power and upgradability than a laptop can provide, desktop computers offer a reasonable alternative. Unfortunately, the pre-built computers that major manufacturers sell are considerably overpriced considering the quality of their components. For example, gaming computers will come with high end processors and graphics cards packaged with the cheapest available power unit and motherboard. Cutting corners does not make much sense when it can lead to your computer bursting into flames.

What's the alternative? Build your own PC!

Without prior experience, entering the world of desktop computers can be daunting without guidance. To begin, how do we know that this collection of parts will function properly when assembled? There are eight key components that comprise the core of a PC build, as shown in the basic chart below.

Example compatibility between various PC parts

Basic compatibility chart for PC components

In the past, consumers would have to carefully read product pages and spec sheets to be roughly 90% certain that everything would work together. Enter PCPartPicker.com. In mid-2014, PCPartPicker became the go to site for checking compatibility between all parts of a build. As of January 2017, this site was valued at $1.9 million with roughly 860,000 daily page views.

The other obstacle to PC building is finding "value", i.e. parts that are reliable and produce the promised specifications (specs). As of now, the only way to find value was to use a build guide that gives suggestions about trusted brands. These can be biased heavily by popularity and do not inform the consumer where generics are just as good as name-brands.

Motivation: make value-based PC part selection easier via an automated recommendation engine

Scraping PCPartPicker with PhantomJS and BeautifulSoup

To build such a recommendation engine, we need data on each available product. Since PCPartPicker contains specifications and ratings on all relevant components, as well as updated prices from major retailers, it is the logical choice to scrape for information. Combining simple PhantomJS, bash, and BeautifulSoup scripts made this process relatively quick and easy.

First, gather all of the product URLs from each subcategory page (here for the CPU subcategory):

Next, parse each product URL and append it to a compilation file:

Finally, use the scraped URLs to scrape each individual product page:

After all of this scraping the end product is a collection of pages such as the one below (in raw HTML format). Of specific interest for this project:

  1. Name: the product name, sometimes containing information not found elsewhere on the page
  2. Ratings: average value and number of ratings on PCPartPicker
  3. Specifications: a ragged list of features for each component, varying wildly in content
  4. Price: the lowest value of the Prices table minus one cent and not accounting for shipping

Data preparation and value analysis with Pandas

The data produced from the scraping process was relatively unstructured and extraction of specifications required RegEx and unit conversion. Since this is a standard and well-covered process, I won't delve into the details here.

More interesting is the determination of the most valuable quantities for each component. A link to the slides containing analysis can be found in the sidebar of the final application.

Example analysis: Memory

Random access memory (RAM, memory) is on-motherboard storage used for quick access of frequently used data. In simple terms, having more RAM means that your computer can run more processes/applications at the same time without slowing down.

For desktop computers, RAM is sold in sticks with capacity between 2 and 32GB. Typically 2 sticks are used for dual-channel mode which increases the overall performance, i.e. 2 sticks of 4GB run faster than 1 stick of 8GB RAM. While other components such as CPU and GPU have only two or three competing companies, RAM seems to have more options. Can the scraped data tell us what to look for in terms of RAM value?

Below is the correlation heatmap for the memory dataframe. The most significant take away is the extremely strong correlation (0.94) between the product price ($) and the total memory (GB). The presumption from this chart is that there is limited advantage to buying higher priced RAM, especially considering the marginal correlation (0.19) between price and rating value.

Correlation heatmap for memory dataframe

Our suspicions are confirmed when plotting total memory v. price in a scatterplot. We see that this strong correlation is reinforced by a strong linear relationship. Highlighted in red is the effect of branding: selling a product with similar specifications at a higher price than other manufacturers. In essence, there is limited advantage to paying for a name-brand RAM supplier: it is better to get the cheapest possible RAM.

Scatterplot: total memory v. price

As mentioned there is no "trusted name" in RAM production. Logically the above relationship makes sense since more competitors should lead to lower prices for the consumer assuming that production is relatively trivial.

Database formation and querying with SQL

Instead of reading the entirety of our data into memory every time we want to return a build recommendation, we can save our cleaned datasets into a SQL database. This way elements can be queried as needed, i.e. returning one compatible component instead of the entire collection. The SQLAlchemy (create_engine) and Pandas (to_sql) packages makes this process straight-forward in Python:

Here we have created 8 distinct tables in the pcpart.db which we can query in R using the RSQLite package. Specifically, we can formulate a general SQL query as shown below.

Notes:

  1. Spec_vec contains the column names we want to get from the table of interest
  2. Filter_str contains any conditions that need to be placed on the component of interest (e.g. price > 0 by default)

Building a recommendation engine with Shiny

The problem of selecting compatible parts for a PC build can be described theoretically via graph theory. The eight core components and their compatibility form an undirected graph where the motherboard (6 edges) and the CPU (4 edges) are the most significant nodes. The PSU is linked to all other parts by the relation that the PSU must output more wattage than the sum of the other components. In practice, the majority of PSUs can handle all possible combinations of other components with ease and thus the links between PSU and other components are weak.

There are now two possible components that can be the starting point of our build selection: the motherboard or CPU. Since the motherboard has few numerical specifications that can be easily translated to value, I selected the CPU as the "pivot point": the component that is selected first which influences the choice of every other component.

Once the CPU is selected, the motherboard is determined via socket compatibility and the remaining components are selected in parallel, assuring compatibility of the final build. In practice, this means that our parameter space has been greatly reduced (for better or worse) by selecting CPU from a smaller pool of high value/high rating/high spec components. If we want to map the entire parameter space of builds to find overall build value, we would need to construct an algorithm to loop through all CPUs and record all possible build combinations. Alternatively, we could pivot on a different component (such as the motherboard) and compare build value to see if one is more comprehensive or preferable than the other.

There are currently three operational modes for the recommendation engine with various levels of implementation.

  1. Rating-first
  2. Spec-first
  3. Price-first

Rating-first

This is the simplest mode: after compatibility is ensured, the highest rated component is selected. In the default state of the app, this mode can be accessed by sliding each component's 'rating weight' slider to the 1 position.

This option is most useful for components where value is harder to determine: motherboards and cases. By putting price limits on these components, an appropriate choice can be selected.

Spec-first

The default value of the application is spec-first: select the highest value component after compatibility is ensured.

For the majority of components we can assign a numeric variable which indicates the objective value. In this early-stage of development, value is determined by the most significant numeric factors of each component and implemented by SQL "order by" commands. Given more time, a rigorous algorithm for determining value of each component would be developed, ideally with an overall price filter to generate the best build per dollar value.

Price-first

As is implied, price-first selects each component first by compatibility, then price, and finally by rating or spec value. This can be enabled in the app at the bottom of the first filter tab via the "price priority" checkbox.

While most restrictive, this option has the most value to a potential user: rating values and price ranges can be adjusted to generate more realistic builds than can be produced with the first two modes.

Example Usage

  • Enable "price priority"
  • Note that 2GB of memory is unacceptable for a modern operating system
    • Increase the price minimum to ~$25 for 4GB
    • Increase the price minimum to ~$50 for 8GB
  • Change the PSU to fully modular with Bronze efficiency
    • Produces a good quality, cheap unit for only $35
  • Increase the minimum rating on all components slider to get a well reviewed CPU and motherboard
  • Remove the overclockable filter on GPUs to reduce the price on that component

Final result: $283 build with an average customer rating of 4.41

In practice, it would be useful to have a couple of dropdown choices for parts of interest such as CPU and GPU so that the user could generate compatible value-based builds with those selections in mind. For now, these users could use this tool to assess the value of other components.

Future development will focus on improving the algorithm for value-based selection and implementing user interaction as mentioned above. Another possible development route would include setting use-based filters such as high-end gaming, web-browsing-only, etc.

About Author

Sam O'Mullane

Sam O'Mullane is a multidisciplinary scientist who is passionate about making data science accessible to a wide audience. Sam received his MSc in Quantum Fields and Fundamental Forces from Imperial College London (Th. Physics) in 2013 and PhD...
View all posts by Sam O'Mullane >

Related Articles

AWS
Automated Data Extraction and Transformation Using Python, OpenAI, and AWS
Data Visualization
Linkedin: Exploring the Background of a Data Scientist
Python
Web Scraping USAID for non-country-specific Recipients
Python
Data Scraping and Exploring +600,000 Indeed Company Reviews
Python
Data Analysis on IT Jobs Demand

Leave a Comment

Cancel reply

You must be logged in to post a comment.

www.season7gameofthronesonline.com August 18, 2017
I think Arya now have her eyes set on Littlefinger though Littlefinger has somehow mislead Arya onto Sansa but I don't think there will be a fight between the two ladies. Game of Thrones Season 7 Stream

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