This RMarkdown file contains the report of the data analysis done for the project on building and deploying a stroke prediction model in R. It contains analysis such as data exploration, summary statistics and building the prediction models.
Data Description:
According to the World Health Organization (WHO) stroke is the 2nd leading cause of death globally, responsible for approximately 11% of total deaths.
This data set is used to predict whether a patient is likely to get stroke based on the input parameters like gender, age, various diseases, and smoking status. Each row in the data provides relevant information about the patient.
## DATA PREPARATION
# Load necessary libraries
library(readr)
## Warning: package 'readr' was built under R version 4.1.3
library(dplyr)
## Warning: package 'dplyr' was built under R version 4.1.3
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(caret)
## Warning: package 'caret' was built under R version 4.1.2
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 4.1.2
## Loading required package: lattice
library(xgboost)
## Warning: package 'xgboost' was built under R version 4.1.3
##
## Attaching package: 'xgboost'
## The following object is masked from 'package:dplyr':
##
## slice
library(ggplot2)
library(gridExtra)
## Warning: package 'gridExtra' was built under R version 4.1.2
##
## Attaching package: 'gridExtra'
## The following object is masked from 'package:dplyr':
##
## combine
library(RColorBrewer)
## Warning: package 'RColorBrewer' was built under R version 4.1.3
library(reshape2)
## Warning: package 'reshape2' was built under R version 4.1.2
library(tidyr)
## Warning: package 'tidyr' was built under R version 4.1.3
##
## Attaching package: 'tidyr'
## The following object is masked from 'package:reshape2':
##
## smiths
# Suppress warnings
options(warn=-1)
# Load the dataset
data_stroke <- read_csv("D:\\6 PORTOFOLIO\\PORTOFOLIO\\Data\\stroke-prediction\\healthcare-dataset-stroke-data.csv")
## Rows: 5110 Columns: 12
## -- Column specification --------------------------------------------------------
## Delimiter: ","
## chr (6): gender, ever_married, work_type, Residence_type, bmi, smoking_status
## dbl (6): id, age, hypertension, heart_disease, avg_glucose_level, stroke
##
## i Use `spec()` to retrieve the full column specification for this data.
## i Specify the column types or set `show_col_types = FALSE` to quiet this message.
head(data_stroke)
## # A tibble: 6 x 12
## id gender age hypertension heart_disease ever_married work_type
## <dbl> <chr> <dbl> <dbl> <dbl> <chr> <chr>
## 1 9046 Male 67 0 1 Yes Private
## 2 51676 Female 61 0 0 Yes Self-employed
## 3 31112 Male 80 0 1 Yes Private
## 4 60182 Female 49 0 0 Yes Private
## 5 1665 Female 79 1 0 Yes Self-employed
## 6 56669 Male 81 0 0 Yes Private
## # i 5 more variables: Residence_type <chr>, avg_glucose_level <dbl>, bmi <chr>,
## # smoking_status <chr>, stroke <dbl>
# Check the data types
str(data_stroke)
## spc_tbl_ [5,110 x 12] (S3: spec_tbl_df/tbl_df/tbl/data.frame)
## $ id : num [1:5110] 9046 51676 31112 60182 1665 ...
## $ gender : chr [1:5110] "Male" "Female" "Male" "Female" ...
## $ age : num [1:5110] 67 61 80 49 79 81 74 69 59 78 ...
## $ hypertension : num [1:5110] 0 0 0 0 1 0 1 0 0 0 ...
## $ heart_disease : num [1:5110] 1 0 1 0 0 0 1 0 0 0 ...
## $ ever_married : chr [1:5110] "Yes" "Yes" "Yes" "Yes" ...
## $ work_type : chr [1:5110] "Private" "Self-employed" "Private" "Private" ...
## $ Residence_type : chr [1:5110] "Urban" "Rural" "Rural" "Urban" ...
## $ avg_glucose_level: num [1:5110] 229 202 106 171 174 ...
## $ bmi : chr [1:5110] "36.6" "N/A" "32.5" "34.4" ...
## $ smoking_status : chr [1:5110] "formerly smoked" "never smoked" "never smoked" "smokes" ...
## $ stroke : num [1:5110] 1 1 1 1 1 1 1 1 1 1 ...
## - attr(*, "spec")=
## .. cols(
## .. id = col_double(),
## .. gender = col_character(),
## .. age = col_double(),
## .. hypertension = col_double(),
## .. heart_disease = col_double(),
## .. ever_married = col_character(),
## .. work_type = col_character(),
## .. Residence_type = col_character(),
## .. avg_glucose_level = col_double(),
## .. bmi = col_character(),
## .. smoking_status = col_character(),
## .. stroke = col_double()
## .. )
## - attr(*, "problems")=<externalptr>
The BMI column is still in the chart type, so we will change it to an numeric and drop the ID column.
library(dplyr)
# Drop the 'id' column
data_stroke <- data_stroke %>% select(-id)
# BMI to Numerik
data_stroke$bmi <- as.numeric(ifelse(data_stroke$bmi == "N/A", NA, data_stroke$bmi))
str(data_stroke)
## tibble [5,110 x 11] (S3: tbl_df/tbl/data.frame)
## $ gender : chr [1:5110] "Male" "Female" "Male" "Female" ...
## $ age : num [1:5110] 67 61 80 49 79 81 74 69 59 78 ...
## $ hypertension : num [1:5110] 0 0 0 0 1 0 1 0 0 0 ...
## $ heart_disease : num [1:5110] 1 0 1 0 0 0 1 0 0 0 ...
## $ ever_married : chr [1:5110] "Yes" "Yes" "Yes" "Yes" ...
## $ work_type : chr [1:5110] "Private" "Self-employed" "Private" "Private" ...
## $ Residence_type : chr [1:5110] "Urban" "Rural" "Rural" "Urban" ...
## $ avg_glucose_level: num [1:5110] 229 202 106 171 174 ...
## $ bmi : num [1:5110] 36.6 NA 32.5 34.4 24 29 27.4 22.8 NA 24.2 ...
## $ smoking_status : chr [1:5110] "formerly smoked" "never smoked" "never smoked" "smokes" ...
## $ stroke : num [1:5110] 1 1 1 1 1 1 1 1 1 1 ...
# Print the number of missing values for each column
missing_values <- sapply(data_stroke, function(x) sum(is.na(x)))
missing_values
## gender age hypertension heart_disease
## 0 0 0 0
## ever_married work_type Residence_type avg_glucose_level
## 0 0 0 0
## bmi smoking_status stroke
## 201 0 0
The BMI column has a missing value, so we will fill the missing values with mean values.
# Fill bmi NA values with the mean of the column
data_stroke$bmi[is.na(data_stroke$bmi)] <- mean(data_stroke$bmi, na.rm = TRUE)
missing_values_fill <- sapply(data_stroke, function(x) sum(is.na(x)))
missing_values_fill
## gender age hypertension heart_disease
## 0 0 0 0
## ever_married work_type Residence_type avg_glucose_level
## 0 0 0 0
## bmi smoking_status stroke
## 0 0 0
summary(data_stroke)
## gender age hypertension heart_disease
## Length:5110 Min. : 0.08 Min. :0.00000 Min. :0.00000
## Class :character 1st Qu.:25.00 1st Qu.:0.00000 1st Qu.:0.00000
## Mode :character Median :45.00 Median :0.00000 Median :0.00000
## Mean :43.23 Mean :0.09746 Mean :0.05401
## 3rd Qu.:61.00 3rd Qu.:0.00000 3rd Qu.:0.00000
## Max. :82.00 Max. :1.00000 Max. :1.00000
## ever_married work_type Residence_type avg_glucose_level
## Length:5110 Length:5110 Length:5110 Min. : 55.12
## Class :character Class :character Class :character 1st Qu.: 77.25
## Mode :character Mode :character Mode :character Median : 91.89
## Mean :106.15
## 3rd Qu.:114.09
## Max. :271.74
## bmi smoking_status stroke
## Min. :10.30 Length:5110 Min. :0.00000
## 1st Qu.:23.80 Class :character 1st Qu.:0.00000
## Median :28.40 Mode :character Median :0.00000
## Mean :28.89 Mean :0.04873
## 3rd Qu.:32.80 3rd Qu.:0.00000
## Max. :97.60 Max. :1.00000
The age column has a minimum value of 0.08. If we consider the context where age is in years, we need to observe it in more detail.
# Checking for Unique value
unique_ages <- unique(data_stroke$age)
# Print unique values in the age column
print(unique_ages)
## [1] 67.00 61.00 80.00 49.00 79.00 81.00 74.00 69.00 59.00 78.00 54.00 50.00
## [13] 64.00 75.00 60.00 57.00 71.00 52.00 82.00 65.00 58.00 42.00 48.00 72.00
## [25] 63.00 76.00 39.00 77.00 73.00 56.00 45.00 70.00 66.00 51.00 43.00 68.00
## [37] 47.00 53.00 38.00 55.00 1.32 46.00 32.00 14.00 3.00 8.00 37.00 40.00
## [49] 35.00 20.00 44.00 25.00 27.00 23.00 17.00 13.00 4.00 16.00 22.00 30.00
## [61] 29.00 11.00 21.00 18.00 33.00 24.00 34.00 36.00 0.64 41.00 0.88 5.00
## [73] 26.00 31.00 7.00 12.00 62.00 2.00 9.00 15.00 28.00 10.00 1.80 0.32
## [85] 1.08 19.00 6.00 1.16 1.00 1.40 1.72 0.24 1.64 1.56 0.72 1.88
## [97] 1.24 0.80 0.40 0.08 1.48 0.56 0.48 0.16
We will round the numbers to the nearest to make them more relevant to the context of age in years.
# Round fractional values to the nearest integer
data_stroke$age <- round(data_stroke$age)
# Check unique values again
unique_ages_cleaned <- unique(data_stroke$age)
print(unique_ages_cleaned)
## [1] 67 61 80 49 79 81 74 69 59 78 54 50 64 75 60 57 71 52 82 65 58 42 48 72 63
## [26] 76 39 77 73 56 45 70 66 51 43 68 47 53 38 55 1 46 32 14 3 8 37 40 35 20
## [51] 44 25 27 23 17 13 4 16 22 30 29 11 21 18 33 24 34 36 41 5 26 31 7 12 62
## [76] 2 9 15 28 10 0 19 6
drop the 0 values
# Drop rows where age is 0
data_stroke <- subset(data_stroke, age != 0)
# Check unique values again
unique_ages_cleaned <- unique(data_stroke$age)
print(unique_ages_cleaned)
## [1] 67 61 80 49 79 81 74 69 59 78 54 50 64 75 60 57 71 52 82 65 58 42 48 72 63
## [26] 76 39 77 73 56 45 70 66 51 43 68 47 53 38 55 1 46 32 14 3 8 37 40 35 20
## [51] 44 25 27 23 17 13 4 16 22 30 29 11 21 18 33 24 34 36 41 5 26 31 7 12 62
## [76] 2 9 15 28 10 19 6
# Create a function to make pie plots for Smoking Status
# Filter data for smoking status
formerly_subset <- subset(data_stroke, smoking_status == "formerly smoked")
never_subset <- subset(data_stroke, smoking_status == "never smoked")
unknown_subset <- subset(data_stroke, smoking_status == "Unknown")
smokes_subset <- subset(data_stroke, smoking_status == "smokes")
Create pie plots for each ‘smoking_status’ category
# Function to create pie plots
create_pie_plot <- function(subset_df, title) {
counts <- table(subset_df$stroke)
percentages <- prop.table(counts) * 100
labels <- ifelse(names(counts) == "0", "No Stroke", "Stroke")
df <- data.frame(
category = names(counts),
count = as.vector(counts),
percent = percentages,
labels = labels
)
plot <- ggplot(df, aes(x = "", y = count, fill = category)) +
geom_bar(stat = "identity", width = 1) +
coord_polar(theta = "y") +
geom_text(aes(label = paste0(labels, " (", round(percentages, 1), "%)")), position = position_stack(vjust = 0.5), size = 2) +
theme_void() +
labs(title = title, fill = "Stroke") +
scale_fill_brewer(palette = "Pastel1") +
theme(legend.position = "none")
return(plot)
}
# Create pie plots for different work types
plot_formerly <- create_pie_plot(formerly_subset, "Formerly smoked")
plot_never <- create_pie_plot(never_subset, "Never Smoked")
plot_Unknown <- create_pie_plot(unknown_subset, "Unknown")
plot_smokes <- create_pie_plot(smokes_subset, "Smokes")
# Arrange the plots
grid.arrange(plot_formerly, plot_never, plot_smokes, plot_Unknown, ncol = 2, nrow = 2)
## Create a function to make pie plots for Gender
# Filter data for gender
male_subset <- subset(data_stroke, gender == "Male")
female_subset <- subset(data_stroke, gender == "Female")
# Function to create pie plots
create_pie_plot <- function(subset_df, title) {
counts <- table(subset_df$stroke)
percentages <- prop.table(counts) * 100
labels <- ifelse(names(counts) == "0", "No Stroke", "Stroke")
df <- data.frame(
category = names(counts),
count = as.vector(counts),
percent = percentages,
labels = labels
)
plot <- ggplot(df, aes(x = "", y = count, fill = category)) +
geom_bar(stat = "identity", width = 1) +
coord_polar(theta = "y") +
geom_text(aes(label = paste0(labels, " (", round(percentages, 1), "%)")), position = position_stack(vjust = 0.5), size = 2) +
theme_void() +
labs(title = title, fill = "Stroke") +
scale_fill_brewer(palette = "Pastel1") +
theme(legend.position = "none")
return(plot)
}
# Create pie plots for Male and Female Gender
plot_rural <- create_pie_plot(male_subset, "Male")
plot_urban <- create_pie_plot(female_subset, "female")
# Arrange the plots
grid.arrange(plot_rural, plot_urban, ncol = 2)
## Create a function to make pie plots for hypertension
# Filter data for hypertension
hypertension_subset_no <- subset(data_stroke, hypertension == "0")
hypertension_subset_yes <- subset(data_stroke, hypertension == "1")
# Function to create pie plots
create_pie_plot <- function(subset_df, title) {
counts <- table(subset_df$stroke)
percentages <- prop.table(counts) * 100
labels <- ifelse(names(counts) == "0", "No Stroke", "Stroke")
df <- data.frame(
category = names(counts),
count = as.vector(counts),
percent = percentages,
labels = labels
)
plot <- ggplot(df, aes(x = "", y = count, fill = category)) +
geom_bar(stat = "identity", width = 1) +
coord_polar(theta = "y") +
geom_text(aes(label = paste0(labels, " (", round(percentages, 1), "%)")), position = position_stack(vjust = 0.5), size = 2) +
theme_void() +
labs(title = title, fill = "Stroke") +
scale_fill_brewer(palette = "Pastel1") +
theme(legend.position = "none")
return(plot)
}
# Create pie plots for Male and Female Gender
plot_hypertension_no <- create_pie_plot(hypertension_subset_no, "Positive hypertension")
plot_hypertension_yes <- create_pie_plot(hypertension_subset_yes, "Negative hypertension")
# Arrange the plots
grid.arrange(plot_hypertension_no, plot_hypertension_yes, ncol = 2)
## Create a function to make pie plots for Heart Disease
# Filter data for hypertension
heart_disease_subset_no <- subset(data_stroke, heart_disease == "0")
heart_disease_subset_yes <- subset(data_stroke, heart_disease == "1")
# Function to create pie plots
create_pie_plot <- function(subset_df, title) {
counts <- table(subset_df$stroke)
percentages <- prop.table(counts) * 100
labels <- ifelse(names(counts) == "0", "No Stroke", "Stroke")
df <- data.frame(
category = names(counts),
count = as.vector(counts),
percent = percentages,
labels = labels
)
plot <- ggplot(df, aes(x = "", y = count, fill = category)) +
geom_bar(stat = "identity", width = 1) +
coord_polar(theta = "y") +
geom_text(aes(label = paste0(labels, " (", round(percentages, 1), "%)")), position = position_stack(vjust = 0.5), size = 2) +
theme_void() +
labs(title = title, fill = "Stroke") +
scale_fill_brewer(palette = "Pastel1") +
theme(legend.position = "none")
return(plot)
}
# Create pie plots for Male and Female Gender
plot_heart_disease_no <- create_pie_plot(heart_disease_subset_no, "No Heart Disease")
plot_heart_disease_yes <- create_pie_plot(heart_disease_subset_yes, "with Heart Disease")
# Arrange the plots
grid.arrange(plot_heart_disease_no, plot_heart_disease_yes, ncol = 2)
## Create a function to make pie plots for Work Types
# Filter data for different work types
private_subset <- subset(data_stroke, work_type == "Private")
self_employed_subset <- subset(data_stroke, work_type == "Self-employed")
children_subset <- subset(data_stroke, work_type == "children")
govt_job_subset <- subset(data_stroke, work_type == "Govt_job")
# Function to create pie plots
create_pie_plot <- function(subset_df, title) {
counts <- table(subset_df$stroke)
percentages <- prop.table(counts) * 100
labels <- ifelse(names(counts) == "0", "No Stroke", "Stroke")
df <- data.frame(
category = names(counts),
count = as.vector(counts),
percent = percentages,
labels = labels
)
plot <- ggplot(df, aes(x = "", y = count, fill = category)) +
geom_bar(stat = "identity", width = 1) +
coord_polar(theta = "y") +
geom_text(aes(label = paste0(labels, " (", round(percentages, 1), "%)")), position = position_stack(vjust = 0.5), size = 2) +
theme_void() +
labs(title = title, fill = "Stroke") +
scale_fill_brewer(palette = "Pastel1") +
theme(legend.position = "none")
return(plot)
}
# Create pie plots for different work types
plot_private <- create_pie_plot(private_subset, "Private")
plot_self_employed <- create_pie_plot(self_employed_subset, "Self-employed")
plot_children <- create_pie_plot(children_subset, "Children")
plot_govt_job <- create_pie_plot(govt_job_subset, "Govt_job")
# Arrange the plots
grid.arrange(plot_private, plot_self_employed, plot_children, plot_govt_job, ncol = 2, nrow = 2)
## Create a function to make pie plots for residence Types
# Filter data for Rural and Urban Residence_type
rural_subset <- subset(data_stroke, Residence_type == "Rural")
urban_subset <- subset(data_stroke, Residence_type == "Urban")
# Function to create pie plots
create_pie_plot <- function(subset_df, title) {
counts <- table(subset_df$stroke)
percentages <- prop.table(counts) * 100
labels <- ifelse(names(counts) == "0", "No Stroke", "Stroke")
df <- data.frame(
category = names(counts),
count = as.vector(counts),
percent = percentages,
labels = labels
)
plot <- ggplot(df, aes(x = "", y = count, fill = category)) +
geom_bar(stat = "identity", width = 1) +
coord_polar(theta = "y") +
geom_text(aes(label = paste0(labels, " (", round(percentages, 1), "%)")), position = position_stack(vjust = 0.5), size = 2) +
theme_void() +
labs(title = title, fill = "Stroke") +
scale_fill_brewer(palette = "Pastel1") +
theme(legend.position = "none")
return(plot)
}
# Create pie plots for Rural and Urban Residence_type
plot_rural <- create_pie_plot(rural_subset, "Live in Rural")
plot_urban <- create_pie_plot(urban_subset, "Live in Urban")
# Arrange the plots
grid.arrange(plot_rural, plot_urban, ncol = 2)
## Create a function to make pie plots for ever married
# Filter data for Not married and Yes married
not_married_subset <- subset(data_stroke, ever_married == "No")
yes_married_subset <- subset(data_stroke, ever_married == "Yes")
# Function to create pie plots
create_pie_plot <- function(subset_df, title) {
counts <- table(subset_df$stroke)
percentages <- prop.table(counts) * 100
labels <- ifelse(names(counts) == "0", "No Stroke", "Stroke")
df <- data.frame(
category = names(counts),
count = as.vector(counts),
percent = percentages,
labels = labels
)
plot <- ggplot(df, aes(x = "", y = count, fill = category)) +
geom_bar(stat = "identity", width = 1) +
coord_polar(theta = "y") +
geom_text(aes(label = paste0(labels, " (", round(percentages, 1), "%)")), position = position_stack(vjust = 0.5), size = 2) +
theme_void() +
labs(title = title, fill = "Stroke") +
scale_fill_brewer(palette = "Pastel1") +
theme(legend.position = "none")
return(plot)
}
# Create pie plots for Not married and Yes married
plot_not_married <- create_pie_plot(not_married_subset, "Not married")
plot_yes_married <- create_pie_plot(yes_married_subset, "Yes married")
# Arrange the plots
grid.arrange(plot_not_married, plot_yes_married, ncol = 2)
boxplot_outliers_multiple <- function(cols, df) {
# Melt the data frame to long format for multiple boxplots
df_long <- df %>% select(all_of(cols)) %>% pivot_longer(cols = everything())
# Create a boxplot to identify outliers for each column
p <- ggplot(df_long, aes(x = name, y = value)) +
geom_boxplot(fill = 'orange') +
labs(x = 'Column', y = 'Value', title = 'Boxplot for Multiple Columns') +
theme_minimal() +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
# Display the plot
print(p)
}
# print boxplot
boxplot_outliers_multiple(c("age", "avg_glucose_level", "bmi"), data_stroke)
# Define the fixing_outlier function
fixing_outlier <- function(col, df) {
# Calculate the 25th and 75th percentiles (Q1 and Q3) for the column
quantile_25 <- quantile(df[[col]], 0.25)
quantile_75 <- quantile(df[[col]], 0.75)
# Calculate the Interquartile Range (IQR)
IQR <- quantile_75 - quantile_25
# Define the upper and lower bounds for detecting outliers
upper <- quantile_75 + 1.5 * IQR
lower <- quantile_25 - 1.5 * IQR
# Keep a copy of the original column to check for outliers later
original_col <- df[[col]]
# Find the indices of the outliers
outlier_indices <- which(original_col > upper | original_col < lower)
# Replace the outliers with the upper or lower limit
df[[col]][outlier_indices] <- ifelse(original_col[outlier_indices] > upper, upper, lower)
# Find the indices of any remaining outliers after handling
remaining_outlier_indices <- which(df[[col]] > upper | df[[col]] < lower)
# Count the number of remaining outliers after handling (should be 0)
remaining_outlier_count <- length(remaining_outlier_indices)
# Return the number of outliers and limits
return(list(upper_limit = upper, lower_limit = lower, remaining_outlier_count = remaining_outlier_count))
}
# Create a function to handle multiple columns and return a data frame
handle_outliers_and_return_df <- function(df, cols) {
results <- lapply(cols, function(col) {
result <- fixing_outlier(col, df)
data.frame(
Column = col,
Upper_Limit = result$upper_limit,
Lower_Limit = result$lower_limit,
Outliers_After_Handling = result$remaining_outlier_count
)
})
# Combine the individual results into a single data frame
results_df <- do.call(rbind, results)
return(results_df)
}
# Specify the columns you want to handle
columns_to_handle <- c("bmi", "avg_glucose_level")
# Handle outliers and get the results as a data frame
results_df <- handle_outliers_and_return_df(data_stroke, columns_to_handle)
# Print the results
print(results_df)
## Column Upper_Limit Lower_Limit Outliers_After_Handling
## 75% bmi 46.3000 10.30000 0
## 75%1 avg_glucose_level 169.2763 22.08625 0
# Count the frequency of unique values in the 'gender' column
gender_counts <- table(data_stroke$gender)
print(gender_counts)
##
## Female Male Other
## 2987 2102 1
# Drop rows where 'gender' is 'Other'
data_stroke <- data_stroke[data_stroke$gender != 'Other', ]
gender_counts <- table(data_stroke$gender)
print(gender_counts)
##
## Female Male
## 2987 2102
# Reset index of the data frame
rownames(data_stroke) <- NULL
head(data_stroke)
## # A tibble: 6 x 11
## gender age hypertension heart_disease ever_married work_type Residence_type
## <chr> <dbl> <dbl> <dbl> <chr> <chr> <chr>
## 1 Male 67 0 1 Yes Private Urban
## 2 Female 61 0 0 Yes Self-empl~ Rural
## 3 Male 80 0 1 Yes Private Rural
## 4 Female 49 0 0 Yes Private Urban
## 5 Female 79 1 0 Yes Self-empl~ Rural
## 6 Male 81 0 0 Yes Private Urban
## # i 4 more variables: avg_glucose_level <dbl>, bmi <dbl>, smoking_status <chr>,
## # stroke <dbl>
str(data_stroke)
## tibble [5,089 x 11] (S3: tbl_df/tbl/data.frame)
## $ gender : chr [1:5089] "Male" "Female" "Male" "Female" ...
## $ age : num [1:5089] 67 61 80 49 79 81 74 69 59 78 ...
## $ hypertension : num [1:5089] 0 0 0 0 1 0 1 0 0 0 ...
## $ heart_disease : num [1:5089] 1 0 1 0 0 0 1 0 0 0 ...
## $ ever_married : chr [1:5089] "Yes" "Yes" "Yes" "Yes" ...
## $ work_type : chr [1:5089] "Private" "Self-employed" "Private" "Private" ...
## $ Residence_type : chr [1:5089] "Urban" "Rural" "Rural" "Urban" ...
## $ avg_glucose_level: num [1:5089] 229 202 106 171 174 ...
## $ bmi : num [1:5089] 36.6 28.9 32.5 34.4 24 ...
## $ smoking_status : chr [1:5089] "formerly smoked" "never smoked" "never smoked" "smokes" ...
## $ stroke : num [1:5089] 1 1 1 1 1 1 1 1 1 1 ...
data_stroke$gender <- as.factor(data_stroke$gender)
data_stroke$ever_married <- as.factor(data_stroke$ever_married)
data_stroke$work_type <- as.factor(data_stroke$work_type)
data_stroke$Residence_type <- as.factor(data_stroke$Residence_type)
data_stroke$smoking_status <- as.factor(data_stroke$smoking_status)
# one hot encoding for categorical data
encoded_data <- model.matrix(~ . - 1, data = data_stroke)
# Convert to data frame
encoded_df <- as.data.frame(encoded_data)
str(encoded_df)
## 'data.frame': 5089 obs. of 17 variables:
## $ genderFemale : num 0 1 0 1 1 0 0 1 1 1 ...
## $ genderMale : num 1 0 1 0 0 1 1 0 0 0 ...
## $ age : num 67 61 80 49 79 81 74 69 59 78 ...
## $ hypertension : num 0 0 0 0 1 0 1 0 0 0 ...
## $ heart_disease : num 1 0 1 0 0 0 1 0 0 0 ...
## $ ever_marriedYes : num 1 1 1 1 1 1 1 0 1 1 ...
## $ work_typeGovt_job : num 0 0 0 0 0 0 0 0 0 0 ...
## $ work_typeNever_worked : num 0 0 0 0 0 0 0 0 0 0 ...
## $ work_typePrivate : num 1 0 1 1 0 1 1 1 1 1 ...
## $ work_typeSelf-employed : num 0 1 0 0 1 0 0 0 0 0 ...
## $ Residence_typeUrban : num 1 0 0 1 0 1 0 1 0 1 ...
## $ avg_glucose_level : num 229 202 106 171 174 ...
## $ bmi : num 36.6 28.9 32.5 34.4 24 ...
## $ smoking_statusnever smoked: num 0 1 1 0 1 0 1 1 0 0 ...
## $ smoking_statussmokes : num 0 0 0 1 0 0 0 0 0 0 ...
## $ smoking_statusUnknown : num 0 0 0 0 0 0 0 0 1 1 ...
## $ stroke : num 1 1 1 1 1 1 1 1 1 1 ...
#Load the packages
library(ggplot2)
library(reshape2)
numerical_vars <- encoded_df[, sapply(encoded_df, is.numeric)]
# Calculate the correlation matrix
cor_matrix <- cor(numerical_vars)
# Melt the correlation matrix to long format
melted_cor_matrix <- melt(cor_matrix)
# Plot the heatmap
heatmap_plot <- ggplot(data = melted_cor_matrix, aes(x = Var1, y = Var2, fill = value)) +
geom_tile(color = "white") +
scale_fill_gradient(low = "white", high = "blue") +
geom_text(aes(label = round(value, 2)), color = "black", size = 1.5) +
theme_minimal() +
theme(
axis.text.x = element_text(angle = 90, vjust = 1, size = 5, hjust = 1),
axis.text.y = element_text(size = 5),
axis.title.x = element_text(size = 5, face = "bold"),
axis.title.y = element_text(size = 5, face = "bold"),
plot.title = element_text(size = 16, face = "bold"),
legend.title = element_text(size = 8),
legend.text = element_text(size = 8)
) +
labs(
title = "Correlation Heatmap",
x = "Variables",
y = "Variables",
fill = "Correlation"
) +
coord_fixed(ratio = 1.0) # Keep the aspect ratio fixed
# Display the plot
print(heatmap_plot)
stroke_cor <- as.data.frame(cor_matrix[,'stroke', drop = FALSE])
stroke_cor <- stroke_cor[order(-stroke_cor$stroke), , drop = FALSE]
print(stroke_cor)
## stroke
## stroke 1.000000000
## age 0.245317154
## heart_disease 0.134720942
## avg_glucose_level 0.131901898
## hypertension 0.127638853
## ever_marriedYes 0.107484921
## work_typeSelf-employed 0.061791100
## bmi 0.037756850
## Residence_typeUrban 0.015520986
## work_typePrivate 0.010928264
## genderMale 0.009529651
## smoking_statussmokes 0.008544236
## work_typeGovt_job 0.002318915
## smoking_statusnever smoked -0.004851218
## genderFemale -0.009529651
## work_typeNever_worked -0.014945584
## smoking_statusUnknown -0.054826610
#min max scaling
# Select columns for scaling
columns_to_scale <- c("age", "avg_glucose_level", "bmi")
# Perform min-max scaling using dplyr
data_stroke_scaled <- encoded_df %>%
mutate(across(all_of(columns_to_scale), ~ (.-min(., na.rm = TRUE))/(max(., na.rm = TRUE)-min(., na.rm = TRUE))))
# Check the structure of the scaled data
str(data_stroke_scaled)
## 'data.frame': 5089 obs. of 17 variables:
## $ genderFemale : num 0 1 0 1 1 0 0 1 1 1 ...
## $ genderMale : num 1 0 1 0 0 1 1 0 0 0 ...
## $ age : num 0.815 0.741 0.975 0.593 0.963 ...
## $ hypertension : num 0 0 0 0 1 0 1 0 0 0 ...
## $ heart_disease : num 1 0 1 0 0 0 1 0 0 0 ...
## $ ever_marriedYes : num 1 1 1 1 1 1 1 0 1 1 ...
## $ work_typeGovt_job : num 0 0 0 0 0 0 0 0 0 0 ...
## $ work_typeNever_worked : num 0 0 0 0 0 0 0 0 0 0 ...
## $ work_typePrivate : num 1 0 1 1 0 1 1 1 1 1 ...
## $ work_typeSelf-employed : num 0 1 0 0 1 0 0 0 0 0 ...
## $ Residence_typeUrban : num 1 0 0 1 0 1 0 1 0 1 ...
## $ avg_glucose_level : num 0.801 0.679 0.235 0.536 0.549 ...
## $ bmi : num 0.301 0.213 0.254 0.276 0.157 ...
## $ smoking_statusnever smoked: num 0 1 1 0 1 0 1 1 0 0 ...
## $ smoking_statussmokes : num 0 0 0 1 0 0 0 0 0 0 ...
## $ smoking_statusUnknown : num 0 0 0 0 0 0 0 0 1 1 ...
## $ stroke : num 1 1 1 1 1 1 1 1 1 1 ...
# "stroke" as factor
data_stroke_scaled$stroke <- as.factor(data_stroke_scaled$stroke)
str(data_stroke_scaled)
## 'data.frame': 5089 obs. of 17 variables:
## $ genderFemale : num 0 1 0 1 1 0 0 1 1 1 ...
## $ genderMale : num 1 0 1 0 0 1 1 0 0 0 ...
## $ age : num 0.815 0.741 0.975 0.593 0.963 ...
## $ hypertension : num 0 0 0 0 1 0 1 0 0 0 ...
## $ heart_disease : num 1 0 1 0 0 0 1 0 0 0 ...
## $ ever_marriedYes : num 1 1 1 1 1 1 1 0 1 1 ...
## $ work_typeGovt_job : num 0 0 0 0 0 0 0 0 0 0 ...
## $ work_typeNever_worked : num 0 0 0 0 0 0 0 0 0 0 ...
## $ work_typePrivate : num 1 0 1 1 0 1 1 1 1 1 ...
## $ work_typeSelf-employed : num 0 1 0 0 1 0 0 0 0 0 ...
## $ Residence_typeUrban : num 1 0 0 1 0 1 0 1 0 1 ...
## $ avg_glucose_level : num 0.801 0.679 0.235 0.536 0.549 ...
## $ bmi : num 0.301 0.213 0.254 0.276 0.157 ...
## $ smoking_statusnever smoked: num 0 1 1 0 1 0 1 1 0 0 ...
## $ smoking_statussmokes : num 0 0 0 1 0 0 0 0 0 0 ...
## $ smoking_statusUnknown : num 0 0 0 0 0 0 0 0 1 1 ...
## $ stroke : Factor w/ 2 levels "0","1": 2 2 2 2 2 2 2 2 2 2 ...
library(caret)
# Split Data
# Set seed for reproducibility
set.seed(142)
# Split the dataset
trainIndex <- createDataPartition(data_stroke_scaled$stroke, p = 0.75, list = FALSE)
data_train <- data_stroke_scaled[trainIndex, ]
data_test <- data_stroke_scaled[-trainIndex, ]
nrow(data_train)
## [1] 3817
nrow(data_test)
## [1] 1272
str(data_train)
## 'data.frame': 3817 obs. of 17 variables:
## $ genderFemale : num 0 1 1 0 0 1 1 1 1 1 ...
## $ genderMale : num 1 0 0 1 1 0 0 0 0 0 ...
## $ age : num 0.815 0.593 0.963 0.988 0.901 ...
## $ hypertension : num 0 0 1 0 1 0 0 1 0 0 ...
## $ heart_disease : num 1 0 0 0 1 0 0 0 1 0 ...
## $ ever_marriedYes : num 1 1 1 1 1 0 1 1 1 1 ...
## $ work_typeGovt_job : num 0 0 0 0 0 0 0 0 1 0 ...
## $ work_typeNever_worked : num 0 0 0 0 0 0 0 0 0 0 ...
## $ work_typePrivate : num 1 1 0 1 1 1 1 1 0 1 ...
## $ work_typeSelf-employed : num 0 0 1 0 0 0 0 0 0 0 ...
## $ Residence_typeUrban : num 1 1 0 1 0 1 1 0 0 1 ...
## $ avg_glucose_level : num 0.8013 0.536 0.5493 0.6052 0.0691 ...
## $ bmi : num 0.301 0.276 0.157 0.214 0.196 ...
## $ smoking_statusnever smoked: num 0 0 1 0 1 1 0 1 0 0 ...
## $ smoking_statussmokes : num 0 1 0 0 0 0 0 0 1 1 ...
## $ smoking_statusUnknown : num 0 0 0 0 0 0 1 0 0 0 ...
## $ stroke : Factor w/ 2 levels "0","1": 2 2 2 2 2 2 2 2 2 2 ...
# Define the grid of hyperparameters
rf_grid <- expand.grid(mtry = c(2, 4, 6, 8, 10))
# Define the training control
train_control <- trainControl(method = "cv", number = 5)
# Train the model using cross-validation
set.seed(123)
rf_model <- train(stroke ~ ., data = data_train,
method = "rf",
trControl = train_control,
tuneGrid = rf_grid,
metric = "Accuracy")
# Print the best parameters and accuracy
print(rf_model$results)
## mtry Accuracy Kappa AccuracySD KappaSD
## 1 2 0.9510090 0.000000000 0.0006821492 0.00000000
## 2 4 0.9510090 0.009307981 0.0006821492 0.02081328
## 3 6 0.9507473 0.018326278 0.0014682885 0.02747989
## 4 8 0.9499612 0.016381173 0.0010647043 0.02596268
## 5 10 0.9499612 0.016381173 0.0010647043 0.02596268
library(xgboost)
# Convert data to matrix format
train_matrix <- xgb.DMatrix(data.matrix(data_train[,-17]), label = data_train$stroke)
# Define the grid of hyperparameters
xgb_grid <- expand.grid(
nrounds = c(5, 10),
max_depth = c(4, 6),
eta = c(0.01, 0.1),
gamma = c(0, 1),
colsample_bytree = c(0.8, 1.0),
min_child_weight = c(1, 5),
subsample = c(0.8, 1.0)
)
# Train the model using cross-validation
set.seed(123)
xgb_model <- train(
stroke ~ ., data = data_train,
method = "xgbTree",
trControl = train_control,
tuneGrid = xgb_grid,
metric = "Accuracy"
)
## [10:54:58] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:58] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:58] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:58] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:58] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:58] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:58] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:58] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:58] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:58] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:58] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:58] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:58] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:58] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:58] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:58] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:58] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:58] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:58] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:54:59] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:00] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:00] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:00] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:00] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:00] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:00] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:00] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:00] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:00] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:00] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:00] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:00] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:00] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:00] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:00] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:00] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:00] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:00] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:00] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:01] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:02] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:03] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:03] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:03] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:03] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:03] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:03] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:03] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:03] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:03] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:03] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:03] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:03] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:03] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:03] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:03] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:03] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:03] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:03] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:03] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:04] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:04] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:04] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:04] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:04] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:04] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:04] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:04] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:04] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:04] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:04] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:04] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:04] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:04] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:04] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:04] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:04] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:04] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:04] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:04] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:05] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:05] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:05] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:05] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:05] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:05] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:05] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:05] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:05] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:05] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:05] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:05] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:05] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:05] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:05] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:05] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:05] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:06] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:06] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:06] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:06] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:06] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:06] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:06] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:06] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:06] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:06] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:06] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:06] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:06] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:06] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:06] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:06] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:07] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:07] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:07] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:07] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:07] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:07] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:07] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:07] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:07] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:07] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:07] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:07] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:07] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:07] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:07] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:07] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:08] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:08] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:08] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:08] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:08] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:08] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:08] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:08] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:08] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:08] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:08] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:08] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:08] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:08] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:08] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:08] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:08] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:09] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:09] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:09] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:09] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:09] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:09] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:09] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:09] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:09] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:09] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:09] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:09] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:09] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:09] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:09] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:09] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:09] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:09] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:09] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:09] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:10] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:10] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:10] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:10] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:10] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:10] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:10] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:10] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:10] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:10] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:10] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:10] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:10] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:10] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:10] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:10] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:10] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:10] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:10] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:10] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:10] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:11] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:11] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:11] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:11] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:11] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:11] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:11] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:11] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:11] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:11] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:11] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:11] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:11] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:11] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:11] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:11] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:11] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:11] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:11] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:11] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:11] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:12] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:13] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:13] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:13] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:13] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:13] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:13] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:13] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:13] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:13] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:13] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:13] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:13] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:13] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:13] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:13] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:13] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:13] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:13] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:13] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:55:13] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
# Print parameters and accuracy
print(xgb_model$results)
## eta max_depth gamma colsample_bytree min_child_weight subsample nrounds
## 1 0.01 4 0 0.8 1 0.8 5
## 3 0.01 4 0 0.8 1 1.0 5
## 5 0.01 4 0 0.8 5 0.8 5
## 7 0.01 4 0 0.8 5 1.0 5
## 9 0.01 4 0 1.0 1 0.8 5
## 11 0.01 4 0 1.0 1 1.0 5
## 13 0.01 4 0 1.0 5 0.8 5
## 15 0.01 4 0 1.0 5 1.0 5
## 17 0.01 4 1 0.8 1 0.8 5
## 19 0.01 4 1 0.8 1 1.0 5
## 21 0.01 4 1 0.8 5 0.8 5
## 23 0.01 4 1 0.8 5 1.0 5
## 25 0.01 4 1 1.0 1 0.8 5
## 27 0.01 4 1 1.0 1 1.0 5
## 29 0.01 4 1 1.0 5 0.8 5
## 31 0.01 4 1 1.0 5 1.0 5
## 65 0.10 4 0 0.8 1 0.8 5
## 67 0.10 4 0 0.8 1 1.0 5
## 69 0.10 4 0 0.8 5 0.8 5
## 71 0.10 4 0 0.8 5 1.0 5
## 73 0.10 4 0 1.0 1 0.8 5
## 75 0.10 4 0 1.0 1 1.0 5
## 77 0.10 4 0 1.0 5 0.8 5
## 79 0.10 4 0 1.0 5 1.0 5
## 81 0.10 4 1 0.8 1 0.8 5
## 83 0.10 4 1 0.8 1 1.0 5
## 85 0.10 4 1 0.8 5 0.8 5
## 87 0.10 4 1 0.8 5 1.0 5
## 89 0.10 4 1 1.0 1 0.8 5
## 91 0.10 4 1 1.0 1 1.0 5
## 93 0.10 4 1 1.0 5 0.8 5
## 95 0.10 4 1 1.0 5 1.0 5
## 33 0.01 6 0 0.8 1 0.8 5
## 35 0.01 6 0 0.8 1 1.0 5
## 37 0.01 6 0 0.8 5 0.8 5
## 39 0.01 6 0 0.8 5 1.0 5
## 41 0.01 6 0 1.0 1 0.8 5
## 43 0.01 6 0 1.0 1 1.0 5
## 45 0.01 6 0 1.0 5 0.8 5
## 47 0.01 6 0 1.0 5 1.0 5
## 49 0.01 6 1 0.8 1 0.8 5
## 51 0.01 6 1 0.8 1 1.0 5
## 53 0.01 6 1 0.8 5 0.8 5
## 55 0.01 6 1 0.8 5 1.0 5
## 57 0.01 6 1 1.0 1 0.8 5
## 59 0.01 6 1 1.0 1 1.0 5
## 61 0.01 6 1 1.0 5 0.8 5
## 63 0.01 6 1 1.0 5 1.0 5
## 97 0.10 6 0 0.8 1 0.8 5
## 99 0.10 6 0 0.8 1 1.0 5
## 101 0.10 6 0 0.8 5 0.8 5
## 103 0.10 6 0 0.8 5 1.0 5
## 105 0.10 6 0 1.0 1 0.8 5
## 107 0.10 6 0 1.0 1 1.0 5
## 109 0.10 6 0 1.0 5 0.8 5
## 111 0.10 6 0 1.0 5 1.0 5
## 113 0.10 6 1 0.8 1 0.8 5
## 115 0.10 6 1 0.8 1 1.0 5
## 117 0.10 6 1 0.8 5 0.8 5
## 119 0.10 6 1 0.8 5 1.0 5
## 121 0.10 6 1 1.0 1 0.8 5
## 123 0.10 6 1 1.0 1 1.0 5
## 125 0.10 6 1 1.0 5 0.8 5
## 127 0.10 6 1 1.0 5 1.0 5
## 2 0.01 4 0 0.8 1 0.8 10
## 4 0.01 4 0 0.8 1 1.0 10
## 6 0.01 4 0 0.8 5 0.8 10
## 8 0.01 4 0 0.8 5 1.0 10
## 10 0.01 4 0 1.0 1 0.8 10
## 12 0.01 4 0 1.0 1 1.0 10
## 14 0.01 4 0 1.0 5 0.8 10
## 16 0.01 4 0 1.0 5 1.0 10
## 18 0.01 4 1 0.8 1 0.8 10
## 20 0.01 4 1 0.8 1 1.0 10
## 22 0.01 4 1 0.8 5 0.8 10
## 24 0.01 4 1 0.8 5 1.0 10
## 26 0.01 4 1 1.0 1 0.8 10
## 28 0.01 4 1 1.0 1 1.0 10
## 30 0.01 4 1 1.0 5 0.8 10
## 32 0.01 4 1 1.0 5 1.0 10
## 66 0.10 4 0 0.8 1 0.8 10
## 68 0.10 4 0 0.8 1 1.0 10
## 70 0.10 4 0 0.8 5 0.8 10
## 72 0.10 4 0 0.8 5 1.0 10
## 74 0.10 4 0 1.0 1 0.8 10
## 76 0.10 4 0 1.0 1 1.0 10
## 78 0.10 4 0 1.0 5 0.8 10
## 80 0.10 4 0 1.0 5 1.0 10
## 82 0.10 4 1 0.8 1 0.8 10
## 84 0.10 4 1 0.8 1 1.0 10
## 86 0.10 4 1 0.8 5 0.8 10
## 88 0.10 4 1 0.8 5 1.0 10
## 90 0.10 4 1 1.0 1 0.8 10
## 92 0.10 4 1 1.0 1 1.0 10
## 94 0.10 4 1 1.0 5 0.8 10
## 96 0.10 4 1 1.0 5 1.0 10
## 34 0.01 6 0 0.8 1 0.8 10
## 36 0.01 6 0 0.8 1 1.0 10
## 38 0.01 6 0 0.8 5 0.8 10
## 40 0.01 6 0 0.8 5 1.0 10
## 42 0.01 6 0 1.0 1 0.8 10
## 44 0.01 6 0 1.0 1 1.0 10
## 46 0.01 6 0 1.0 5 0.8 10
## 48 0.01 6 0 1.0 5 1.0 10
## 50 0.01 6 1 0.8 1 0.8 10
## 52 0.01 6 1 0.8 1 1.0 10
## 54 0.01 6 1 0.8 5 0.8 10
## 56 0.01 6 1 0.8 5 1.0 10
## 58 0.01 6 1 1.0 1 0.8 10
## 60 0.01 6 1 1.0 1 1.0 10
## 62 0.01 6 1 1.0 5 0.8 10
## 64 0.01 6 1 1.0 5 1.0 10
## 98 0.10 6 0 0.8 1 0.8 10
## 100 0.10 6 0 0.8 1 1.0 10
## 102 0.10 6 0 0.8 5 0.8 10
## 104 0.10 6 0 0.8 5 1.0 10
## 106 0.10 6 0 1.0 1 0.8 10
## 108 0.10 6 0 1.0 1 1.0 10
## 110 0.10 6 0 1.0 5 0.8 10
## 112 0.10 6 0 1.0 5 1.0 10
## 114 0.10 6 1 0.8 1 0.8 10
## 116 0.10 6 1 0.8 1 1.0 10
## 118 0.10 6 1 0.8 5 0.8 10
## 120 0.10 6 1 0.8 5 1.0 10
## 122 0.10 6 1 1.0 1 0.8 10
## 124 0.10 6 1 1.0 1 1.0 10
## 126 0.10 6 1 1.0 5 0.8 10
## 128 0.10 6 1 1.0 5 1.0 10
## Accuracy Kappa AccuracySD KappaSD
## 1 0.9510090 0.0000000000 0.0006821492 0.000000000
## 3 0.9499612 -0.0020225763 0.0014115426 0.002098171
## 5 0.9510090 0.0000000000 0.0006821492 0.000000000
## 7 0.9510090 0.0000000000 0.0006821492 0.000000000
## 9 0.9510090 0.0000000000 0.0006821492 0.000000000
## 11 0.9489124 0.0139336365 0.0033473387 0.043358516
## 13 0.9510090 0.0000000000 0.0006821492 0.000000000
## 15 0.9510090 0.0000000000 0.0006821492 0.000000000
## 17 0.9507469 -0.0005117566 0.0006945608 0.001144322
## 19 0.9510090 0.0000000000 0.0006821492 0.000000000
## 21 0.9510090 0.0000000000 0.0006821492 0.000000000
## 23 0.9510090 0.0000000000 0.0006821492 0.000000000
## 25 0.9510090 0.0000000000 0.0006821492 0.000000000
## 27 0.9491745 0.0139575388 0.0025263131 0.040842162
## 29 0.9510090 0.0000000000 0.0006821492 0.000000000
## 31 0.9510090 0.0000000000 0.0006821492 0.000000000
## 65 0.9507473 -0.0005114401 0.0011388653 0.001143615
## 67 0.9507473 -0.0005114401 0.0011388653 0.001143615
## 69 0.9510090 0.0000000000 0.0006821492 0.000000000
## 71 0.9510090 0.0000000000 0.0006821492 0.000000000
## 73 0.9507469 -0.0005117566 0.0006945608 0.001144322
## 75 0.9499609 -0.0019768834 0.0017014385 0.003189319
## 77 0.9510090 0.0000000000 0.0006821492 0.000000000
## 79 0.9510090 0.0000000000 0.0006821492 0.000000000
## 81 0.9510090 0.0000000000 0.0006821492 0.000000000
## 83 0.9507473 -0.0005114401 0.0011388653 0.001143615
## 85 0.9510090 0.0000000000 0.0006821492 0.000000000
## 87 0.9510090 0.0000000000 0.0006821492 0.000000000
## 89 0.9507473 -0.0005114401 0.0011388653 0.001143615
## 91 0.9502234 -0.0015346368 0.0012772520 0.001400925
## 93 0.9510090 0.0000000000 0.0006821492 0.000000000
## 95 0.9510090 0.0000000000 0.0006821492 0.000000000
## 33 0.9504848 -0.0010235131 0.0005724775 0.001401503
## 35 0.9496988 -0.0024219187 0.0021912761 0.004136999
## 37 0.9510090 0.0000000000 0.0006821492 0.000000000
## 39 0.9510090 0.0000000000 0.0006821492 0.000000000
## 41 0.9491752 -0.0034883769 0.0016907880 0.002780185
## 43 0.9449816 0.0193454932 0.0051765685 0.039671710
## 45 0.9510090 0.0000000000 0.0006821492 0.000000000
## 47 0.9510090 0.0000000000 0.0006821492 0.000000000
## 49 0.9510094 0.0095300537 0.0014623813 0.022766311
## 51 0.9491752 -0.0035343862 0.0010681993 0.001336622
## 53 0.9510090 0.0000000000 0.0006821492 0.000000000
## 55 0.9510090 0.0000000000 0.0006821492 0.000000000
## 57 0.9499605 -0.0019771998 0.0014420885 0.003189392
## 59 0.9449816 0.0194391389 0.0049220962 0.040275686
## 61 0.9510090 0.0000000000 0.0006821492 0.000000000
## 63 0.9510090 0.0000000000 0.0006821492 0.000000000
## 97 0.9502230 -0.0015349532 0.0009035065 0.001401214
## 99 0.9504848 -0.0009996960 0.0010893060 0.002235388
## 101 0.9510090 0.0000000000 0.0006821492 0.000000000
## 103 0.9510090 0.0000000000 0.0006821492 0.000000000
## 105 0.9499605 0.0168790164 0.0025242143 0.029947982
## 107 0.9494366 -0.0029336753 0.0019900115 0.003914799
## 109 0.9510090 0.0000000000 0.0006821492 0.000000000
## 111 0.9510090 0.0000000000 0.0006821492 0.000000000
## 113 0.9507469 -0.0005117566 0.0006945608 0.001144322
## 115 0.9504855 -0.0009997369 0.0016774949 0.002235480
## 117 0.9510090 0.0000000000 0.0006821492 0.000000000
## 119 0.9510090 0.0000000000 0.0006821492 0.000000000
## 121 0.9507469 0.0265843288 0.0006945608 0.040463854
## 123 0.9494373 -0.0029766203 0.0019676460 0.003198159
## 125 0.9510090 0.0000000000 0.0006821492 0.000000000
## 127 0.9510090 0.0000000000 0.0006821492 0.000000000
## 2 0.9510090 0.0000000000 0.0006821492 0.000000000
## 4 0.9507473 -0.0005114401 0.0011388653 0.001143615
## 6 0.9510090 0.0000000000 0.0006821492 0.000000000
## 8 0.9510090 0.0000000000 0.0006821492 0.000000000
## 10 0.9510090 0.0000000000 0.0006821492 0.000000000
## 12 0.9491745 -0.0033593502 0.0025263131 0.004824438
## 14 0.9510090 0.0000000000 0.0006821492 0.000000000
## 16 0.9510090 0.0000000000 0.0006821492 0.000000000
## 18 0.9510090 0.0000000000 0.0006821492 0.000000000
## 20 0.9507473 -0.0005114401 0.0011388653 0.001143615
## 22 0.9510090 0.0000000000 0.0006821492 0.000000000
## 24 0.9510090 0.0000000000 0.0006821492 0.000000000
## 26 0.9510090 0.0000000000 0.0006821492 0.000000000
## 28 0.9491749 -0.0034451154 0.0019397880 0.003589221
## 30 0.9510090 0.0000000000 0.0006821492 0.000000000
## 32 0.9510090 0.0000000000 0.0006821492 0.000000000
## 66 0.9507473 -0.0005114401 0.0011388653 0.001143615
## 68 0.9507473 -0.0005114401 0.0011388653 0.001143615
## 70 0.9510090 0.0000000000 0.0006821492 0.000000000
## 72 0.9510090 0.0000000000 0.0006821492 0.000000000
## 74 0.9510090 0.0000000000 0.0006821492 0.000000000
## 76 0.9507473 -0.0005114401 0.0011388653 0.001143615
## 78 0.9510090 0.0000000000 0.0006821492 0.000000000
## 80 0.9510090 0.0000000000 0.0006821492 0.000000000
## 82 0.9510090 0.0000000000 0.0006821492 0.000000000
## 84 0.9510090 0.0000000000 0.0006821492 0.000000000
## 86 0.9510090 0.0000000000 0.0006821492 0.000000000
## 88 0.9510090 0.0000000000 0.0006821492 0.000000000
## 90 0.9510090 0.0000000000 0.0006821492 0.000000000
## 92 0.9507473 -0.0005114401 0.0011388653 0.001143615
## 94 0.9510090 0.0000000000 0.0006821492 0.000000000
## 96 0.9510090 0.0000000000 0.0006821492 0.000000000
## 34 0.9510090 0.0000000000 0.0006821492 0.000000000
## 36 0.9504851 -0.0010231967 0.0010689035 0.001401070
## 38 0.9510090 0.0000000000 0.0006821492 0.000000000
## 40 0.9510090 0.0000000000 0.0006821492 0.000000000
## 42 0.9502230 -0.0015111361 0.0012942879 0.002242009
## 44 0.9476025 0.0023123184 0.0024602289 0.019087786
## 46 0.9510090 0.0000000000 0.0006821492 0.000000000
## 48 0.9510090 0.0000000000 0.0006821492 0.000000000
## 50 0.9510094 0.0095300537 0.0014623813 0.022766311
## 52 0.9507473 -0.0005114401 0.0011388653 0.001143615
## 54 0.9510090 0.0000000000 0.0006821492 0.000000000
## 56 0.9510090 0.0000000000 0.0006821492 0.000000000
## 58 0.9504848 -0.0009996960 0.0010893060 0.002235388
## 60 0.9473403 0.0019442201 0.0017271641 0.020756495
## 62 0.9510090 0.0000000000 0.0006821492 0.000000000
## 64 0.9510090 0.0000000000 0.0006821492 0.000000000
## 98 0.9510090 0.0000000000 0.0006821492 0.000000000
## 100 0.9504848 -0.0009996960 0.0010893060 0.002235388
## 102 0.9510090 0.0000000000 0.0006821492 0.000000000
## 104 0.9510090 0.0000000000 0.0006821492 0.000000000
## 106 0.9507469 0.0180559819 0.0011571625 0.027091809
## 108 0.9504848 0.0082600617 0.0014294047 0.022788641
## 110 0.9510090 0.0000000000 0.0006821492 0.000000000
## 112 0.9510090 0.0000000000 0.0006821492 0.000000000
## 114 0.9507469 -0.0005117566 0.0006945608 0.001144322
## 116 0.9510090 0.0000000000 0.0006821492 0.000000000
## 118 0.9510090 0.0000000000 0.0006821492 0.000000000
## 120 0.9510090 0.0000000000 0.0006821492 0.000000000
## 122 0.9507473 0.0087965406 0.0011388653 0.021128217
## 124 0.9499609 -0.0020467098 0.0005642000 0.001144146
## 126 0.9510090 0.0000000000 0.0006821492 0.000000000
## 128 0.9510090 0.0000000000 0.0006821492 0.000000000
# Find the highest accuracy
highest_accuracy <- max(xgb_model$results$Accuracy)
highest_accuracy_results <- xgb_model$results[xgb_model$results$Accuracy == highest_accuracy,]
# Print the highest accuracy and corresponding parameters
print(highest_accuracy_results)
## eta max_depth gamma colsample_bytree min_child_weight subsample nrounds
## 49 0.01 6 1 0.8 1 0.8 5
## 50 0.01 6 1 0.8 1 0.8 10
## Accuracy Kappa AccuracySD KappaSD
## 49 0.9510094 0.009530054 0.001462381 0.02276631
## 50 0.9510094 0.009530054 0.001462381 0.02276631
The dataset used for training the model contains a class imbalance, with the positive stroke class underrepresented compared to the negative stroke class. We will need to address this issue by implementing techniques for handling imbalanced data during the training process.
table(data_train$stroke)
##
## 0 1
## 3630 187
train_up<-upSample(data_train[,-1], data_train$stroke, yname="stroke")
table(train_up$stroke)
##
## 0 1
## 3630 3630
# Define the grid of hyperparameters
rf_grid <- expand.grid(mtry = c(2, 4, 6, 8, 10))
# Define the training control
train_control <- trainControl(method = "cv", number = 5)
# Train the model using cross-validation
set.seed(123)
rf_model_up <- train(stroke ~ ., data = train_up,
method = "rf",
trControl = train_control,
tuneGrid = rf_grid,
metric = "Accuracy")
# Print the best parameters and accuracy
print(rf_model_up$results)
## mtry Accuracy Kappa AccuracySD KappaSD
## 1 2 0.8812672 0.7625344 0.009425454 0.018850908
## 2 4 0.9826446 0.9652893 0.002454343 0.004908686
## 3 6 0.9893939 0.9787879 0.002210304 0.004420608
## 4 8 0.9893939 0.9787879 0.002986155 0.005972309
## 5 10 0.9885675 0.9771350 0.002946178 0.005892355
# Convert data to matrix format
train_matrix <- xgb.DMatrix(data.matrix(train_up[,-17]), label = train_up$stroke)
# Train the model using cross-validation
set.seed(123)
xgb_model_up <- train(
stroke ~ ., data = train_up,
method = "xgbTree",
trControl = train_control,
tuneGrid = xgb_grid,
metric = "Accuracy"
)
## [10:57:18] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:18] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:18] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:18] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:18] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:19] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:19] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:19] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:19] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:19] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:19] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:19] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:19] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:19] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:19] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:19] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:19] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:19] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:20] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:20] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:20] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:20] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:20] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:20] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:20] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:20] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:20] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:20] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:21] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:21] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:21] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:21] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:21] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:21] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:21] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:21] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:21] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:21] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:21] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:21] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:21] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:21] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:21] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:21] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:22] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:22] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:22] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:22] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:22] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:22] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:22] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:22] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:22] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:22] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:22] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:22] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:22] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:22] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:23] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:23] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:23] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:23] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:23] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:23] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:23] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:23] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:23] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:23] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:23] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:23] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:23] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:23] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:24] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:24] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:24] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:24] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:24] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:24] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:24] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:24] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:24] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:24] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:24] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:24] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:24] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:24] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:24] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:25] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:25] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:25] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:25] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:25] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:25] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:25] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:25] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:25] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:25] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:25] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:25] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:25] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:26] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:26] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:26] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:26] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:26] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:26] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:26] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:26] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:26] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:26] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:27] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:27] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:27] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:27] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:27] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:27] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:27] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:27] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:27] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:27] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:27] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:27] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:28] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:28] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:28] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:28] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:28] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:28] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:28] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:28] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:28] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:28] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:28] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:28] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:28] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:28] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:28] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:29] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:29] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:29] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:29] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:29] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:29] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:29] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:29] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:29] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:29] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:29] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:29] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:29] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:30] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:30] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:30] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:30] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:30] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:30] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:30] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:30] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:30] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:30] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:30] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:30] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:30] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:30] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:31] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:31] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:31] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:31] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:31] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:31] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:31] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:31] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:31] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:31] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:31] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:31] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:31] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:31] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:31] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:31] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:32] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:32] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:32] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:32] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:32] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:32] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:32] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:32] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:32] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:32] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:32] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:32] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:33] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:33] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:33] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:33] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:33] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:33] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:33] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:33] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:33] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:33] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:33] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:33] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:33] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:33] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:33] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:33] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:33] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:34] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:34] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:34] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:34] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:34] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:34] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:34] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:34] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:34] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:34] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:34] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:34] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:35] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:35] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:35] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:35] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:35] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:35] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:35] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:35] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:35] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:35] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:35] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:35] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:36] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:36] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:36] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:36] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:36] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:36] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:36] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:36] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:36] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:36] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:37] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:37] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:37] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:37] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:37] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:37] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:37] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:37] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:37] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:37] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:37] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:38] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:38] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:38] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:39] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:39] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:40] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:40] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:40] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:40] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:40] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:40] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:40] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:40] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:40] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:40] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:40] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:40] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:40] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:41] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:41] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:41] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:41] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:41] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:41] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:41] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:41] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:41] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:41] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:41] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:42] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:42] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:42] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:42] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:42] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:42] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:42] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:42] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:42] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:42] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:42] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:42] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:42] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:43] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:43] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:43] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:43] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:43] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:43] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:43] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:43] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:43] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:43] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:43] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:43] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:43] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:44] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:44] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:44] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:44] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:44] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:44] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:44] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:44] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:44] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:44] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
## [10:57:44] WARNING: amalgamation/../src/c_api/c_api.cc:785: `ntree_limit` is deprecated, use `iteration_range` instead.
# Print parameters and accuracy
print(xgb_model_up$results)
## eta max_depth gamma colsample_bytree min_child_weight subsample nrounds
## 1 0.01 4 0 0.8 1 0.8 5
## 3 0.01 4 0 0.8 1 1.0 5
## 5 0.01 4 0 0.8 5 0.8 5
## 7 0.01 4 0 0.8 5 1.0 5
## 9 0.01 4 0 1.0 1 0.8 5
## 11 0.01 4 0 1.0 1 1.0 5
## 13 0.01 4 0 1.0 5 0.8 5
## 15 0.01 4 0 1.0 5 1.0 5
## 17 0.01 4 1 0.8 1 0.8 5
## 19 0.01 4 1 0.8 1 1.0 5
## 21 0.01 4 1 0.8 5 0.8 5
## 23 0.01 4 1 0.8 5 1.0 5
## 25 0.01 4 1 1.0 1 0.8 5
## 27 0.01 4 1 1.0 1 1.0 5
## 29 0.01 4 1 1.0 5 0.8 5
## 31 0.01 4 1 1.0 5 1.0 5
## 65 0.10 4 0 0.8 1 0.8 5
## 67 0.10 4 0 0.8 1 1.0 5
## 69 0.10 4 0 0.8 5 0.8 5
## 71 0.10 4 0 0.8 5 1.0 5
## 73 0.10 4 0 1.0 1 0.8 5
## 75 0.10 4 0 1.0 1 1.0 5
## 77 0.10 4 0 1.0 5 0.8 5
## 79 0.10 4 0 1.0 5 1.0 5
## 81 0.10 4 1 0.8 1 0.8 5
## 83 0.10 4 1 0.8 1 1.0 5
## 85 0.10 4 1 0.8 5 0.8 5
## 87 0.10 4 1 0.8 5 1.0 5
## 89 0.10 4 1 1.0 1 0.8 5
## 91 0.10 4 1 1.0 1 1.0 5
## 93 0.10 4 1 1.0 5 0.8 5
## 95 0.10 4 1 1.0 5 1.0 5
## 33 0.01 6 0 0.8 1 0.8 5
## 35 0.01 6 0 0.8 1 1.0 5
## 37 0.01 6 0 0.8 5 0.8 5
## 39 0.01 6 0 0.8 5 1.0 5
## 41 0.01 6 0 1.0 1 0.8 5
## 43 0.01 6 0 1.0 1 1.0 5
## 45 0.01 6 0 1.0 5 0.8 5
## 47 0.01 6 0 1.0 5 1.0 5
## 49 0.01 6 1 0.8 1 0.8 5
## 51 0.01 6 1 0.8 1 1.0 5
## 53 0.01 6 1 0.8 5 0.8 5
## 55 0.01 6 1 0.8 5 1.0 5
## 57 0.01 6 1 1.0 1 0.8 5
## 59 0.01 6 1 1.0 1 1.0 5
## 61 0.01 6 1 1.0 5 0.8 5
## 63 0.01 6 1 1.0 5 1.0 5
## 97 0.10 6 0 0.8 1 0.8 5
## 99 0.10 6 0 0.8 1 1.0 5
## 101 0.10 6 0 0.8 5 0.8 5
## 103 0.10 6 0 0.8 5 1.0 5
## 105 0.10 6 0 1.0 1 0.8 5
## 107 0.10 6 0 1.0 1 1.0 5
## 109 0.10 6 0 1.0 5 0.8 5
## 111 0.10 6 0 1.0 5 1.0 5
## 113 0.10 6 1 0.8 1 0.8 5
## 115 0.10 6 1 0.8 1 1.0 5
## 117 0.10 6 1 0.8 5 0.8 5
## 119 0.10 6 1 0.8 5 1.0 5
## 121 0.10 6 1 1.0 1 0.8 5
## 123 0.10 6 1 1.0 1 1.0 5
## 125 0.10 6 1 1.0 5 0.8 5
## 127 0.10 6 1 1.0 5 1.0 5
## 2 0.01 4 0 0.8 1 0.8 10
## 4 0.01 4 0 0.8 1 1.0 10
## 6 0.01 4 0 0.8 5 0.8 10
## 8 0.01 4 0 0.8 5 1.0 10
## 10 0.01 4 0 1.0 1 0.8 10
## 12 0.01 4 0 1.0 1 1.0 10
## 14 0.01 4 0 1.0 5 0.8 10
## 16 0.01 4 0 1.0 5 1.0 10
## 18 0.01 4 1 0.8 1 0.8 10
## 20 0.01 4 1 0.8 1 1.0 10
## 22 0.01 4 1 0.8 5 0.8 10
## 24 0.01 4 1 0.8 5 1.0 10
## 26 0.01 4 1 1.0 1 0.8 10
## 28 0.01 4 1 1.0 1 1.0 10
## 30 0.01 4 1 1.0 5 0.8 10
## 32 0.01 4 1 1.0 5 1.0 10
## 66 0.10 4 0 0.8 1 0.8 10
## 68 0.10 4 0 0.8 1 1.0 10
## 70 0.10 4 0 0.8 5 0.8 10
## 72 0.10 4 0 0.8 5 1.0 10
## 74 0.10 4 0 1.0 1 0.8 10
## 76 0.10 4 0 1.0 1 1.0 10
## 78 0.10 4 0 1.0 5 0.8 10
## 80 0.10 4 0 1.0 5 1.0 10
## 82 0.10 4 1 0.8 1 0.8 10
## 84 0.10 4 1 0.8 1 1.0 10
## 86 0.10 4 1 0.8 5 0.8 10
## 88 0.10 4 1 0.8 5 1.0 10
## 90 0.10 4 1 1.0 1 0.8 10
## 92 0.10 4 1 1.0 1 1.0 10
## 94 0.10 4 1 1.0 5 0.8 10
## 96 0.10 4 1 1.0 5 1.0 10
## 34 0.01 6 0 0.8 1 0.8 10
## 36 0.01 6 0 0.8 1 1.0 10
## 38 0.01 6 0 0.8 5 0.8 10
## 40 0.01 6 0 0.8 5 1.0 10
## 42 0.01 6 0 1.0 1 0.8 10
## 44 0.01 6 0 1.0 1 1.0 10
## 46 0.01 6 0 1.0 5 0.8 10
## 48 0.01 6 0 1.0 5 1.0 10
## 50 0.01 6 1 0.8 1 0.8 10
## 52 0.01 6 1 0.8 1 1.0 10
## 54 0.01 6 1 0.8 5 0.8 10
## 56 0.01 6 1 0.8 5 1.0 10
## 58 0.01 6 1 1.0 1 0.8 10
## 60 0.01 6 1 1.0 1 1.0 10
## 62 0.01 6 1 1.0 5 0.8 10
## 64 0.01 6 1 1.0 5 1.0 10
## 98 0.10 6 0 0.8 1 0.8 10
## 100 0.10 6 0 0.8 1 1.0 10
## 102 0.10 6 0 0.8 5 0.8 10
## 104 0.10 6 0 0.8 5 1.0 10
## 106 0.10 6 0 1.0 1 0.8 10
## 108 0.10 6 0 1.0 1 1.0 10
## 110 0.10 6 0 1.0 5 0.8 10
## 112 0.10 6 0 1.0 5 1.0 10
## 114 0.10 6 1 0.8 1 0.8 10
## 116 0.10 6 1 0.8 1 1.0 10
## 118 0.10 6 1 0.8 5 0.8 10
## 120 0.10 6 1 0.8 5 1.0 10
## 122 0.10 6 1 1.0 1 0.8 10
## 124 0.10 6 1 1.0 1 1.0 10
## 126 0.10 6 1 1.0 5 0.8 10
## 128 0.10 6 1 1.0 5 1.0 10
## Accuracy Kappa AccuracySD KappaSD
## 1 0.8151515 0.6303030 0.010982635 0.021965271
## 3 0.8121212 0.6242424 0.012637319 0.025274638
## 5 0.8196970 0.6393939 0.005603539 0.011207077
## 7 0.8099174 0.6198347 0.012866076 0.025732151
## 9 0.8103306 0.6206612 0.006113593 0.012227185
## 11 0.8074380 0.6148760 0.012563917 0.025127833
## 13 0.8086777 0.6173554 0.015201520 0.030403041
## 15 0.8075758 0.6151515 0.010070180 0.020140360
## 17 0.8139118 0.6278237 0.014926008 0.029852016
## 19 0.8104683 0.6209366 0.011982284 0.023964567
## 21 0.8005510 0.6011019 0.024877421 0.049754842
## 23 0.8158402 0.6316804 0.010676042 0.021352084
## 25 0.8133609 0.6267218 0.012125907 0.024251814
## 27 0.8074380 0.6148760 0.012563917 0.025127833
## 29 0.8048209 0.6096419 0.013217041 0.026434082
## 31 0.8075758 0.6151515 0.010070180 0.020140360
## 65 0.8249311 0.6498623 0.006225072 0.012450145
## 67 0.8225895 0.6451791 0.010620362 0.021240723
## 69 0.8180441 0.6360882 0.009535521 0.019071043
## 71 0.8219008 0.6438017 0.010519395 0.021038790
## 73 0.8224518 0.6449036 0.016695954 0.033391907
## 75 0.8232782 0.6465565 0.011478880 0.022957759
## 77 0.8230028 0.6460055 0.014105853 0.028211707
## 79 0.8214876 0.6429752 0.012618538 0.025237077
## 81 0.8238292 0.6476584 0.009708057 0.019416114
## 83 0.8163912 0.6327824 0.009649249 0.019298499
## 85 0.8235537 0.6471074 0.010044241 0.020088482
## 87 0.8170799 0.6341598 0.013899225 0.027798450
## 89 0.8263085 0.6526171 0.016423851 0.032847702
## 91 0.8232782 0.6465565 0.011478880 0.022957759
## 93 0.8202479 0.6404959 0.017859921 0.035719842
## 95 0.8214876 0.6429752 0.012618538 0.025237077
## 33 0.8724518 0.7449036 0.011002053 0.022004105
## 35 0.8655647 0.7311295 0.006011888 0.012023776
## 37 0.8690083 0.7380165 0.017842650 0.035685300
## 39 0.8648760 0.7297521 0.018080316 0.036160632
## 41 0.8659780 0.7319559 0.010698233 0.021396466
## 43 0.8593664 0.7187328 0.012362211 0.024724422
## 45 0.8582645 0.7165289 0.016169180 0.032338359
## 47 0.8471074 0.6942149 0.012271715 0.024543429
## 49 0.8735537 0.7471074 0.005370135 0.010740269
## 51 0.8676309 0.7352617 0.013233180 0.026466361
## 53 0.8585399 0.7170799 0.007395168 0.014790336
## 55 0.8621212 0.7242424 0.009949348 0.019898695
## 57 0.8717631 0.7435262 0.011671471 0.023342942
## 59 0.8593664 0.7187328 0.012362211 0.024724422
## 61 0.8578512 0.7157025 0.016597653 0.033195307
## 63 0.8471074 0.6942149 0.012271715 0.024543429
## 97 0.8797521 0.7595041 0.007298326 0.014596652
## 99 0.8783747 0.7567493 0.010786540 0.021573080
## 101 0.8644628 0.7289256 0.010437918 0.020875836
## 103 0.8761708 0.7523416 0.010184924 0.020369847
## 105 0.8858127 0.7716253 0.005431610 0.010863220
## 107 0.8831956 0.7663912 0.016360192 0.032720385
## 109 0.8720386 0.7440771 0.009308992 0.018617984
## 111 0.8742424 0.7484848 0.012325707 0.024651415
## 113 0.8863636 0.7727273 0.014021538 0.028043076
## 115 0.8852617 0.7705234 0.008215535 0.016431069
## 117 0.8652893 0.7305785 0.006434881 0.012869762
## 119 0.8754821 0.7509642 0.011109309 0.022218617
## 121 0.8917355 0.7834711 0.010067825 0.020135649
## 123 0.8877410 0.7754821 0.013987669 0.027975339
## 125 0.8673554 0.7347107 0.001152424 0.002304849
## 127 0.8742424 0.7484848 0.012229125 0.024458249
## 2 0.8170799 0.6341598 0.013342053 0.026684106
## 4 0.8176309 0.6352617 0.016103042 0.032206084
## 6 0.8203857 0.6407713 0.006205995 0.012411989
## 8 0.8140496 0.6280992 0.012155208 0.024310417
## 10 0.8119835 0.6239669 0.009405303 0.018810606
## 12 0.8085399 0.6170799 0.014446403 0.028892806
## 14 0.8066116 0.6132231 0.014507016 0.029014033
## 16 0.8086777 0.6173554 0.012011935 0.024023871
## 18 0.8141873 0.6283747 0.015579054 0.031158109
## 20 0.8192837 0.6385675 0.006931674 0.013863347
## 22 0.8112948 0.6225895 0.011368853 0.022737705
## 24 0.8144628 0.6289256 0.009066354 0.018132708
## 26 0.8123967 0.6247934 0.014855932 0.029711864
## 28 0.8085399 0.6170799 0.014446403 0.028892806
## 30 0.8055096 0.6110193 0.012325707 0.024651415
## 32 0.8086777 0.6173554 0.012011935 0.024023871
## 66 0.8290634 0.6581267 0.008510457 0.017020915
## 68 0.8296143 0.6592287 0.009412865 0.018825730
## 70 0.8303030 0.6606061 0.009196214 0.018392427
## 72 0.8293388 0.6586777 0.012712163 0.025424326
## 74 0.8314050 0.6628099 0.010773340 0.021546680
## 76 0.8326446 0.6652893 0.014819170 0.029638340
## 78 0.8333333 0.6666667 0.010353510 0.020707020
## 80 0.8316804 0.6633609 0.013081774 0.026163548
## 82 0.8327824 0.6655647 0.010784341 0.021568682
## 84 0.8305785 0.6611570 0.006659463 0.013318925
## 86 0.8303030 0.6606061 0.010093703 0.020187406
## 88 0.8279614 0.6559229 0.014910110 0.029820221
## 90 0.8336088 0.6672176 0.014983099 0.029966197
## 92 0.8326446 0.6652893 0.014819170 0.029638340
## 94 0.8268595 0.6537190 0.009170389 0.018340778
## 96 0.8316804 0.6633609 0.013081774 0.026163548
## 34 0.8775482 0.7550964 0.015076196 0.030152393
## 36 0.8732782 0.7465565 0.012348775 0.024697550
## 38 0.8657025 0.7314050 0.019546372 0.039092744
## 40 0.8655647 0.7311295 0.013079961 0.026159922
## 42 0.8710744 0.7421488 0.009128917 0.018257834
## 44 0.8617080 0.7234160 0.009973156 0.019946311
## 46 0.8644628 0.7289256 0.018431070 0.036862139
## 48 0.8548209 0.7096419 0.014910110 0.029820221
## 50 0.8769972 0.7539945 0.011468545 0.022937090
## 52 0.8735537 0.7471074 0.012788424 0.025576847
## 54 0.8622590 0.7245179 0.012463472 0.024926944
## 56 0.8655647 0.7311295 0.010861037 0.021722073
## 58 0.8734160 0.7468320 0.018469631 0.036939262
## 60 0.8617080 0.7234160 0.009973156 0.019946311
## 62 0.8614325 0.7228650 0.010242971 0.020485942
## 64 0.8548209 0.7096419 0.014910110 0.029820221
## 98 0.8935262 0.7870523 0.008746828 0.017493655
## 100 0.8960055 0.7920110 0.009071584 0.018143168
## 102 0.8775482 0.7550964 0.009683597 0.019367194
## 104 0.8869146 0.7738292 0.007782674 0.015565348
## 106 0.8946281 0.7892562 0.005222366 0.010444732
## 108 0.8977961 0.7955923 0.011175290 0.022350581
## 110 0.8820937 0.7641873 0.002549140 0.005098280
## 112 0.8924242 0.7848485 0.006148406 0.012296812
## 114 0.8964187 0.7928375 0.005586584 0.011173168
## 116 0.8984848 0.7969697 0.010564388 0.021128776
## 118 0.8809917 0.7619835 0.005254058 0.010508116
## 120 0.8880165 0.7760331 0.010753510 0.021507020
## 122 0.8983471 0.7966942 0.011175290 0.022350581
## 124 0.8972452 0.7944904 0.007582016 0.015164032
## 126 0.8815427 0.7630854 0.003834548 0.007669097
## 128 0.8917355 0.7834711 0.007888607 0.015777213
# Find the highest accuracy
highest_accuracy_up <- max(xgb_model_up$results$Accuracy)
highest_accuracy_results_up <- xgb_model_up$results[xgb_model_up$results$Accuracy == highest_accuracy_up,]
# Print the highest accuracy and corresponding parameters
print(highest_accuracy_results_up)
## eta max_depth gamma colsample_bytree min_child_weight subsample nrounds
## 116 0.1 6 1 0.8 1 1 10
## Accuracy Kappa AccuracySD KappaSD
## 116 0.8984848 0.7969697 0.01056439 0.02112878
Out of the four training models (random forest, xgBoost, random forest with oversampling data, and xgBoost with oversampling data), the best training model is a random forest model with oversampling data, which has an accuracy of 98.9%. Therefore, the chosen model for testing the data is the random forest with oversampling data.
# Get the best mtry value
best_mtry <- rf_model_up$bestTune$mtry
print(best_mtry)
## [1] 6
# Define the grid of hyperparameters to only include mtry = 6
rf_grid <- expand.grid(mtry = 6)
# Define the training control
train_control <- trainControl(method = "cv", number = 5)
# Train the model using cross-validation with mtry = 6
rf_model_up <- train(stroke ~ ., data = train_up,
method = "rf",
trControl = train_control,
tuneGrid = rf_grid,
metric = "Accuracy")
# Evaluate the final model on the test data
predictions <- predict(rf_model_up, newdata = data_test)
# Calculate the accuracy on the test data
confusionMatrix(predictions, data_test$stroke)
## Confusion Matrix and Statistics
##
## Reference
## Prediction 0 1
## 0 1200 60
## 1 10 2
##
## Accuracy : 0.945
## 95% CI : (0.931, 0.9569)
## No Information Rate : 0.9513
## P-Value [Acc > NIR] : 0.865
##
## Kappa : 0.0389
##
## Mcnemar's Test P-Value : 4.724e-09
##
## Sensitivity : 0.99174
## Specificity : 0.03226
## Pos Pred Value : 0.95238
## Neg Pred Value : 0.16667
## Prevalence : 0.95126
## Detection Rate : 0.94340
## Detection Prevalence : 0.99057
## Balanced Accuracy : 0.51200
##
## 'Positive' Class : 0
##
The best model for stroke prediction is a random forest model trained using oversampled data. It obtains quite high accuracy in training and testing, 98.93% and 94.73%. These results show that the model built is effective in predicting stroke based on existing data. In addition, the Random Forest model shows consistent performance both on the original data and after oversampling, with increased accuracy after oversampling. The XGBoost model shows good performance on the original data but degrades after oversampling, which may indicate overfitting. This decrease in accuracy shows that oversampling does not constantly improve model performance and can sometimes cause the model to learn noise in the data, which reduces the model’s generalization ability on new data.