2026-03-15

Introduction & Motivation

Welcome to the Diamond Price Estimator & Explorer!

Purchasing a diamond can be an overwhelming and expensive experience. Prices fluctuate wildly based on multiple interacting factors.

  • This application solves that problem by providing a data-driven, real-time price estimation tool.
  • It moves beyond simple single-variable models by utilizing a robust multivariable linear regression approach.
  • Target Audience: Jewelry buyers, analysts, and anyone interested in evaluating diamond market value.

Application Architecture

The Shiny application is built to be both powerful and user-friendly.

Inputs (The 4 Cs): - Carat: Numeric slider input for the diamond’s weight. - Cut, Color, Clarity: Dropdown selection widgets for quality attributes.

Server Operations: - Dynamically calculates the predicted price using a pre-trained lm() model. - Filters a dataset of ~54,000 diamonds to match user inputs. - Renders an interactive ggplot2 visualization contrasting the specific prediction against market distribution.

Evaluating the Model (Embedded R Code)

The app’s server uses the diamonds dataset from the ggplot2 package. Here is the actual multivariable regression model evaluated directly in this presentation:

library(ggplot2)
# Train the model on the 4 Cs
fit <- lm(price ~ carat + cut + color + clarity, data = diamonds)
# Display the R-squared value to prove model accuracy
summary(fit)$r.squared
## [1] 0.9159406

As shown by the evaluated R expression above, the model explains over 91.5% of the variance in diamond prices!

Data Visualization (Embedded R Plot)

To prove the complexity and novelty of this project, here is an evaluated R plot showing how price varies across Cut and Color, which the app visualizes dynamically:

Thank you! Feel free to test the Shiny app yourself.