Skip to content

Predicting diamond prices based on several supervised machine learning algorithms

Notifications You must be signed in to change notification settings

kerim-kilic/diamond-price-prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Diamond price prediction algorithms

The R and R Markdown code in this respository covers several supervised machine learning algorithms to predict the price of diamonds. It includes linear regression using lm, generalized linear regression using glmnet, random forest using the ranger engine, and deeplearning using keras.

The diamond-price-prediction.Rmd Markdown file in this repository analyzes the diamonds dataset from the tidymodels library, trains several machine learning models and crossvalidates and tunes them for the optimal performance.

Requirements

The R script requires the following packages and their requirements:

library(tidymodels)
library(GGally)
library(gridExtra)

Settings

In the ggpairs plot eval is set to FALSE to decrease time to knit the document. Set eval to TRUE to plot the correlation plots of the variables.

{r, out.width='100%', fig.height=7, eval=FALSE}

Results

The table below shows the result of the R-Squared values for the four different supervised machine learning models:

Engine Model R-Squared Value
ranger random forest 0.984
lm Linear regression 0.965
glmnet Generalized linear regression 0.965
keras Deep Learning 0.965

Releases

No releases published

Packages

No packages published