Reproducible Pitch for Diamond Price Prediction App

GeoRic
08/12/2020

Diamond Price Prediction App

  • The Diamond Price Prediction App was designed as a Shiny Application using RStudio.
  • The app allows a user to input various characteristics of a diamond to get a price prediction.
  • Diamond Characteristics include:
    = Carat Size (numeric value that increases by a factor of .01)
    = Cut (ranges from 'Ideal' to 'Fair')
    = Color (ranges from 'Colorless D' to 'Near Colorless J')
    = Clarity (ranges from 'Flawless' to 'Included')
  • The app uses prediction algorithm to determine a price
  • The application generates a plot to show the price (y axis), carat size (x axis) for the selected cut, color and clarity.
  • A regression line is added to give users an idea of the value for varying carat size and/or price changes.

Application & User Files

  • The shiny web application conistst of 2 main files (ui.R & server.R) held in the following GitHub Repository
  • The GitHub respository also contains a file called User_Document.md which provides the step by step instructions for using the application.

Application Algorithm (R Codes)

In this application, the predicted values will be based off the actual data from the Diamonds dataset. The r codes below represents the plot of the actual prices in relation to carat size and cut. This will be the basis for creating the prediction model.

library(ggplot2)
ggplot(aes(x = carat, y = price), data = diamonds) + 
  geom_point(alpha = 0.5, size = 1, position = 'jitter',aes(color=cut)) +
  ggtitle('Price by Carat Size and Cut')

Plot of Actual Price by Carat Size and Cut

plot of chunk unnamed-chunk-3