March 2019
Beginner to intermediate
448 pages
13h 14m
English
In this exercise, we will use gradient boosting with a real dataset containing wine types. Here we will have three classes, and they are slightly imbalanced:
library(MASS)library(PRROC)library(precrec)set.seed(10)data = read.csv("./approved.csv")data = data[,-c(1,7)]data$Approved_ = "not_approved"data$Approved_[data$Approved == 1] <- "approved"data$Approved_ = as.factor(data$Approved_)data = data[,-1]
trainIndex <- createDataPartition(data$Approved_, p = .75, list = FALSE, times = 1) traindata <- data[trainIndex,] testdata <- data[-trainIndex,]
Read now
Unlock full access