Tom Chęckiewicz
05 OCTOBER 2016
This application has been developed as Coursera Data Products course project, which is a part of Data Science specialisation.
The main purpose of the application is to use the predictive model, designed and developed based on GaltonFamilies data set and Random Forest machine learning algorithm in order to peredict child's height based on the following features:
The predictive model used in the application, processes GaltonFamilies data set as an input data. This data set is part of HistData library in R.
Random Forest Machine Learning algorithm has beed applied to train the predictive model for the application.
library(HistData)
library(plyr)
library(dplyr)
library(caret)
library(ranger)
df <- tbl_df(GaltonFamilies)
#Splitting the data set into training and testing
inTrain <- createDataPartition(df$childHeight, p=.7, list = FALSE)
training <- df[inTrain, ]
testing <- df[-inTrain, ]
#Training the model
train_Control <- trainControl(method = "cv", number = 5, allowParallel = TRUE)
ModFit_RF <- train(childHeight~., data=training, method="ranger", trControl=train_Control)
saveRDS(ModFit_RF, "./ModFit_RF.rds")
The ui.R part of the application utilises the following input widgets in order to collect data points necessary to apply the predictive model:
numericInput which collects the numeric data about Father's Height, Mother's Height, Number of children in your family and Number of this child within family
radioButtons which collects the category of child's gender
submitButton which gives the users a control over triggering the reactive calculations within server.R
Based on the input data collected by input Widgets within ui.R, the server part of the application calls ModFit_RF predictive model, stored in the application folder in order to generate as an output:
Application Links and Code repository
The application has been deployed on RStudio shinyapps.io server and available under the following link:
(https://oli2.shinyapps.io/Predict_Your_Child_Height/)
The application ui.R and server.R files as well as the ModFit_RF predictive model are available on Github here: