# pacotes
require(tidyverse)
require(wesanderson)
require(ggridges)
require(viridis)
require(caret)
require(tictoc)
require(suncalc)
require(cluster)
require(fastDummies)
require(fpc)
require(stats)

Lendo o Conjunto de Dados

dataset <- read_csv('dataset.csv')
colnames(dataset)
##  [1] "X1"               "Human_timestamp"  "Hive"            
##  [4] "Apiary"           "Brood_Temp"       "Brood_Humidity"  
##  [7] "Hive_Temp"        "Hive_Humidity"    "Scale_Temp"      
## [10] "Scale_Humidity"   "Weight"           "Temperature"     
## [13] "DewPoint"         "Pressure"         "WindDirection"   
## [16] "WindSpeed"        "SkyCondition"     "Precipitation1Hr"
## [19] "Precipitation6Hr" "Brood"            "Bees"            
## [22] "Queen"            "Food"             "Stressors"       
## [25] "Space"            "Code"

Inclusão de novas variáveis e modificações nas medidas

Dessas variáveis acima, iremos somente utilizar as medições dos sensores Internos, o peso e dos sensores externos utilizaremos somente as variáveis: Temperatura, Pressão Atmosférica, DewPoint, Direção e Velocidade do vento. Incluiremos tambem as variaveis de inspeção e o timestamp para fins futuros. Não podemos incluir outras variáveis exatamente pelo fato de possuirem muitos valores faltantes. A Pressão Atmosférica Pressure poderia ser incluida porém na analise percebi que todas as medições do Apiário Beesboro estão faltando. Portanto a imputação desses valores em minha concepção geraria ruido e viés. Mas, vamos ver no que vai dar

dataset <- dataset %>%
  select(Human_timestamp, Brood_Temp, Brood_Humidity, Hive_Temp, Hive_Humidity, 
         Weight, Temperature, DewPoint, WindDirection, WindSpeed, Brood, Bees, 
         Queen, Food, Stressors, Space)

dataset <- dataset %>%
  filter(Bees %in% c(0, 1))

colnames(dataset)
##  [1] "Human_timestamp" "Brood_Temp"      "Brood_Humidity" 
##  [4] "Hive_Temp"       "Hive_Humidity"   "Weight"         
##  [7] "Temperature"     "DewPoint"        "WindDirection"  
## [10] "WindSpeed"       "Brood"           "Bees"           
## [13] "Queen"           "Food"            "Stressors"      
## [16] "Space"

Vamos criar uma variável Season, para a estação do ano associada ao timestamp, isso se faz necesário já que a colméia tende a se adaptar às estações. Utilizaremos como base o ano de 2012, pois é um ano bem estruturado e que possuiu boas divisões de estações.

getSeason <- function(DATES) {
  WS <- as.Date("2012-12-15", format = "%Y-%m-%d") # Winter Solstice
  SE <- as.Date("2012-3-15",  format = "%Y-%m-%d") # Spring Equinox
  SS <- as.Date("2012-6-15",  format = "%Y-%m-%d") # Summer Solstice
  FE <- as.Date("2012-9-15",  format = "%Y-%m-%d") # Fall Equinox
  
  # Convert dates from any year to 2012 dates
  d <- as.Date(strftime(DATES, format="2012-%m-%d"))
  
  ifelse (d >= WS | d < SE, "Inverno",
          ifelse (d >= SE & d < SS, "Primavera",
                  ifelse (d >= SS & d < FE, "Verão", "Outono")))
}

dataset <- dataset %>%
  mutate(Season = getSeason(Human_timestamp))

colnames(dataset)
##  [1] "Human_timestamp" "Brood_Temp"      "Brood_Humidity" 
##  [4] "Hive_Temp"       "Hive_Humidity"   "Weight"         
##  [7] "Temperature"     "DewPoint"        "WindDirection"  
## [10] "WindSpeed"       "Brood"           "Bees"           
## [13] "Queen"           "Food"            "Stressors"      
## [16] "Space"           "Season"

Uma boa variável que pode nos dar grandes resultados seria o Turno do dia em que ocorreu as medições

getTurnDay <- function(data){
  times <- getSunlightTimes(date = as.Date(data), lat = 35.7596, 
                            lon = -79.0193, tz = "America/New_York")
  data <- as.POSIXct(as.character(data), format = "%Y-%m-%d %H:%M:%S",tz="America/New_York")
  sunrise <- times$sunrise
  sunset <- times$sunset
  
  return(ifelse(data > sunrise & data < sunset, 'dia', 'noite'))
}

dataset <- dataset %>%
  mutate(TurnDay = getTurnDay(Human_timestamp))

Algumas medidas estão multiplicadas por um fator de escala (padrão 10) e outras não estão no padrão de medida que gostariamos, para fins de análise posterior vamos convertê-las.

toCelsius <- function(f){
  return((f - 32)/1.8)
}
toKg <- function(l){
  return(l*0.4535925)
}

dataset <- dataset %>%
  mutate(Ext_Temperature = Temperature/10,
         Brood_Temp = toCelsius(Brood_Temp), 
         Hive_Temp = toCelsius(Hive_Temp), 
         Weight = toKg(Weight),
         DewPoint = DewPoint/10) %>%
  select(Season, TurnDay, Brood_Temp, Brood_Humidity, Hive_Temp, 
         Hive_Humidity, Weight, Ext_Temperature, DewPoint, WindDirection, 
         WindSpeed, Brood, Bees, Queen, Food, Stressors, Space)
summary(dataset)
##     Season            TurnDay            Brood_Temp     Brood_Humidity 
##  Length:15490       Length:15490       Min.   : 9.128   Min.   :22.00  
##  Class :character   Class :character   1st Qu.:29.347   1st Qu.:61.00  
##  Mode  :character   Mode  :character   Median :32.817   Median :66.00  
##                                        Mean   :31.228   Mean   :64.79  
##                                        3rd Qu.:34.400   3rd Qu.:71.00  
##                                        Max.   :43.961   Max.   :87.00  
##    Hive_Temp      Hive_Humidity       Weight       Ext_Temperature
##  Min.   :-17.78   Min.   :19.00   Min.   :  0.00   Min.   : 0.00  
##  1st Qu.: 27.83   1st Qu.:59.00   1st Qu.: 24.64   1st Qu.: 2.61  
##  Median : 32.50   Median :66.00   Median : 29.27   Median :19.40  
##  Mean   : 30.62   Mean   :64.39   Mean   : 28.68   Mean   :15.71  
##  3rd Qu.: 34.53   3rd Qu.:71.00   3rd Qu.: 32.87   3rd Qu.:24.40  
##  Max.   : 48.04   Max.   :93.00   Max.   :205.59   Max.   :36.00  
##     DewPoint     WindDirection       WindSpeed         Brood      
##  Min.   :-6.70   Min.   :-9999.0   Min.   : 0.00   Min.   :0.000  
##  1st Qu.: 1.94   1st Qu.:    0.0   1st Qu.: 1.50   1st Qu.:1.000  
##  Median :15.00   Median :  100.0   Median :15.00   Median :1.000  
##  Mean   :12.33   Mean   : -528.3   Mean   :17.46   Mean   :0.846  
##  3rd Qu.:21.10   3rd Qu.:  220.0   3rd Qu.:31.00   3rd Qu.:1.000  
##  Max.   :27.00   Max.   :  360.0   Max.   :99.00   Max.   :1.000  
##       Bees            Queen             Food          Stressors     
##  Min.   :0.0000   Min.   :0.0000   Min.   :0.0000   Min.   :0.0000  
##  1st Qu.:1.0000   1st Qu.:1.0000   1st Qu.:1.0000   1st Qu.:0.0000  
##  Median :1.0000   Median :1.0000   Median :1.0000   Median :0.0000  
##  Mean   :0.9187   Mean   :0.9022   Mean   :0.9649   Mean   :0.4362  
##  3rd Qu.:1.0000   3rd Qu.:1.0000   3rd Qu.:1.0000   3rd Qu.:1.0000  
##  Max.   :1.0000   Max.   :1.0000   Max.   :1.0000   Max.   :1.0000  
##      Space       
##  Min.   :0.0000  
##  1st Qu.:0.0000  
##  Median :1.0000  
##  Mean   :0.7104  
##  3rd Qu.:1.0000  
##  Max.   :1.0000

Vamos deixar apenas os dados que possuam consistência… Substituindo por NA os que não são, para depois imputar

dataset <- dataset %>%
  mutate(Brood_Temp = ifelse(between(Brood_Temp, -10, 40), Brood_Temp, NA),
         Hive_Temp = ifelse(between(Hive_Temp, -10, 40), Hive_Temp, NA),
         Brood_Humidity = ifelse(between(Brood_Humidity, 0, 100), Brood_Humidity, NA),
         Hive_Humidity = ifelse(between(Hive_Humidity, 0, 100), Hive_Humidity, NA),
         Weight = ifelse(between(Weight, 1, 130), Weight, NA),
         Ext_Temperature = ifelse(between(Ext_Temperature, -10, 40), Ext_Temperature, NA),
         DewPoint = ifelse(DewPoint == -999.9, NA, DewPoint),
         WindDirection = ifelse(WindDirection == -9999, NA, WindDirection), 
         WindSpeed = ifelse(WindSpeed == -9999, NA, WindSpeed))
summary(dataset)
##     Season            TurnDay            Brood_Temp     Brood_Humidity 
##  Length:15490       Length:15490       Min.   : 9.128   Min.   :22.00  
##  Class :character   Class :character   1st Qu.:29.344   1st Qu.:61.00  
##  Mode  :character   Mode  :character   Median :32.817   Median :66.00  
##                                        Mean   :31.223   Mean   :64.79  
##                                        3rd Qu.:34.400   3rd Qu.:71.00  
##                                        Max.   :39.950   Max.   :87.00  
##                                        NA's   :8                       
##    Hive_Temp      Hive_Humidity       Weight        Ext_Temperature
##  Min.   : 6.861   Min.   :19.00   Min.   :  1.098   Min.   : 0.00  
##  1st Qu.:27.824   1st Qu.:59.00   1st Qu.: 26.045   1st Qu.: 2.61  
##  Median :32.483   Median :66.00   Median : 29.665   Median :19.40  
##  Mean   :30.614   Mean   :64.39   Mean   : 30.722   Mean   :15.71  
##  3rd Qu.:34.528   3rd Qu.:71.00   3rd Qu.: 33.280   3rd Qu.:24.40  
##  Max.   :39.928   Max.   :93.00   Max.   :129.936   Max.   :36.00  
##  NA's   :12                       NA's   :1130                     
##     DewPoint     WindDirection     WindSpeed         Brood      
##  Min.   :-6.70   Min.   :  0.0   Min.   : 0.00   Min.   :0.000  
##  1st Qu.: 1.94   1st Qu.:  0.0   1st Qu.: 1.50   1st Qu.:1.000  
##  Median :15.00   Median :120.0   Median :15.00   Median :1.000  
##  Mean   :12.33   Mean   :125.3   Mean   :17.46   Mean   :0.846  
##  3rd Qu.:21.10   3rd Qu.:230.0   3rd Qu.:31.00   3rd Qu.:1.000  
##  Max.   :27.00   Max.   :360.0   Max.   :99.00   Max.   :1.000  
##                  NA's   :1000                                   
##       Bees            Queen             Food          Stressors     
##  Min.   :0.0000   Min.   :0.0000   Min.   :0.0000   Min.   :0.0000  
##  1st Qu.:1.0000   1st Qu.:1.0000   1st Qu.:1.0000   1st Qu.:0.0000  
##  Median :1.0000   Median :1.0000   Median :1.0000   Median :0.0000  
##  Mean   :0.9187   Mean   :0.9022   Mean   :0.9649   Mean   :0.4362  
##  3rd Qu.:1.0000   3rd Qu.:1.0000   3rd Qu.:1.0000   3rd Qu.:1.0000  
##  Max.   :1.0000   Max.   :1.0000   Max.   :1.0000   Max.   :1.0000  
##                                                                     
##      Space       
##  Min.   :0.0000  
##  1st Qu.:0.0000  
##  Median :1.0000  
##  Mean   :0.7104  
##  3rd Qu.:1.0000  
##  Max.   :1.0000  
## 

Após especificar como NA os incosistentes, vamos imputa-los

df_imp <- mice::mice(dataset)
## 
##  iter imp variable
##   1   1  Brood_Temp  Hive_Temp  Weight  WindDirection
##   1   2  Brood_Temp  Hive_Temp  Weight  WindDirection
##   1   3  Brood_Temp  Hive_Temp  Weight  WindDirection
##   1   4  Brood_Temp  Hive_Temp  Weight  WindDirection
##   1   5  Brood_Temp  Hive_Temp  Weight  WindDirection
##   2   1  Brood_Temp  Hive_Temp  Weight  WindDirection
##   2   2  Brood_Temp  Hive_Temp  Weight  WindDirection
##   2   3  Brood_Temp  Hive_Temp  Weight  WindDirection
##   2   4  Brood_Temp  Hive_Temp  Weight  WindDirection
##   2   5  Brood_Temp  Hive_Temp  Weight  WindDirection
##   3   1  Brood_Temp  Hive_Temp  Weight  WindDirection
##   3   2  Brood_Temp  Hive_Temp  Weight  WindDirection
##   3   3  Brood_Temp  Hive_Temp  Weight  WindDirection
##   3   4  Brood_Temp  Hive_Temp  Weight  WindDirection
##   3   5  Brood_Temp  Hive_Temp  Weight  WindDirection
##   4   1  Brood_Temp  Hive_Temp  Weight  WindDirection
##   4   2  Brood_Temp  Hive_Temp  Weight  WindDirection
##   4   3  Brood_Temp  Hive_Temp  Weight  WindDirection
##   4   4  Brood_Temp  Hive_Temp  Weight  WindDirection
##   4   5  Brood_Temp  Hive_Temp  Weight  WindDirection
##   5   1  Brood_Temp  Hive_Temp  Weight  WindDirection
##   5   2  Brood_Temp  Hive_Temp  Weight  WindDirection
##   5   3  Brood_Temp  Hive_Temp  Weight  WindDirection
##   5   4  Brood_Temp  Hive_Temp  Weight  WindDirection
##   5   5  Brood_Temp  Hive_Temp  Weight  WindDirection
## Warning: Number of logged events: 2
dataset <- mice::complete(df_imp, 1)
summary(dataset)
##     Season            TurnDay            Brood_Temp     Brood_Humidity 
##  Length:15490       Length:15490       Min.   : 9.128   Min.   :22.00  
##  Class :character   Class :character   1st Qu.:29.347   1st Qu.:61.00  
##  Mode  :character   Mode  :character   Median :32.817   Median :66.00  
##                                        Mean   :31.224   Mean   :64.79  
##                                        3rd Qu.:34.400   3rd Qu.:71.00  
##                                        Max.   :39.950   Max.   :87.00  
##    Hive_Temp      Hive_Humidity       Weight        Ext_Temperature
##  Min.   : 6.861   Min.   :19.00   Min.   :  1.098   Min.   : 0.00  
##  1st Qu.:27.828   1st Qu.:59.00   1st Qu.: 25.397   1st Qu.: 2.61  
##  Median :32.483   Median :66.00   Median : 29.456   Median :19.40  
##  Mean   :30.617   Mean   :64.39   Mean   : 30.456   Mean   :15.71  
##  3rd Qu.:34.528   3rd Qu.:71.00   3rd Qu.: 33.071   3rd Qu.:24.40  
##  Max.   :39.928   Max.   :93.00   Max.   :129.936   Max.   :36.00  
##     DewPoint     WindDirection     WindSpeed         Brood      
##  Min.   :-6.70   Min.   :  0.0   Min.   : 0.00   Min.   :0.000  
##  1st Qu.: 1.94   1st Qu.: 10.0   1st Qu.: 1.50   1st Qu.:1.000  
##  Median :15.00   Median :130.0   Median :15.00   Median :1.000  
##  Mean   :12.33   Mean   :126.2   Mean   :17.46   Mean   :0.846  
##  3rd Qu.:21.10   3rd Qu.:230.0   3rd Qu.:31.00   3rd Qu.:1.000  
##  Max.   :27.00   Max.   :360.0   Max.   :99.00   Max.   :1.000  
##       Bees            Queen             Food          Stressors     
##  Min.   :0.0000   Min.   :0.0000   Min.   :0.0000   Min.   :0.0000  
##  1st Qu.:1.0000   1st Qu.:1.0000   1st Qu.:1.0000   1st Qu.:0.0000  
##  Median :1.0000   Median :1.0000   Median :1.0000   Median :0.0000  
##  Mean   :0.9187   Mean   :0.9022   Mean   :0.9649   Mean   :0.4362  
##  3rd Qu.:1.0000   3rd Qu.:1.0000   3rd Qu.:1.0000   3rd Qu.:1.0000  
##  Max.   :1.0000   Max.   :1.0000   Max.   :1.0000   Max.   :1.0000  
##      Space       
##  Min.   :0.0000  
##  1st Qu.:0.0000  
##  Median :1.0000  
##  Mean   :0.7104  
##  3rd Qu.:1.0000  
##  Max.   :1.0000

Vamos transformar em Fator as colunas não numéricas

dataset <- dataset %>%
  mutate(Season = as.factor(Season), 
         TurnDay = as_factor(TurnDay))

Feito isso, temos o conjunto de dados final (Por enquanto… xD)

head(dataset, 10)
##       Season TurnDay Brood_Temp Brood_Humidity Hive_Temp Hive_Humidity
## 1  Primavera   noite   29.97778             46  21.75556            33
## 2  Primavera   noite   30.17778             48  21.68333            35
## 3  Primavera   noite   30.78333             47  21.77778            35
## 4  Primavera   noite   31.26111             51  21.85000            35
## 5  Primavera   noite   33.17222             52  21.73889            39
## 6  Primavera   noite   34.27222             50  21.75556            37
## 7  Primavera   noite   34.44444             45  21.76667            37
## 8  Primavera     dia   34.08889             39  21.26111            36
## 9  Primavera     dia   34.13333             41  21.03333            36
## 10 Primavera     dia   34.04444             37  20.78333            37
##      Weight Ext_Temperature DewPoint WindDirection WindSpeed Brood Bees
## 1  38.60979            1.28    -0.94           190       3.6     1    1
## 2  38.61887            1.28    -0.78           180       3.6     1    1
## 3  38.65062            1.17    -0.56           200       4.6     1    1
## 4  38.62794            1.11    -0.22           200       3.1     1    1
## 5  38.86834            0.78     0.56           120       2.1     1    1
## 6  38.96813            0.78     0.56           150       2.6     1    1
## 7  38.90916            0.78     0.39           180       3.1     1    1
## 8  38.92731            0.83     0.33           210       3.6     1    1
## 9  38.86834            0.89     0.33           230       4.6     1    1
## 10 38.70958            0.89     0.39           210       5.1     1    1
##    Queen Food Stressors Space
## 1      1    1         1     0
## 2      1    1         1     0
## 3      1    1         1     0
## 4      1    1         1     0
## 5      1    1         1     0
## 6      1    1         1     0
## 7      1    1         1     0
## 8      1    1         1     0
## 9      1    1         1     0
## 10     1    1         1     0

Clusterização

Melhor número de clusters k

Utilizaremos a função kmeansruns do pacote fpc, para verificar o melhor k baseado nas métrica Calinski-Harabasz. Antes, precisamos de um conjunto de dados totalmente NUMÉRICO, para isso utilizaremos a abordagem Casella de Referência.

dataset_cluster = dataset[, 1:11]

dataset_cluster = dummy_cols(dataset_cluster, select_columns = c('Season', 'TurnDay'),
                             remove_first_dummy = T)

dataset_cluster[, 3:11] = scale(dataset_cluster[, 3:11])

dataset_cluster = dataset_cluster[, 3:14]

km <- kmeansruns(dataset_cluster, krange = 2:10,criterion="ch", runs = 3, 
                 iter.max = 60, critout = T)
## 2  clusters  6859.209 
## 3  clusters  4890.242 
## 4  clusters  4291.702 
## 5  clusters  4091.493 
## 6  clusters  3638.465 
## 7  clusters  3831.488 
## 8  clusters  3099.589 
## 9  clusters  3470.005 
## 10  clusters  3239.475

Melhor Agrupamento de fatores de inspeção

O Melhor valor de k é 2 porém, optaremos por 3 clusters o que nos dará maior informação a passar pro usuario final. Para o prosseguimento do experimento precisamos obter o melhor agrupamento de fatores, por exemplo “123 45 6”, de 3 clusters.

Função para a obtenção do Code, para um determinado agrupamento de fatores

getCode <- function(cols, comb){
  soma = sum(cols)
  comb = unlist(strsplit(comb, " "))
  for(i in 1:3){
    arr = as.integer(unlist(strsplit(comb[i], "")))
    if(as.integer(soma) %in% arr){
      code = i
    }
  }
  return(code - 1)
}

Possiveis Agrupamentos

  • “1234 5 6”
  • “123 45 6”
  • “123 4 56”
  • “12 345 6”
  • “12 34 56”
  • “12 3 456”
  • “1 2345 6”
  • “1 234 56”
  • “1 23 456”
  • “1 2 3456”

Para todos essas combinações rodaremos um algoritmo kNN, e escolheremos o que tiver maior acurácia

possible_comb <- c("1234 5 6", "1235 4 6", "1245 3 6", "1345 2 6", "2345 1 6", "1236 4 5",
                   "1246 3 5", "1346 2 5", "2346 1 5", "1256 3 4", "1356 2 4", "2356 1 4",
                   "1456 2 3", "2456 1 3", "3456 1 2", "1 23 456", "1 24 356", "1 25 346", 
                   "1 26 345", "1 34 256", "1 35 246", "1 36 245", "1 45 236", "1 46 235", 
                   "1 56 234", "2 13 456", "2 14 356", "2 15 346", "2 16 345", "2 34 156", 
                   "2 35 146", "2 36 145", "2 45 136", "2 46 135", "2 56 134", "3 12 456", 
                   "3 14 256", "3 15 246", "3 16 245", "3 24 156", "3 25 146", "3 26 145", 
                   "3 45 126", "3 46 125", "3 56 124", "4 12 356", "4 13 256", "4 15 236", 
                   "4 16 235", "4 23 156", "4 25 136", "4 26 135", "4 35 126", "4 36 125", 
                   "4 56 123", "5 12 346", "5 13 246", "5 14 236", "5 16 234", "5 23 146", 
                   "5 24 136", "5 26 134", "5 34 126", "5 36 124", "5 46 123", "6 12 345", 
                   "6 13 245", "6 14 235", "6 15 234", "6 23 145", "6 24 135", "6 25 134", 
                   "6 34 125", "6 35 124", "6 45 123") 


arr_accuracy_knn <- vector()
#arr_accuracy_svm <- vector()
arr_accuracy_rf <- vector()

for(comb in possible_comb){
  dataset_train <- bind_cols(dataset_cluster, dataset[,12:17])
  dataset_train <- dataset_train %>%
    mutate(index = 1:n()) %>%
    group_by(index) %>%
    mutate(Code = getCode(cbind(Brood, Bees, Queen, Food, Stressors, Space), comb))
  
  dataset_train <- dataset_train %>%
    ungroup() %>%
    mutate(Code = as_factor(Code)) %>%
    select(TurnDay_dia, "Season_Verão", Season_Outono, Brood_Temp, Brood_Humidity,
           Hive_Temp, Hive_Humidity, Ext_Temperature, Weight, DewPoint, WindDirection, 
           WindSpeed, Code)
  
  # apply algorthm knn
  k <- 1:10
  tunegrid <- expand.grid(.k = k)
  knn = train(Code~., data = dataset_train, trControl = trainControl(method = "cv",
                                                                     savePredictions='final'),
                    method = "knn", tuneGrid = tunegrid)
  print(comb)
  print(knn)
  print(confusionMatrix(knn$pred$pred, knn$pred$obs))
  arr_accuracy_knn <- append(arr_accuracy_knn, sum(diag(confusionMatrix(knn)$table))/100)
  
  # apply algorthm svm
  #tunegrid = expand.grid(.C = 1:3, .sigma = 1:4)
  #svm_radial = train(Code~., data = dataset_train, method = "svmRadial",
  #                 trControl = trainControl(method = "cv"),
  #                 tuneGrid = tunegrid)
  #arr_accuracy_svm <- append(arr_accuracy_svm, sum(diag(confusionMatrix(svm_radial)$table))/100)
  
  # apply algorthm knn
  rf = train(Code~., data = dataset_train, method = "ranger",
                   trControl = trainControl(method = "cv",
                                            savePredictions = "final"))
  print(rf)
  print(confusionMatrix(rf$pred$pred, rf$pred$obs))
  arr_accuracy_rf <- append(arr_accuracy_rf, sum(diag(confusionMatrix(rf)$table))/100)
  print("----------------------------------------------------------------------------")
}
## [1] "1234 5 6"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13940, 13941, 13940, 13941, 13940, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8957385  0.8325260
##    2  0.8693315  0.7902234
##    3  0.8756580  0.7996977
##    4  0.8635228  0.7799954
##    5  0.8620374  0.7774187
##    6  0.8532587  0.7629381
##    7  0.8524178  0.7615190
##    8  0.8452516  0.7494948
##    9  0.8400874  0.7408276
##   10  0.8384100  0.7375784
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 3972  318   91
##          1  276 7038  412
##          2   88  430 2865
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8957          
##                  95% CI : (0.8908, 0.9005)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8325          
##                                           
##  Mcnemar's Test P-Value : 0.3333          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9161   0.9039   0.8507
## Specificity            0.9633   0.9107   0.9573
## Pos Pred Value         0.9066   0.9110   0.8469
## Neg Pred Value         0.9672   0.9037   0.9585
## Prevalence             0.2799   0.5026   0.2174
## Detection Rate         0.2564   0.4544   0.1850
## Detection Prevalence   0.2828   0.4988   0.2184
## Balanced Accuracy      0.9397   0.9073   0.9040
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13941, 13940, 13942, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9234331  0.8750737
##    2    extratrees  0.8774035  0.7952221
##    7    gini        0.9417679  0.9060494
##    7    extratrees  0.9397661  0.9022074
##   12    gini        0.9341501  0.8938265
##   12    extratrees  0.9442854  0.9098446
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 4067   97   30
##          1  203 7519  297
##          2   66  170 3041
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9443          
##                  95% CI : (0.9406, 0.9478)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9098          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9380   0.9657   0.9029
## Specificity            0.9886   0.9351   0.9805
## Pos Pred Value         0.9697   0.9376   0.9280
## Neg Pred Value         0.9762   0.9643   0.9732
## Prevalence             0.2799   0.5026   0.2174
## Detection Rate         0.2626   0.4854   0.1963
## Detection Prevalence   0.2708   0.5177   0.2116
## Balanced Accuracy      0.9633   0.9504   0.9417
## [1] "----------------------------------------------------------------------------"
## [1] "1235 4 6"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13941, 13940, 13942, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8907674  0.8096445
##    2  0.8644292  0.7640127
##    3  0.8730153  0.7775640
##    4  0.8588769  0.7527484
##    5  0.8569418  0.7487842
##    6  0.8505492  0.7368050
##    7  0.8471275  0.7298821
##    8  0.8382186  0.7134179
##    9  0.8367971  0.7100053
##   10  0.8320840  0.7010654
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 8256  321  430
##          1  323 2692   88
##          2  444   86 2850
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8908          
##                  95% CI : (0.8858, 0.8956)
##     No Information Rate : 0.5825          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8096          
##                                           
##  Mcnemar's Test P-Value : 0.9685          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9150   0.8687   0.8462
## Specificity            0.8839   0.9668   0.9563
## Pos Pred Value         0.9166   0.8675   0.8432
## Neg Pred Value         0.8817   0.9671   0.9572
## Prevalence             0.5825   0.2001   0.2174
## Detection Rate         0.5330   0.1738   0.1840
## Detection Prevalence   0.5815   0.2003   0.2182
## Balanced Accuracy      0.8994   0.9177   0.9012
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13942, 13940, 13943, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9183353  0.8532677
##    2    extratrees  0.8635244  0.7431624
##    7    gini        0.9357654  0.8866569
##    7    extratrees  0.9360237  0.8861997
##   12    gini        0.9290498  0.8748801
##   12    extratrees  0.9398974  0.8935313
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 8779  294  310
##          1   72 2745   23
##          2  172   60 3035
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9399         
##                  95% CI : (0.936, 0.9436)
##     No Information Rate : 0.5825         
##     P-Value [Acc > NIR] : < 2.2e-16      
##                                          
##                   Kappa : 0.8935         
##                                          
##  Mcnemar's Test P-Value : < 2.2e-16      
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9730   0.8858   0.9011
## Specificity            0.9066   0.9923   0.9809
## Pos Pred Value         0.9356   0.9665   0.9290
## Neg Pred Value         0.9600   0.9720   0.9728
## Prevalence             0.5825   0.2001   0.2174
## Detection Rate         0.5668   0.1772   0.1959
## Detection Prevalence   0.6057   0.1833   0.2109
## Balanced Accuracy      0.9398   0.9391   0.9410
## [1] "----------------------------------------------------------------------------"
## [1] "1245 3 6"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9295029  0.8102545
##    2  0.9100065  0.7586932
##    3  0.9167205  0.7733324
##    4  0.9050355  0.7421841
##    5  0.9066495  0.7442475
##    6  0.9001291  0.7255138
##    7  0.8988380  0.7200340
##    8  0.8937379  0.7048486
##    9  0.8921240  0.6988553
##   10  0.8867011  0.6828646
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0 11252    36   488
##          1    44   266     0
##          2   524     0  2880
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9295          
##                  95% CI : (0.9254, 0.9335)
##     No Information Rate : 0.7631          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.8103          
##                                           
##  Mcnemar's Test P-Value : NA              
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9519  0.88079   0.8551
## Specificity            0.8572  0.99710   0.9568
## Pos Pred Value         0.9555  0.85806   0.8461
## Neg Pred Value         0.8471  0.99763   0.9596
## Prevalence             0.7631  0.01950   0.2174
## Detection Rate         0.7264  0.01717   0.1859
## Detection Prevalence   0.7602  0.02001   0.2198
## Balanced Accuracy      0.9046  0.93895   0.9059
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13941, 13941, 13940, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9375071  0.8196579
##    2    extratrees  0.8941901  0.6668151
##    7    gini        0.9540347  0.8725007
##    7    extratrees  0.9521618  0.8654677
##   12    gini        0.9510006  0.8646071
##   12    extratrees  0.9549381  0.8743969
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0 11617    63   432
##          1     6   239     0
##          2   197     0  2936
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9549          
##                  95% CI : (0.9516, 0.9582)
##     No Information Rate : 0.7631          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.8745          
##                                           
##  Mcnemar's Test P-Value : NA              
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9828  0.79139   0.8717
## Specificity            0.8651  0.99960   0.9837
## Pos Pred Value         0.9591  0.97551   0.9371
## Neg Pred Value         0.9399  0.99587   0.9650
## Prevalence             0.7631  0.01950   0.2174
## Detection Rate         0.7500  0.01543   0.1895
## Detection Prevalence   0.7819  0.01582   0.2023
## Balanced Accuracy      0.9240  0.89550   0.9277
## [1] "----------------------------------------------------------------------------"
## [1] "1345 2 6"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13941, 13940, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9224010  0.8077579
##    2  0.9020647  0.7589109
##    3  0.9103929  0.7763510
##    4  0.8972227  0.7433670
##    5  0.8996766  0.7466887
##    6  0.8910900  0.7248251
##    7  0.8874750  0.7134595
##    8  0.8843772  0.7055136
##    9  0.8802447  0.6928797
##   10  0.8760484  0.6812457
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0 10859    66   510
##          1    91   574     3
##          2   530     2  2855
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9224          
##                  95% CI : (0.9181, 0.9266)
##     No Information Rate : 0.7411          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8077          
##                                           
##  Mcnemar's Test P-Value : 0.2065          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9459  0.89408   0.8477
## Specificity            0.8564  0.99367   0.9561
## Pos Pred Value         0.9496  0.85928   0.8429
## Neg Pred Value         0.8469  0.99541   0.9576
## Prevalence             0.7411  0.04145   0.2174
## Detection Rate         0.7010  0.03706   0.1843
## Detection Prevalence   0.7382  0.04312   0.2187
## Balanced Accuracy      0.9011  0.94388   0.9019
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13942, 13941, 13941, 13940, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9367977  0.8334365
##    2    extratrees  0.8917382  0.6902818
##    7    gini        0.9534530  0.8818254
##    7    extratrees  0.9525496  0.8777207
##   12    gini        0.9495791  0.8724179
##   12    extratrees  0.9564878  0.8886099
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0 11294    62   426
##          1    11   580     0
##          2   175     0  2942
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9565          
##                  95% CI : (0.9532, 0.9596)
##     No Information Rate : 0.7411          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.8887          
##                                           
##  Mcnemar's Test P-Value : NA              
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9838  0.90343   0.8735
## Specificity            0.8783  0.99926   0.9856
## Pos Pred Value         0.9586  0.98139   0.9439
## Neg Pred Value         0.9498  0.99584   0.9656
## Prevalence             0.7411  0.04145   0.2174
## Detection Rate         0.7291  0.03744   0.1899
## Detection Prevalence   0.7606  0.03815   0.2012
## Balanced Accuracy      0.9311  0.95134   0.9295
## [1] "----------------------------------------------------------------------------"
## [1] "2345 1 6"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13940, 13942, 13940, 13941, 13940, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9281479  0.8058560
##    2  0.9086513  0.7532331
##    3  0.9142021  0.7657617
##    4  0.9061331  0.7428669
##    5  0.9058108  0.7395553
##    6  0.8958684  0.7114458
##    7  0.8961270  0.7090499
##    8  0.8912861  0.6947532
##    9  0.8883174  0.6843687
##   10  0.8823777  0.6675162
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0 11257    35   505
##          1    35   258     1
##          2   537     0  2862
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9281         
##                  95% CI : (0.924, 0.9322)
##     No Information Rate : 0.7637         
##     P-Value [Acc > NIR] : <2e-16         
##                                          
##                   Kappa : 0.806          
##                                          
##  Mcnemar's Test P-Value : 0.576          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9516  0.88055   0.8498
## Specificity            0.8525  0.99763   0.9557
## Pos Pred Value         0.9542  0.87755   0.8420
## Neg Pred Value         0.8451  0.99770   0.9582
## Prevalence             0.7637  0.01892   0.2174
## Detection Rate         0.7267  0.01666   0.1848
## Detection Prevalence   0.7616  0.01898   0.2194
## Balanced Accuracy      0.9021  0.93909   0.9027
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13942, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9408654  0.8301053
##    2    extratrees  0.8991606  0.6841064
##    7    gini        0.9573273  0.8824050
##    7    extratrees  0.9543574  0.8717687
##   12    gini        0.9533246  0.8718571
##   12    extratrees  0.9582307  0.8837862
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0 11638    36   420
##          1     6   257     0
##          2   185     0  2948
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9582         
##                  95% CI : (0.955, 0.9613)
##     No Information Rate : 0.7637         
##     P-Value [Acc > NIR] : < 2.2e-16      
##                                          
##                   Kappa : 0.8838         
##                                          
##  Mcnemar's Test P-Value : NA             
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9839  0.87713   0.8753
## Specificity            0.8754  0.99961   0.9847
## Pos Pred Value         0.9623  0.97719   0.9410
## Neg Pred Value         0.9438  0.99764   0.9660
## Prevalence             0.7637  0.01892   0.2174
## Detection Rate         0.7513  0.01659   0.1903
## Detection Prevalence   0.7808  0.01698   0.2023
## Balanced Accuracy      0.9296  0.93837   0.9300
## [1] "----------------------------------------------------------------------------"
## [1] "1236 4 5"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13940, 13942, 13940, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8885094  0.8199568
##    2  0.8587478  0.7720916
##    3  0.8664948  0.7837336
##    4  0.8533901  0.7621033
##    5  0.8519684  0.7595906
##    6  0.8432534  0.7450869
##    7  0.8404133  0.7401393
##    8  0.8327295  0.7271943
##    9  0.8314386  0.7246466
##   10  0.8267253  0.7164787
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 4032  154  459
##          1  134 2678  274
##          2  439  267 7053
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8885          
##                  95% CI : (0.8834, 0.8934)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8199          
##                                           
##  Mcnemar's Test P-Value : 0.5881          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8756   0.8641   0.9059
## Specificity            0.9437   0.9671   0.9084
## Pos Pred Value         0.8680   0.8678   0.9090
## Neg Pred Value         0.9472   0.9661   0.9052
## Prevalence             0.2973   0.2001   0.5026
## Detection Rate         0.2603   0.1729   0.4553
## Detection Prevalence   0.2999   0.1992   0.5009
## Balanced Accuracy      0.9096   0.9156   0.9071
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13942, 13942, 13940, 13940, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9205285  0.8694852
##    2    extratrees  0.8724985  0.7859486
##    7    gini        0.9398968  0.9022353
##    7    extratrees  0.9369912  0.8971195
##   12    gini        0.9371195  0.8977688
##   12    extratrees  0.9420910  0.9057052
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 4245   79  183
##          1   56 2806   61
##          2  304  214 7542
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9421          
##                  95% CI : (0.9383, 0.9457)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9057          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9218   0.9055   0.9687
## Specificity            0.9759   0.9906   0.9328
## Pos Pred Value         0.9419   0.9600   0.9357
## Neg Pred Value         0.9672   0.9767   0.9672
## Prevalence             0.2973   0.2001   0.5026
## Detection Rate         0.2740   0.1811   0.4869
## Detection Prevalence   0.2910   0.1887   0.5203
## Balanced Accuracy      0.9489   0.9480   0.9507
## [1] "----------------------------------------------------------------------------"
## [1] "1246 3 5"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13940, 13940, 13941, 13942, 13940, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9056169  0.8182065
##    2  0.8805678  0.7699273
##    3  0.8866365  0.7814649
##    4  0.8735322  0.7561359
##    5  0.8752112  0.7592595
##    6  0.8666251  0.7427102
##    7  0.8646885  0.7390009
##    8  0.8574580  0.7249833
##    9  0.8549396  0.7199636
##   10  0.8493874  0.7092256
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 6695   29  707
##          1   37  268   14
##          2  670    5 7065
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9056          
##                  95% CI : (0.9009, 0.9102)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8182          
##                                           
##  Mcnemar's Test P-Value : 0.1011          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9045  0.88742   0.9074
## Specificity            0.9090  0.99664   0.9124
## Pos Pred Value         0.9010  0.84013   0.9128
## Neg Pred Value         0.9123  0.99776   0.9070
## Prevalence             0.4779  0.01950   0.5026
## Detection Rate         0.4322  0.01730   0.4561
## Detection Prevalence   0.4797  0.02059   0.4997
## Balanced Accuracy      0.9067  0.94203   0.9099
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13940, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9338286  0.8718275
##    2    extratrees  0.8941252  0.7941274
##    7    gini        0.9446098  0.8927578
##    7    extratrees  0.9479021  0.8992682
##   12    gini        0.9402845  0.8844366
##   12    extratrees  0.9508714  0.9050414
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 6992   39  310
##          1    2  262    1
##          2  408    1 7475
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9509          
##                  95% CI : (0.9473, 0.9542)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.905           
##                                           
##  Mcnemar's Test P-Value : 3.897e-10       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9446  0.86755   0.9601
## Specificity            0.9568  0.99980   0.9469
## Pos Pred Value         0.9525  0.98868   0.9481
## Neg Pred Value         0.9497  0.99737   0.9591
## Prevalence             0.4779  0.01950   0.5026
## Detection Rate         0.4514  0.01691   0.4826
## Detection Prevalence   0.4739  0.01711   0.5090
## Balanced Accuracy      0.9507  0.93368   0.9535
## [1] "----------------------------------------------------------------------------"
## [1] "1346 2 5"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13940, 13941, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8975476  0.8097296
##    2  0.8737251  0.7657420
##    3  0.8779857  0.7732198
##    4  0.8631377  0.7457131
##    5  0.8659132  0.7507500
##    6  0.8529368  0.7264237
##    7  0.8517749  0.7244261
##    8  0.8456419  0.7127910
##    9  0.8449316  0.7112976
##   10  0.8391862  0.7004602
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 6294   61  729
##          1   73  571   19
##          2  695   10 7038
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8975          
##                  95% CI : (0.8927, 0.9023)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8097          
##                                           
##  Mcnemar's Test P-Value : 0.1968          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8912  0.88941   0.9039
## Specificity            0.9063  0.99380   0.9085
## Pos Pred Value         0.8885  0.86124   0.9090
## Neg Pred Value         0.9086  0.99521   0.9034
## Prevalence             0.4559  0.04145   0.5026
## Detection Rate         0.4063  0.03686   0.4544
## Detection Prevalence   0.4573  0.04280   0.4999
## Balanced Accuracy      0.8988  0.94161   0.9062
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13941, 13942, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9326011  0.8741421
##    2    extratrees  0.8923826  0.7974472
##    7    gini        0.9453837  0.8983034
##    7    extratrees  0.9475142  0.9021948
##   12    gini        0.9406712  0.8895045
##   12    extratrees  0.9498386  0.9065776
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 6626   39  297
##          1   18  602    4
##          2  418    1 7485
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9498          
##                  95% CI : (0.9463, 0.9532)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9066          
##                                           
##  Mcnemar's Test P-Value : 1.371e-06       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9383  0.93769   0.9613
## Specificity            0.9601  0.99852   0.9456
## Pos Pred Value         0.9517  0.96474   0.9470
## Neg Pred Value         0.9489  0.99731   0.9603
## Prevalence             0.4559  0.04145   0.5026
## Detection Rate         0.4278  0.03886   0.4832
## Detection Prevalence   0.4495  0.04028   0.5103
## Balanced Accuracy      0.9492  0.96811   0.9535
## [1] "----------------------------------------------------------------------------"
## [1] "2346 1 5"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13942, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9025170  0.8118299
##    2  0.8775989  0.7637036
##    3  0.8842487  0.7762784
##    4  0.8705619  0.7497348
##    5  0.8715949  0.7515496
##    6  0.8597161  0.7282875
##    7  0.8613305  0.7312631
##    8  0.8536473  0.7162846
##    9  0.8514524  0.7120105
##   10  0.8467402  0.7026252
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 6685   37  742
##          1   35  253    2
##          2  691    3 7042
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9025          
##                  95% CI : (0.8977, 0.9071)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8118          
##                                           
##  Mcnemar's Test P-Value : 0.5579          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9020  0.86348   0.9044
## Specificity            0.9036  0.99757   0.9099
## Pos Pred Value         0.8956  0.87241   0.9103
## Neg Pred Value         0.9095  0.99737   0.9040
## Prevalence             0.4784  0.01892   0.5026
## Detection Rate         0.4316  0.01633   0.4546
## Detection Prevalence   0.4819  0.01872   0.4994
## Balanced Accuracy      0.9028  0.93052   0.9072
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13941, 13941, 13941, 13941, 13940, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9341519  0.8723794
##    2    extratrees  0.8948350  0.7952266
##    7    gini        0.9487423  0.9008711
##    7    extratrees  0.9476440  0.8986914
##   12    gini        0.9446756  0.8929931
##   12    extratrees  0.9508076  0.9048345
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 6986   39  298
##          1    6  254    0
##          2  419    0 7488
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9508          
##                  95% CI : (0.9473, 0.9542)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9048          
##                                           
##  Mcnemar's Test P-Value : NA              
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9427  0.86689   0.9617
## Specificity            0.9583  0.99961   0.9456
## Pos Pred Value         0.9540  0.97692   0.9470
## Neg Pred Value         0.9480  0.99744   0.9607
## Prevalence             0.4784  0.01892   0.5026
## Detection Rate         0.4510  0.01640   0.4834
## Detection Prevalence   0.4728  0.01679   0.5105
## Balanced Accuracy      0.9505  0.93325   0.9537
## [1] "----------------------------------------------------------------------------"
## [1] "1256 3 4"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13940, 13941, 13940, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9445449  0.8418987
##    2  0.9322146  0.8066319
##    3  0.9352484  0.8111670
##    4  0.9289220  0.7925299
##    5  0.9306647  0.7955479
##    6  0.9245312  0.7763390
##    7  0.9244669  0.7746168
##    8  0.9211744  0.7633260
##    9  0.9209163  0.7610427
##   10  0.9176882  0.7502188
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0 11674    25   387
##          1    27   264    19
##          2   388    13  2693
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9445          
##                  95% CI : (0.9408, 0.9481)
##     No Information Rate : 0.7804          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8419          
##                                           
##  Mcnemar's Test P-Value : 0.7522          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9657  0.87417   0.8690
## Specificity            0.8789  0.99697   0.9676
## Pos Pred Value         0.9659  0.85161   0.8704
## Neg Pred Value         0.8781  0.99750   0.9672
## Prevalence             0.7804  0.01950   0.2001
## Detection Rate         0.7536  0.01704   0.1739
## Detection Prevalence   0.7802  0.02001   0.1997
## Balanced Accuracy      0.9223  0.93557   0.9183
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13941, 13941, 13942, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9488701  0.8427540
##    2    extratrees  0.9218204  0.7450876
##    7    gini        0.9632663  0.8908103
##    7    extratrees  0.9635253  0.8909613
##   12    gini        0.9604906  0.8832798
##   12    extratrees  0.9666238  0.9008160
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0 12016    34   395
##          1     3   256     3
##          2    70    12  2701
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9666          
##                  95% CI : (0.9637, 0.9694)
##     No Information Rate : 0.7804          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9009          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9940  0.84768   0.8716
## Specificity            0.8739  0.99960   0.9934
## Pos Pred Value         0.9655  0.97710   0.9705
## Neg Pred Value         0.9760  0.99698   0.9687
## Prevalence             0.7804  0.01950   0.2001
## Detection Rate         0.7757  0.01653   0.1744
## Detection Prevalence   0.8034  0.01691   0.1797
## Balanced Accuracy      0.9339  0.92364   0.9325
## [1] "----------------------------------------------------------------------------"
## [1] "1356 2 4"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13942, 13942, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9416385  0.8476907
##    2  0.9251761  0.8047578
##    3  0.9309215  0.8164223
##    4  0.9255637  0.8020192
##    5  0.9250475  0.7977707
##    6  0.9200761  0.7846972
##    7  0.9182675  0.7784275
##    8  0.9140069  0.7657837
##    9  0.9136850  0.7631706
##   10  0.9109747  0.7553266
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0 11325    42   379
##          1    52   573    32
##          2   372    27  2688
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9416          
##                  95% CI : (0.9378, 0.9453)
##     No Information Rate : 0.7585          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8477          
##                                           
##  Mcnemar's Test P-Value : 0.6701          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9639  0.89252   0.8674
## Specificity            0.8875  0.99434   0.9678
## Pos Pred Value         0.9642  0.87215   0.8707
## Neg Pred Value         0.8868  0.99535   0.9669
## Prevalence             0.7585  0.04145   0.2001
## Detection Rate         0.7311  0.03699   0.1735
## Detection Prevalence   0.7583  0.04241   0.1993
## Balanced Accuracy      0.9257  0.94343   0.9176
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9502905  0.8620464
##    2    extratrees  0.9225307  0.7728497
##    7    gini        0.9642350  0.9036018
##    7    extratrees  0.9642350  0.9031105
##   12    gini        0.9603615  0.8939358
##   12    extratrees  0.9667527  0.9103340
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0 11669    19   389
##          1    11   604     8
##          2    69    19  2702
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9668          
##                  95% CI : (0.9638, 0.9695)
##     No Information Rate : 0.7585          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9104          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9932  0.94081   0.8719
## Specificity            0.8909  0.99872   0.9929
## Pos Pred Value         0.9662  0.96950   0.9685
## Neg Pred Value         0.9766  0.99744   0.9687
## Prevalence             0.7585  0.04145   0.2001
## Detection Rate         0.7533  0.03899   0.1744
## Detection Prevalence   0.7797  0.04022   0.1801
## Balanced Accuracy      0.9421  0.96977   0.9324
## [1] "----------------------------------------------------------------------------"
## [1] "2356 1 4"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13941, 13941, 13941, 13941, 13940, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9445445  0.8410832
##    2  0.9302780  0.8000518
##    3  0.9335701  0.8055932
##    4  0.9277590  0.7874548
##    5  0.9278236  0.7849285
##    6  0.9235625  0.7712647
##    7  0.9220780  0.7641740
##    8  0.9191088  0.7546336
##    9  0.9176233  0.7479719
##   10  0.9148473  0.7387510
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0 11680    32   401
##          1    30   257     4
##          2   388     4  2694
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9445          
##                  95% CI : (0.9408, 0.9481)
##     No Information Rate : 0.781           
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8411          
##                                           
##  Mcnemar's Test P-Value : 0.964           
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9654  0.87713   0.8693
## Specificity            0.8723  0.99776   0.9684
## Pos Pred Value         0.9643  0.88316   0.8730
## Neg Pred Value         0.8762  0.99763   0.9673
## Prevalence             0.7810  0.01892   0.2001
## Detection Rate         0.7540  0.01659   0.1739
## Detection Prevalence   0.7820  0.01879   0.1992
## Balanced Accuracy      0.9189  0.93745   0.9188
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13942, 13942, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9480299  0.8390161
##    2    extratrees  0.9214318  0.7414374
##    7    gini        0.9630727  0.8899991
##    7    extratrees  0.9625554  0.8875365
##   12    gini        0.9608120  0.8840464
##   12    extratrees  0.9655899  0.8975417
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0 12009    31   411
##          1     8   260     0
##          2    81     2  2688
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9656          
##                  95% CI : (0.9626, 0.9684)
##     No Information Rate : 0.781           
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.8976          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9926  0.88737   0.8674
## Specificity            0.8697  0.99947   0.9933
## Pos Pred Value         0.9645  0.97015   0.9700
## Neg Pred Value         0.9707  0.99783   0.9677
## Prevalence             0.7810  0.01892   0.2001
## Detection Rate         0.7753  0.01679   0.1735
## Detection Prevalence   0.8038  0.01730   0.1789
## Balanced Accuracy      0.9312  0.94342   0.9303
## [1] "----------------------------------------------------------------------------"
## [1] "1456 2 3"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13940, 13941, 13942, 13940, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9854742  0.8776215
##    2  0.9805031  0.8359573
##    3  0.9815364  0.8418572
##    4  0.9791483  0.8218837
##    5  0.9779212  0.8086813
##    6  0.9766956  0.7973063
##    7  0.9763725  0.7935745
##    8  0.9748235  0.7775643
##    9  0.9734677  0.7666213
##   10  0.9728864  0.7577610
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0 14421    59    23
##          1    83   577    12
##          2    42     6   267
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9855          
##                  95% CI : (0.9835, 0.9873)
##     No Information Rate : 0.9391          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.8775          
##                                           
##  Mcnemar's Test P-Value : 0.008845        
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9914  0.89875  0.88411
## Specificity            0.9131  0.99360  0.99684
## Pos Pred Value         0.9943  0.85863  0.84762
## Neg Pred Value         0.8734  0.99561  0.99769
## Prevalence             0.9391  0.04145  0.01950
## Detection Rate         0.9310  0.03725  0.01724
## Detection Prevalence   0.9363  0.04338  0.02034
## Balanced Accuracy      0.9523  0.94618  0.94047
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13941, 13941, 13940, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9841837  0.8469272
##    2    extratrees  0.9758558  0.7446382
##    7    gini        0.9907041  0.9160258
##    7    extratrees  0.9907038  0.9153437
##   12    gini        0.9902522  0.9130562
##   12    extratrees  0.9908977  0.9176338
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0 14520    61    49
##          1    21   577     1
##          2     5     4   252
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9909          
##                  95% CI : (0.9893, 0.9923)
##     No Information Rate : 0.9391          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9181          
##                                           
##  Mcnemar's Test P-Value : 2.371e-12       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9982  0.89875  0.83444
## Specificity            0.8835  0.99852  0.99941
## Pos Pred Value         0.9925  0.96327  0.96552
## Neg Pred Value         0.9698  0.99563  0.99672
## Prevalence             0.9391  0.04145  0.01950
## Detection Rate         0.9374  0.03725  0.01627
## Detection Prevalence   0.9445  0.03867  0.01685
## Balanced Accuracy      0.9408  0.94864  0.91692
## [1] "----------------------------------------------------------------------------"
## [1] "2456 1 3"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13942, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9901872  0.8696145
##    2  0.9885734  0.8476145
##    3  0.9881863  0.8389193
##    4  0.9870241  0.8201332
##    5  0.9868951  0.8149409
##    6  0.9859913  0.8015183
##    7  0.9854750  0.7901044
##    8  0.9852814  0.7865825
##    9  0.9852812  0.7858801
##   10  0.9839255  0.7649105
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0 14820    36    28
##          1    33   250     6
##          2    42     7   268
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9902          
##                  95% CI : (0.9885, 0.9917)
##     No Information Rate : 0.9616          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8696          
##                                           
##  Mcnemar's Test P-Value : 0.3905          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9950  0.85324  0.88742
## Specificity            0.8924  0.99743  0.99677
## Pos Pred Value         0.9957  0.86505  0.84543
## Neg Pred Value         0.8762  0.99717  0.99776
## Prevalence             0.9616  0.01892  0.01950
## Detection Rate         0.9567  0.01614  0.01730
## Detection Prevalence   0.9609  0.01866  0.02046
## Balanced Accuracy      0.9437  0.92534  0.94210
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13940, 13942, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9894120  0.8379795
##    2    extratrees  0.9835376  0.7212045
##    7    gini        0.9934795  0.9062804
##    7    extratrees  0.9930275  0.8985995
##   12    gini        0.9928337  0.8978661
##   12    extratrees  0.9936730  0.9091508
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0 14886    40    45
##          1     6   252     3
##          2     3     1   254
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9937          
##                  95% CI : (0.9923, 0.9949)
##     No Information Rate : 0.9616          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9096          
##                                           
##  Mcnemar's Test P-Value : 1.424e-13       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9994  0.86007  0.84106
## Specificity            0.8571  0.99941  0.99974
## Pos Pred Value         0.9943  0.96552  0.98450
## Neg Pred Value         0.9827  0.99731  0.99685
## Prevalence             0.9616  0.01892  0.01950
## Detection Rate         0.9610  0.01627  0.01640
## Detection Prevalence   0.9665  0.01685  0.01666
## Balanced Accuracy      0.9283  0.92974  0.92040
## [1] "----------------------------------------------------------------------------"
## [1] "3456 1 2"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13942, 13942, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9883150  0.8993246
##    2  0.9828926  0.8530462
##    3  0.9840542  0.8596685
##    4  0.9823754  0.8431761
##    5  0.9796640  0.8178259
##    6  0.9785664  0.8064065
##    7  0.9783727  0.8021538
##    8  0.9772751  0.7924700
##    9  0.9766946  0.7849215
##   10  0.9762426  0.7792604
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0 14479    12    44
##          1    16   254    22
##          2    60    27   576
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9883          
##                  95% CI : (0.9865, 0.9899)
##     No Information Rate : 0.9396          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8994          
##                                           
##  Mcnemar's Test P-Value : 0.3152          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9948  0.86689  0.89720
## Specificity            0.9401  0.99750  0.99414
## Pos Pred Value         0.9961  0.86986  0.86878
## Neg Pred Value         0.9204  0.99743  0.99555
## Prevalence             0.9396  0.01892  0.04145
## Detection Rate         0.9347  0.01640  0.03719
## Detection Prevalence   0.9383  0.01885  0.04280
## Balanced Accuracy      0.9674  0.93220  0.94567
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13940, 13939, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9896067  0.9031705
##    2    extratrees  0.9804394  0.8012781
##    7    gini        0.9916078  0.9243310
##    7    extratrees  0.9934157  0.9409461
##   12    gini        0.9908332  0.9178016
##   12    extratrees  0.9936739  0.9434571
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0 14540     8    53
##          1     6   268     5
##          2     9    17   584
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9937          
##                  95% CI : (0.9923, 0.9949)
##     No Information Rate : 0.9396          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9437          
##                                           
##  Mcnemar's Test P-Value : 2.749e-08       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9990  0.91468  0.90966
## Specificity            0.9348  0.99928  0.99825
## Pos Pred Value         0.9958  0.96057  0.95738
## Neg Pred Value         0.9831  0.99836  0.99610
## Prevalence             0.9396  0.01892  0.04145
## Detection Rate         0.9387  0.01730  0.03770
## Detection Prevalence   0.9426  0.01801  0.03938
## Balanced Accuracy      0.9669  0.95698  0.95395
## [1] "----------------------------------------------------------------------------"
## [1] "1 23 456"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13941, 13941, 13942, 13941, 13939, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9848933  0.9000915
##    2  0.9804391  0.8700037
##    3  0.9811492  0.8739801
##    4  0.9787606  0.8569639
##    5  0.9775341  0.8474167
##    6  0.9761776  0.8372975
##    7  0.9753382  0.8296537
##    8  0.9744986  0.8236564
##    9  0.9734012  0.8151805
##   10  0.9719814  0.8047664
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   255    30     7
##          1    30   853    98
##          2     8    61 14148
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9849          
##                  95% CI : (0.9828, 0.9868)
##     No Information Rate : 0.9201          
##     P-Value [Acc > NIR] : < 2e-16         
##                                           
##                   Kappa : 0.9001          
##                                           
##  Mcnemar's Test P-Value : 0.03391         
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.87031  0.90360   0.9926
## Specificity           0.99757  0.99120   0.9442
## Pos Pred Value        0.87329  0.86952   0.9951
## Neg Pred Value        0.99750  0.99373   0.9175
## Prevalence            0.01892  0.06094   0.9201
## Detection Rate        0.01646  0.05507   0.9134
## Detection Prevalence  0.01885  0.06333   0.9178
## Balanced Accuracy     0.93394  0.94740   0.9684
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13940, 13942, 13942, 13940, 13940, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9863130  0.9027355
##    2    extratrees  0.9775981  0.8322904
##    7    gini        0.9910260  0.9382632
##    7    extratrees  0.9903161  0.9334238
##   12    gini        0.9903806  0.9344074
##   12    extratrees  0.9912844  0.9403638
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   257     9     1
##          1    29   868    22
##          2     7    67 14230
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9913          
##                  95% CI : (0.9897, 0.9927)
##     No Information Rate : 0.9201          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9405          
##                                           
##  Mcnemar's Test P-Value : 3.148e-08       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.87713  0.91949   0.9984
## Specificity           0.99934  0.99649   0.9402
## Pos Pred Value        0.96255  0.94450   0.9948
## Neg Pred Value        0.99764  0.99478   0.9806
## Prevalence            0.01892  0.06094   0.9201
## Detection Rate        0.01659  0.05604   0.9187
## Detection Prevalence  0.01724  0.05933   0.9234
## Balanced Accuracy     0.93824  0.95799   0.9693
## [1] "----------------------------------------------------------------------------"
## [1] "1 24 356"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13941, 13940, 13941, 13942, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9439638  0.8583334
##    2  0.9292439  0.8205145
##    3  0.9358291  0.8350418
##    4  0.9280176  0.8148172
##    5  0.9286629  0.8145842
##    6  0.9253062  0.8047834
##    7  0.9233698  0.7992241
##    8  0.9201417  0.7903468
##    9  0.9198837  0.7886102
##   10  0.9173659  0.7816877
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   249    28     9
##          1    35  3339   413
##          2     9   374 11034
## 
## Overall Statistics
##                                           
##                Accuracy : 0.944           
##                  95% CI : (0.9402, 0.9475)
##     No Information Rate : 0.7396          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8583          
##                                           
##  Mcnemar's Test P-Value : 0.4385          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.84983   0.8925   0.9632
## Specificity           0.99757   0.9619   0.9051
## Pos Pred Value        0.87063   0.8817   0.9665
## Neg Pred Value        0.99711   0.9656   0.8964
## Prevalence            0.01892   0.2415   0.7396
## Detection Rate        0.01607   0.2156   0.7123
## Detection Prevalence  0.01846   0.2445   0.7371
## Balanced Accuracy     0.92370   0.9272   0.9341
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13942, 13942, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9535183  0.8766434
##    2    extratrees  0.9315687  0.8124564
##    7    gini        0.9663009  0.9126361
##    7    extratrees  0.9648162  0.9082348
##   12    gini        0.9609428  0.8990826
##   12    extratrees  0.9679795  0.9168397
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   256     5     4
##          1    33  3375    89
##          2     4   361 11363
## 
## Overall Statistics
##                                           
##                Accuracy : 0.968           
##                  95% CI : (0.9651, 0.9707)
##     No Information Rate : 0.7396          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9169          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.87372   0.9022   0.9919
## Specificity           0.99941   0.9896   0.9095
## Pos Pred Value        0.96604   0.9651   0.9689
## Neg Pred Value        0.99757   0.9695   0.9753
## Prevalence            0.01892   0.2415   0.7396
## Detection Rate        0.01653   0.2179   0.7336
## Detection Prevalence  0.01711   0.2258   0.7571
## Balanced Accuracy     0.93656   0.9459   0.9507
## [1] "----------------------------------------------------------------------------"
## [1] "1 25 346"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8998703  0.8047451
##    2  0.8704964  0.7474467
##    3  0.8785662  0.7627410
##    4  0.8659119  0.7379551
##    5  0.8664287  0.7386648
##    6  0.8557124  0.7174092
##    7  0.8555186  0.7167282
##    8  0.8448668  0.6955350
##    9  0.8460929  0.6978347
##   10  0.8409284  0.6876961
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0  253   28   13
##          1   28 7653  723
##          2   12  747 6033
## 
## Overall Statistics
##                                          
##                Accuracy : 0.8999         
##                  95% CI : (0.895, 0.9046)
##     No Information Rate : 0.5441         
##     P-Value [Acc > NIR] : <2e-16         
##                                          
##                   Kappa : 0.8048         
##                                          
##  Mcnemar's Test P-Value : 0.9336         
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.86348   0.9080   0.8913
## Specificity           0.99730   0.8937   0.9130
## Pos Pred Value        0.86054   0.9106   0.8883
## Neg Pred Value        0.99737   0.8906   0.9154
## Prevalence            0.01892   0.5441   0.4370
## Detection Rate        0.01633   0.4941   0.3895
## Detection Prevalence  0.01898   0.5425   0.4385
## Balanced Accuracy     0.93039   0.9009   0.9021
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13941, 13941, 13941, 13940, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9337628  0.8699625
##    2    extratrees  0.8936739  0.7890762
##    7    gini        0.9426073  0.8877627
##    7    extratrees  0.9452549  0.8927048
##   12    gini        0.9316314  0.8663912
##   12    extratrees  0.9504841  0.9030756
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0  264    5    5
##          1   23 8141  446
##          2    6  282 6318
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9505          
##                  95% CI : (0.9469, 0.9538)
##     No Information Rate : 0.5441          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9031          
##                                           
##  Mcnemar's Test P-Value : 1.581e-10       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.90102   0.9659   0.9334
## Specificity           0.99934   0.9336   0.9670
## Pos Pred Value        0.96350   0.9455   0.9564
## Neg Pred Value        0.99809   0.9583   0.9492
## Prevalence            0.01892   0.5441   0.4370
## Detection Rate        0.01704   0.5256   0.4079
## Detection Prevalence  0.01769   0.5558   0.4265
## Balanced Accuracy     0.95018   0.9498   0.9502
## [1] "----------------------------------------------------------------------------"
## [1] "1 26 345"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13941, 13941, 13941, 13940, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9219493  0.8106317
##    2  0.9016800  0.7620835
##    3  0.9063923  0.7707197
##    4  0.8914798  0.7338248
##    5  0.8941913  0.7394421
##    6  0.8840563  0.7131525
##    7  0.8828942  0.7085669
##    8  0.8791504  0.6990369
##    9  0.8746950  0.6863672
##   10  0.8715965  0.6776932
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   257    22    14
##          1    24  3436   585
##          2    12   552 10588
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9219          
##                  95% CI : (0.9176, 0.9261)
##     No Information Rate : 0.7222          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8106          
##                                           
##  Mcnemar's Test P-Value : 0.7533          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.87713   0.8569   0.9465
## Specificity           0.99763   0.9470   0.8689
## Pos Pred Value        0.87713   0.8494   0.9494
## Neg Pred Value        0.99763   0.9498   0.8619
## Prevalence            0.01892   0.2589   0.7222
## Detection Rate        0.01659   0.2218   0.6835
## Detection Prevalence  0.01892   0.2611   0.7199
## Balanced Accuracy     0.93738   0.9019   0.9077
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13940, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9369272  0.8398899
##    2    extratrees  0.8961266  0.7187766
##    7    gini        0.9556485  0.8904595
##    7    extratrees  0.9525497  0.8814501
##   12    gini        0.9513877  0.8800858
##   12    extratrees  0.9554552  0.8893174
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 7, splitrule = gini
##  and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   263     4     8
##          1    17  3590   229
##          2    13   416 10950
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9556          
##                  95% CI : (0.9523, 0.9588)
##     No Information Rate : 0.7222          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.8905          
##                                           
##  Mcnemar's Test P-Value : 1.074e-13       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.89761   0.8953   0.9788
## Specificity           0.99921   0.9786   0.9003
## Pos Pred Value        0.95636   0.9359   0.9623
## Neg Pred Value        0.99803   0.9640   0.9423
## Prevalence            0.01892   0.2589   0.7222
## Detection Rate        0.01698   0.2318   0.7069
## Detection Prevalence  0.01775   0.2476   0.7346
## Balanced Accuracy     0.94841   0.9369   0.9396
## [1] "----------------------------------------------------------------------------"
## [1] "1 34 256"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13941, 13942, 13941, 13942, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9429959  0.8464118
##    2  0.9289224  0.8084225
##    3  0.9350561  0.8218466
##    4  0.9264057  0.7975319
##    5  0.9268571  0.7966024
##    6  0.9229191  0.7845332
##    7  0.9215628  0.7791141
##    8  0.9174308  0.7672274
##    9  0.9166563  0.7635024
##   10  0.9148484  0.7581250
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   256     9    22
##          1    11  2983   406
##          2    26   409 11368
## 
## Overall Statistics
##                                           
##                Accuracy : 0.943           
##                  95% CI : (0.9392, 0.9466)
##     No Information Rate : 0.7615          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8464          
##                                           
##  Mcnemar's Test P-Value : 0.909           
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.87372   0.8771   0.9637
## Specificity           0.99796   0.9655   0.8822
## Pos Pred Value        0.89199   0.8774   0.9631
## Neg Pred Value        0.99757   0.9654   0.8839
## Prevalence            0.01892   0.2196   0.7615
## Detection Rate        0.01653   0.1926   0.7339
## Detection Prevalence  0.01853   0.2195   0.7620
## Balanced Accuracy     0.93584   0.9213   0.9230
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13939, 13941, 13941, 13942, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9515177  0.8617314
##    2    extratrees  0.9245314  0.7736837
##    7    gini        0.9660425  0.9058740
##    7    extratrees  0.9644293  0.9007322
##   12    gini        0.9647517  0.9028484
##   12    extratrees  0.9664948  0.9069023
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   266     9     4
##          1     4  3000    87
##          2    23   392 11705
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9665          
##                  95% CI : (0.9635, 0.9693)
##     No Information Rate : 0.7615          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9069          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.90785   0.8821   0.9923
## Specificity           0.99914   0.9925   0.8877
## Pos Pred Value        0.95341   0.9706   0.9658
## Neg Pred Value        0.99822   0.9677   0.9730
## Prevalence            0.01892   0.2196   0.7615
## Detection Rate        0.01717   0.1937   0.7556
## Detection Prevalence  0.01801   0.1995   0.7824
## Balanced Accuracy     0.95350   0.9373   0.9400
## [1] "----------------------------------------------------------------------------"
## [1] "1 35 246"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13940, 13942, 13940, 13942, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9013560  0.8089995
##    2  0.8752106  0.7583754
##    3  0.8812793  0.7699205
##    4  0.8681749  0.7442454
##    5  0.8679169  0.7436301
##    6  0.8586197  0.7254291
##    7  0.8564261  0.7209036
##    8  0.8506161  0.7097175
##    9  0.8490665  0.7063807
##   10  0.8429330  0.6944924
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0  256    9   24
##          1    9 7328  707
##          2   28  751 6378
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9014         
##                  95% CI : (0.8966, 0.906)
##     No Information Rate : 0.5221         
##     P-Value [Acc > NIR] : <2e-16         
##                                          
##                   Kappa : 0.809          
##                                          
##  Mcnemar's Test P-Value : 0.6514         
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.87372   0.9060   0.8972
## Specificity           0.99783   0.9033   0.9071
## Pos Pred Value        0.88581   0.9110   0.8912
## Neg Pred Value        0.99757   0.8979   0.9123
## Prevalence            0.01892   0.5221   0.4589
## Detection Rate        0.01653   0.4731   0.4117
## Detection Prevalence  0.01866   0.5193   0.4620
## Balanced Accuracy     0.93577   0.9047   0.9021
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13940, 13941, 13942, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9339580  0.8715559
##    2    extratrees  0.8949646  0.7943071
##    7    gini        0.9433829  0.8901187
##    7    extratrees  0.9465466  0.8961824
##   12    gini        0.9367332  0.8772602
##   12    extratrees  0.9499036  0.9027704
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0  263    3    5
##          1    1 7778  431
##          2   29  307 6673
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9499          
##                  95% CI : (0.9464, 0.9533)
##     No Information Rate : 0.5221          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9028          
##                                           
##  Mcnemar's Test P-Value : 1.936e-08       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.89761   0.9617   0.9387
## Specificity           0.99947   0.9416   0.9599
## Pos Pred Value        0.97048   0.9474   0.9521
## Neg Pred Value        0.99803   0.9574   0.9486
## Prevalence            0.01892   0.5221   0.4589
## Detection Rate        0.01698   0.5021   0.4308
## Detection Prevalence  0.01750   0.5300   0.4525
## Balanced Accuracy     0.94854   0.9517   0.9493
## [1] "----------------------------------------------------------------------------"
## [1] "1 36 245"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13941, 13941, 13942, 13940, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9236938  0.8047422
##    2  0.9021949  0.7498060
##    3  0.9100714  0.7675910
##    4  0.8981279  0.7360986
##    5  0.9017430  0.7438741
##    6  0.8927056  0.7196431
##    7  0.8920591  0.7159529
##    8  0.8857323  0.6980919
##    9  0.8849571  0.6943025
##   10  0.8799219  0.6798737
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   253     5    30
##          1     7  3131   573
##          2    33   534 10924
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9237          
##                  95% CI : (0.9194, 0.9278)
##     No Information Rate : 0.7442          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8048          
##                                           
##  Mcnemar's Test P-Value : 0.6041          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.86348   0.8531   0.9477
## Specificity           0.99770   0.9509   0.8569
## Pos Pred Value        0.87847   0.8437   0.9507
## Neg Pred Value        0.99737   0.9542   0.8492
## Prevalence            0.01892   0.2369   0.7442
## Detection Rate        0.01633   0.2021   0.7052
## Detection Prevalence  0.01859   0.2396   0.7418
## Balanced Accuracy     0.93059   0.9020   0.9023
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13941, 13941, 13942, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9383476  0.8324575
##    2    extratrees  0.8908975  0.6790487
##    7    gini        0.9553257  0.8826213
##    7    extratrees  0.9513235  0.8705650
##   12    gini        0.9479016  0.8631859
##   12    extratrees  0.9557775  0.8834827
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   261     5     5
##          1     2  3207   185
##          2    30   458 11337
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9558         
##                  95% CI : (0.9524, 0.959)
##     No Information Rate : 0.7442         
##     P-Value [Acc > NIR] : < 2.2e-16      
##                                          
##                   Kappa : 0.8835         
##                                          
##  Mcnemar's Test P-Value : < 2.2e-16      
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.89078   0.8738   0.9835
## Specificity           0.99934   0.9842   0.8769
## Pos Pred Value        0.96310   0.9449   0.9587
## Neg Pred Value        0.99790   0.9617   0.9482
## Prevalence            0.01892   0.2369   0.7442
## Detection Rate        0.01685   0.2070   0.7319
## Detection Prevalence  0.01750   0.2191   0.7634
## Balanced Accuracy     0.94506   0.9290   0.9302
## [1] "----------------------------------------------------------------------------"
## [1] "1 45 236"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13941, 13939, 13942, 13940, 13942, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9204655  0.8145958
##    2  0.8952226  0.7569058
##    3  0.9063264  0.7802235
##    4  0.8930920  0.7487417
##    5  0.8948344  0.7514034
##    6  0.8839257  0.7249919
##    7  0.8834081  0.7221769
##    8  0.8800520  0.7147899
##    9  0.8757914  0.7022419
##   10  0.8716584  0.6925121
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   258     6    31
##          1     6 10288   569
##          2    29   591  3712
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9205          
##                  95% CI : (0.9161, 0.9247)
##     No Information Rate : 0.7027          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8146          
##                                           
##  Mcnemar's Test P-Value : 0.9224          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.88055   0.9452   0.8609
## Specificity           0.99757   0.8751   0.9445
## Pos Pred Value        0.87458   0.9471   0.8569
## Neg Pred Value        0.99770   0.8710   0.9462
## Prevalence            0.01892   0.7027   0.2784
## Detection Rate        0.01666   0.6642   0.2396
## Detection Prevalence  0.01904   0.7013   0.2797
## Balanced Accuracy     0.93906   0.9101   0.9027
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13942, 13942, 13940, 13940, 13942, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9383470  0.8507407
##    2    extratrees  0.8949652  0.7311994
##    7    gini        0.9519693  0.8862236
##    7    extratrees  0.9508074  0.8824352
##   12    gini        0.9502918  0.8822233
##   12    extratrees  0.9536477  0.8895574
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   259     1     9
##          1     3 10693   483
##          2    31   191  3820
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9536          
##                  95% CI : (0.9502, 0.9569)
##     No Information Rate : 0.7027          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.8896          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.88396   0.9824   0.8859
## Specificity           0.99934   0.8945   0.9801
## Pos Pred Value        0.96283   0.9565   0.9451
## Neg Pred Value        0.99777   0.9555   0.9570
## Prevalence            0.01892   0.7027   0.2784
## Detection Rate        0.01672   0.6903   0.2466
## Detection Prevalence  0.01737   0.7217   0.2609
## Balanced Accuracy     0.94165   0.9384   0.9330
## [1] "----------------------------------------------------------------------------"
## [1] "1 46 235"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13941, 13940, 13942, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9005813  0.8041742
##    2  0.8723040  0.7486923
##    3  0.8821812  0.7674101
##    4  0.8687537  0.7408595
##    5  0.8672682  0.7374301
##    6  0.8544217  0.7118903
##    7  0.8550025  0.7124832
##    8  0.8458998  0.6943180
##    9  0.8437703  0.6898031
##   10  0.8377014  0.6773312
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0  256    5   33
##          1    4 5729  732
##          2   33  733 7965
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9006          
##                  95% CI : (0.8958, 0.9052)
##     No Information Rate : 0.5636          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8042          
##                                           
##  Mcnemar's Test P-Value : 0.9904          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.87372   0.8859   0.9124
## Specificity           0.99750   0.9184   0.8867
## Pos Pred Value        0.87075   0.8862   0.9123
## Neg Pred Value        0.99757   0.9182   0.8868
## Prevalence            0.01892   0.4175   0.5636
## Detection Rate        0.01653   0.3699   0.5142
## Detection Prevalence  0.01898   0.4174   0.5637
## Balanced Accuracy     0.93561   0.9022   0.8995
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13942, 13941, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9335690  0.8679184
##    2    extratrees  0.8882482  0.7738845
##    7    gini        0.9418979  0.8850729
##    7    extratrees  0.9446097  0.8900750
##   12    gini        0.9342155  0.8700103
##   12    extratrees  0.9475794  0.8961085
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0  246    0    5
##          1    5 5998  291
##          2   42  469 8434
## 
## Overall Statistics
##                                         
##                Accuracy : 0.9476        
##                  95% CI : (0.944, 0.951)
##     No Information Rate : 0.5636        
##     P-Value [Acc > NIR] : < 2.2e-16     
##                                         
##                   Kappa : 0.8961        
##                                         
##  Mcnemar's Test P-Value : 2.421e-16     
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.83959   0.9275   0.9661
## Specificity           0.99967   0.9672   0.9244
## Pos Pred Value        0.98008   0.9530   0.9429
## Neg Pred Value        0.99692   0.9490   0.9548
## Prevalence            0.01892   0.4175   0.5636
## Detection Rate        0.01588   0.3872   0.5445
## Detection Prevalence  0.01620   0.4063   0.5775
## Balanced Accuracy     0.91963   0.9473   0.9453
## [1] "----------------------------------------------------------------------------"
## [1] "1 56 234"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13941, 13939, 13942, 13939, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9452540  0.8676650
##    2  0.9322123  0.8360238
##    3  0.9366667  0.8449950
##    4  0.9311783  0.8310795
##    5  0.9320174  0.8319397
##    6  0.9270473  0.8187843
##    7  0.9268527  0.8179131
##    8  0.9222060  0.8058301
##    9  0.9222050  0.8048997
##   10  0.9191053  0.7971084
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   258     2    38
##          1     2 10756   377
##          2    33   396  3628
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9453          
##                  95% CI : (0.9416, 0.9488)
##     No Information Rate : 0.7201          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8677          
##                                           
##  Mcnemar's Test P-Value : 0.8449          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.88055   0.9643   0.8974
## Specificity           0.99737   0.9126   0.9625
## Pos Pred Value        0.86577   0.9660   0.8943
## Neg Pred Value        0.99770   0.9086   0.9637
## Prevalence            0.01892   0.7201   0.2610
## Detection Rate        0.01666   0.6944   0.2342
## Detection Prevalence  0.01924   0.7189   0.2619
## Balanced Accuracy     0.93896   0.9385   0.9299
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13940, 13942, 13941, 13942, 13940, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9553252  0.8880077
##    2    extratrees  0.9320842  0.8248334
##    7    gini        0.9681717  0.9215827
##    7    extratrees  0.9651375  0.9135792
##   12    gini        0.9646856  0.9132197
##   12    extratrees  0.9686884  0.9226879
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   256     1     7
##          1     2 11057   344
##          2    35    96  3692
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9687          
##                  95% CI : (0.9658, 0.9714)
##     No Information Rate : 0.7201          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9227          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.87372   0.9913   0.9132
## Specificity           0.99947   0.9202   0.9886
## Pos Pred Value        0.96970   0.9697   0.9657
## Neg Pred Value        0.99757   0.9763   0.9699
## Prevalence            0.01892   0.7201   0.2610
## Detection Rate        0.01653   0.7138   0.2383
## Detection Prevalence  0.01704   0.7362   0.2468
## Balanced Accuracy     0.93660   0.9558   0.9509
## [1] "----------------------------------------------------------------------------"
## [1] "2 13 456"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13940, 13940, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9856039  0.9054955
##    2  0.9795353  0.8651191
##    3  0.9814719  0.8767209
##    4  0.9785023  0.8561079
##    5  0.9780504  0.8521696
##    6  0.9761138  0.8383263
##    7  0.9756612  0.8344425
##    8  0.9749512  0.8286273
##    9  0.9746932  0.8260645
##   10  0.9730794  0.8141102
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   572    32    53
##          1    31   539    44
##          2    39    24 14156
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9856          
##                  95% CI : (0.9836, 0.9874)
##     No Information Rate : 0.9201          
##     P-Value [Acc > NIR] : < 2e-16         
##                                           
##                   Kappa : 0.9053          
##                                           
##  Mcnemar's Test P-Value : 0.04542         
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.89097  0.90588   0.9932
## Specificity           0.99428  0.99496   0.9491
## Pos Pred Value        0.87062  0.87785   0.9956
## Neg Pred Value        0.99528  0.99624   0.9237
## Prevalence            0.04145  0.03841   0.9201
## Detection Rate        0.03693  0.03480   0.9139
## Detection Prevalence  0.04241  0.03964   0.9179
## Balanced Accuracy     0.94262  0.95042   0.9711
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13942, 13941, 13942, 13941, 13942, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9859270  0.8999613
##    2    extratrees  0.9788899  0.8419836
##    7    gini        0.9908976  0.9375618
##    7    extratrees  0.9916074  0.9425974
##   12    gini        0.9899935  0.9319246
##   12    extratrees  0.9916721  0.9432019
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   578    19     9
##          1    16   548     9
##          2    48    28 14235
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9917         
##                  95% CI : (0.9901, 0.993)
##     No Information Rate : 0.9201         
##     P-Value [Acc > NIR] : < 2.2e-16      
##                                          
##                   Kappa : 0.9433         
##                                          
##  Mcnemar's Test P-Value : 5.33e-08       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.90031  0.92101   0.9987
## Specificity           0.99811  0.99832   0.9386
## Pos Pred Value        0.95380  0.95637   0.9947
## Neg Pred Value        0.99570  0.99685   0.9847
## Prevalence            0.04145  0.03841   0.9201
## Detection Rate        0.03731  0.03538   0.9190
## Detection Prevalence  0.03912  0.03699   0.9239
## Balanced Accuracy     0.94921  0.95966   0.9686
## [1] "----------------------------------------------------------------------------"
## [1] "2 14 356"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13941, 13941, 13941, 13941, 13942, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9389295  0.8492151
##    2  0.9252426  0.8150750
##    3  0.9315052  0.8278995
##    4  0.9232417  0.8066755
##    5  0.9229823  0.8047304
##    6  0.9180760  0.7914785
##    7  0.9174294  0.7882930
##    8  0.9140728  0.7788794
##    9  0.9122010  0.7731417
##   10  0.9076168  0.7603168
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   572    73    31
##          1    52  2943   396
##          2    18   376 11029
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9389         
##                  95% CI : (0.935, 0.9426)
##     No Information Rate : 0.7396         
##     P-Value [Acc > NIR] : < 2e-16        
##                                          
##                   Kappa : 0.8492         
##                                          
##  Mcnemar's Test P-Value : 0.05768        
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.89097   0.8676   0.9627
## Specificity           0.99300   0.9630   0.9023
## Pos Pred Value        0.84615   0.8679   0.9655
## Neg Pred Value        0.99527   0.9629   0.8950
## Prevalence            0.04145   0.2190   0.7396
## Detection Rate        0.03693   0.1900   0.7120
## Detection Prevalence  0.04364   0.2189   0.7374
## Balanced Accuracy     0.94198   0.9153   0.9325
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13940, 13941, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9508720  0.8723246
##    2    extratrees  0.9266634  0.8012042
##    7    gini        0.9637829  0.9080534
##    7    extratrees  0.9646225  0.9095826
##   12    gini        0.9601674  0.8991730
##   12    extratrees  0.9672695  0.9167384
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   604    16     6
##          1    31  3005    76
##          2     7   371 11374
## 
## Overall Statistics
##                                         
##                Accuracy : 0.9673        
##                  95% CI : (0.9643, 0.97)
##     No Information Rate : 0.7396        
##     P-Value [Acc > NIR] : < 2.2e-16     
##                                         
##                   Kappa : 0.9168        
##                                         
##  Mcnemar's Test P-Value : < 2.2e-16     
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.94081   0.8859   0.9928
## Specificity           0.99852   0.9912   0.9063
## Pos Pred Value        0.96486   0.9656   0.9678
## Neg Pred Value        0.99744   0.9687   0.9781
## Prevalence            0.04145   0.2190   0.7396
## Detection Rate        0.03899   0.1940   0.7343
## Detection Prevalence  0.04041   0.2009   0.7587
## Balanced Accuracy     0.96966   0.9385   0.9496
## [1] "----------------------------------------------------------------------------"
## [1] "2 15 346"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8949642  0.8041470
##    2  0.8730783  0.7634114
##    3  0.8770172  0.7706244
##    4  0.8643641  0.7468485
##    5  0.8625564  0.7434032
##    6  0.8536483  0.7269599
##    7  0.8497101  0.7193596
##    8  0.8430603  0.7069301
##    9  0.8404144  0.7018235
##   10  0.8357656  0.6931187
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0  572   42   54
##          1   33 7280  704
##          2   37  757 6011
## 
## Overall Statistics
##                                         
##                Accuracy : 0.895         
##                  95% CI : (0.89, 0.8998)
##     No Information Rate : 0.5216        
##     P-Value [Acc > NIR] : <2e-16        
##                                         
##                   Kappa : 0.8041        
##                                         
##  Mcnemar's Test P-Value : 0.1032        
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.89097   0.9011   0.8880
## Specificity           0.99353   0.9006   0.9090
## Pos Pred Value        0.85629   0.9081   0.8833
## Neg Pred Value        0.99528   0.8931   0.9127
## Prevalence            0.04145   0.5216   0.4370
## Detection Rate        0.03693   0.4700   0.3881
## Detection Prevalence  0.04312   0.5176   0.4393
## Balanced Accuracy     0.94225   0.9008   0.8985
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13942, 13940, 13942, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9335054  0.8752443
##    2    extratrees  0.8927033  0.7965489
##    7    gini        0.9449325  0.8969425
##    7    extratrees  0.9464816  0.8996961
##   12    gini        0.9366698  0.8815609
##   12    extratrees  0.9498386  0.9060689
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0  605   16    6
##          1   12 7785  440
##          2   25  278 6323
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9498          
##                  95% CI : (0.9463, 0.9532)
##     No Information Rate : 0.5216          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9061          
##                                           
##  Mcnemar's Test P-Value : 1.461e-10       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.94237   0.9636   0.9341
## Specificity           0.99852   0.9390   0.9653
## Pos Pred Value        0.96491   0.9451   0.9543
## Neg Pred Value        0.99751   0.9595   0.9497
## Prevalence            0.04145   0.5216   0.4370
## Detection Rate        0.03906   0.5026   0.4082
## Detection Prevalence  0.04048   0.5318   0.4278
## Balanced Accuracy     0.97044   0.9513   0.9497
## [1] "----------------------------------------------------------------------------"
## [1] "2 16 345"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13939, 13940, 13942, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9207860  0.8126305
##    2  0.8996758  0.7626148
##    3  0.9073596  0.7783837
##    4  0.8956739  0.7503523
##    5  0.8956095  0.7485429
##    6  0.8868944  0.7266064
##    7  0.8868293  0.7252278
##    8  0.8819869  0.7135613
##    9  0.8770799  0.6996740
##   10  0.8730135  0.6886997
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   574    27    63
##          1    22  3116   551
##          2    46   518 10573
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9208         
##                  95% CI : (0.9164, 0.925)
##     No Information Rate : 0.7222         
##     P-Value [Acc > NIR] : <2e-16         
##                                          
##                   Kappa : 0.8126         
##                                          
##  Mcnemar's Test P-Value : 0.2426         
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.89408   0.8511   0.9451
## Specificity           0.99394   0.9516   0.8689
## Pos Pred Value        0.86446   0.8447   0.9494
## Neg Pred Value        0.99541   0.9538   0.8589
## Prevalence            0.04145   0.2363   0.7222
## Detection Rate        0.03706   0.2012   0.6826
## Detection Prevalence  0.04287   0.2382   0.7190
## Balanced Accuracy     0.94401   0.9013   0.9070
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13940, 13941, 13940, 13941, 13940, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9364112  0.8412282
##    2    extratrees  0.8950933  0.7200445
##    7    gini        0.9551317  0.8916552
##    7    extratrees  0.9517105  0.8820843
##   12    gini        0.9505485  0.8807918
##   12    extratrees  0.9546801  0.8898852
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 7, splitrule = gini
##  and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   585    17    18
##          1     6  3259   218
##          2    51   385 10951
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9551          
##                  95% CI : (0.9518, 0.9583)
##     No Information Rate : 0.7222          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.8917          
##                                           
##  Mcnemar's Test P-Value : 1.62e-14        
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.91121   0.8902   0.9789
## Specificity           0.99764   0.9811   0.8987
## Pos Pred Value        0.94355   0.9357   0.9617
## Neg Pred Value        0.99617   0.9665   0.9425
## Prevalence            0.04145   0.2363   0.7222
## Detection Rate        0.03777   0.2104   0.7070
## Detection Prevalence  0.04003   0.2249   0.7351
## Balanced Accuracy     0.95443   0.9356   0.9388
## [1] "----------------------------------------------------------------------------"
## [1] "2 34 156"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13941, 13941, 13939, 13942, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9415084  0.8557936
##    2  0.9282099  0.8228002
##    3  0.9320193  0.8296883
##    4  0.9245301  0.8102340
##    5  0.9233682  0.8063508
##    6  0.9198173  0.7967822
##    7  0.9182680  0.7921369
##    8  0.9137487  0.7801793
##    9  0.9152975  0.7833914
##   10  0.9116174  0.7730748
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   571    39    49
##          1    38  3001   386
##          2    33   361 11012
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9415          
##                  95% CI : (0.9377, 0.9452)
##     No Information Rate : 0.739           
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8558          
##                                           
##  Mcnemar's Test P-Value : 0.2645          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.88941   0.8824   0.9620
## Specificity           0.99407   0.9649   0.9025
## Pos Pred Value        0.86646   0.8762   0.9655
## Neg Pred Value        0.99521   0.9668   0.8935
## Prevalence            0.04145   0.2196   0.7390
## Detection Rate        0.03686   0.1937   0.7109
## Detection Prevalence  0.04254   0.2211   0.7363
## Balanced Accuracy     0.94174   0.9237   0.9323
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13940, 13940, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9515175  0.8743674
##    2    extratrees  0.9249198  0.7964214
##    7    gini        0.9655910  0.9128665
##    7    extratrees  0.9638480  0.9078828
##   12    gini        0.9632022  0.9071993
##   12    extratrees  0.9668824  0.9159050
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   601     8    16
##          1    27  3023    78
##          2    14   370 11353
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9669          
##                  95% CI : (0.9639, 0.9696)
##     No Information Rate : 0.739           
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.916           
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.93614   0.8889   0.9918
## Specificity           0.99838   0.9913   0.9050
## Pos Pred Value        0.96160   0.9664   0.9673
## Neg Pred Value        0.99724   0.9694   0.9750
## Prevalence            0.04145   0.2196   0.7390
## Detection Rate        0.03880   0.1952   0.7329
## Detection Prevalence  0.04035   0.2019   0.7577
## Balanced Accuracy     0.96726   0.9401   0.9484
## [1] "----------------------------------------------------------------------------"
## [1] "2 35 146"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13940, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8985803  0.8109151
##    2  0.8736610  0.7643347
##    3  0.8778568  0.7720032
##    4  0.8653332  0.7487951
##    5  0.8632030  0.7445290
##    6  0.8523571  0.7244508
##    7  0.8489361  0.7176403
##    8  0.8417700  0.7043785
##    9  0.8406076  0.7020345
##   10  0.8366691  0.6944986
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0  582   25   66
##          1   15 7323  680
##          2   45  740 6014
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8986          
##                  95% CI : (0.8937, 0.9033)
##     No Information Rate : 0.5221          
##     P-Value [Acc > NIR] : < 2e-16         
##                                           
##                   Kappa : 0.8109          
##                                           
##  Mcnemar's Test P-Value : 0.02918         
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.90654   0.9054   0.8896
## Specificity           0.99387   0.9061   0.9101
## Pos Pred Value        0.86478   0.9133   0.8845
## Neg Pred Value        0.99595   0.8976   0.9142
## Prevalence            0.04145   0.5221   0.4364
## Detection Rate        0.03757   0.4728   0.3883
## Detection Prevalence  0.04345   0.5176   0.4389
## Balanced Accuracy     0.95021   0.9058   0.8999
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13942, 13942, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9322785  0.8727918
##    2    extratrees  0.8927704  0.7965550
##    7    gini        0.9431893  0.8937367
##    7    extratrees  0.9472562  0.9011295
##   12    gini        0.9347319  0.8779103
##   12    extratrees  0.9501612  0.9066199
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0  599    6   15
##          1    8 7800  426
##          2   35  282 6319
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9502          
##                  95% CI : (0.9466, 0.9535)
##     No Information Rate : 0.5221          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9066          
##                                           
##  Mcnemar's Test P-Value : 3.479e-08       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.93302   0.9644   0.9348
## Specificity           0.99859   0.9414   0.9637
## Pos Pred Value        0.96613   0.9473   0.9522
## Neg Pred Value        0.99711   0.9603   0.9502
## Prevalence            0.04145   0.5221   0.4364
## Detection Rate        0.03867   0.5036   0.4079
## Detection Prevalence  0.04003   0.5316   0.4284
## Balanced Accuracy     0.96580   0.9529   0.9492
## [1] "----------------------------------------------------------------------------"
## [1] "2 36 145"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13942, 13940, 13940, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9178833  0.8061207
##    2  0.8971600  0.7577858
##    3  0.9026475  0.7681082
##    4  0.8900594  0.7374250
##    5  0.8908985  0.7383578
##    6  0.8841850  0.7226276
##    7  0.8808909  0.7126707
##    8  0.8758551  0.6997940
##    9  0.8724979  0.6902647
##   10  0.8688184  0.6808357
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   570    11    78
##          1     7  3129   581
##          2    65   530 10519
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9179          
##                  95% CI : (0.9134, 0.9222)
##     No Information Rate : 0.7216          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8062          
##                                           
##  Mcnemar's Test P-Value : 0.2203          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.88785   0.8526   0.9410
## Specificity           0.99401   0.9503   0.8620
## Pos Pred Value        0.86495   0.8418   0.9465
## Neg Pred Value        0.99515   0.9540   0.8494
## Prevalence            0.04145   0.2369   0.7216
## Detection Rate        0.03680   0.2020   0.6791
## Detection Prevalence  0.04254   0.2400   0.7175
## Balanced Accuracy     0.94093   0.9014   0.9015
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13942, 13941, 13942, 13940, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9346040  0.8363756
##    2    extratrees  0.8859916  0.6924613
##    7    gini        0.9504849  0.8797338
##    7    extratrees  0.9491290  0.8753778
##   12    gini        0.9467402  0.8706837
##   12    extratrees  0.9524219  0.8841719
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   589     2    18
##          1     3  3200   196
##          2    50   468 10964
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9524         
##                  95% CI : (0.949, 0.9557)
##     No Information Rate : 0.7216         
##     P-Value [Acc > NIR] : < 2.2e-16      
##                                          
##                   Kappa : 0.8844         
##                                          
##  Mcnemar's Test P-Value : < 2.2e-16      
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.91745   0.8719   0.9809
## Specificity           0.99865   0.9832   0.8799
## Pos Pred Value        0.96716   0.9415   0.9549
## Neg Pred Value        0.99644   0.9611   0.9466
## Prevalence            0.04145   0.2369   0.7216
## Detection Rate        0.03802   0.2066   0.7078
## Detection Prevalence  0.03932   0.2194   0.7413
## Balanced Accuracy     0.95805   0.9275   0.9304
## [1] "----------------------------------------------------------------------------"
## [1] "2 45 136"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13942, 13940, 13941, 13940, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9177531  0.8132118
##    2  0.8980634  0.7686947
##    3  0.9035512  0.7787943
##    4  0.8885729  0.7447650
##    5  0.8933494  0.7543626
##    6  0.8820515  0.7283425
##    7  0.8790185  0.7185431
##    8  0.8752093  0.7092709
##    9  0.8724331  0.7017976
##   10  0.8688834  0.6932710
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   571    52    37
##          1    39 10267   548
##          2    32   566  3378
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9178         
##                  95% CI : (0.9133, 0.922)
##     No Information Rate : 0.7027         
##     P-Value [Acc > NIR] : <2e-16         
##                                          
##                   Kappa : 0.8131         
##                                          
##  Mcnemar's Test P-Value : 0.4734         
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.88941   0.9432   0.8524
## Specificity           0.99401   0.8725   0.9481
## Pos Pred Value        0.86515   0.9459   0.8496
## Neg Pred Value        0.99521   0.8667   0.9492
## Prevalence            0.04145   0.7027   0.2558
## Detection Rate        0.03686   0.6628   0.2181
## Detection Prevalence  0.04261   0.7007   0.2567
## Balanced Accuracy     0.94171   0.9079   0.9003
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13940, 13941, 13941, 13942, 13940, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9366689  0.8493188
##    2    extratrees  0.8915420  0.7258372
##    7    gini        0.9531956  0.8915727
##    7    extratrees  0.9506775  0.8847482
##   12    gini        0.9510651  0.8867104
##   12    extratrees  0.9530664  0.8907996
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 7, splitrule = gini
##  and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   593    13    15
##          1    39 10656   432
##          2    10   216  3516
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9532          
##                  95% CI : (0.9498, 0.9565)
##     No Information Rate : 0.7027          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.8916          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.92368   0.9790   0.8872
## Specificity           0.99811   0.8977   0.9804
## Pos Pred Value        0.95491   0.9577   0.9396
## Neg Pred Value        0.99670   0.9475   0.9620
## Prevalence            0.04145   0.7027   0.2558
## Detection Rate        0.03828   0.6879   0.2270
## Detection Prevalence  0.04009   0.7183   0.2416
## Balanced Accuracy     0.96090   0.9383   0.9338
## [1] "----------------------------------------------------------------------------"
## [1] "2 46 135"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13940, 13941, 13941, 13942, 13940, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8992918  0.8108597
##    2  0.8741132  0.7635785
##    3  0.8778583  0.7703283
##    4  0.8649461  0.7461470
##    5  0.8633342  0.7427242
##    6  0.8544902  0.7261981
##    7  0.8495194  0.7165997
##    8  0.8432568  0.7047483
##    9  0.8398362  0.6982071
##   10  0.8355752  0.6895983
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0  578   39   59
##          1   27 5739  709
##          2   37  689 7613
## 
## Overall Statistics
##                                          
##                Accuracy : 0.8993         
##                  95% CI : (0.8944, 0.904)
##     No Information Rate : 0.5411         
##     P-Value [Acc > NIR] : < 2e-16        
##                                          
##                   Kappa : 0.8108         
##                                          
##  Mcnemar's Test P-Value : 0.05731        
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.90031   0.8874   0.9084
## Specificity           0.99340   0.9184   0.8979
## Pos Pred Value        0.85503   0.8863   0.9129
## Neg Pred Value        0.99568   0.9192   0.8926
## Prevalence            0.04145   0.4175   0.5411
## Detection Rate        0.03731   0.3705   0.4915
## Detection Prevalence  0.04364   0.4180   0.5383
## Balanced Accuracy     0.94686   0.9029   0.9031
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13940, 13941, 13940, 13941, 13942, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9327955  0.8725492
##    2    extratrees  0.8880526  0.7842797
##    7    gini        0.9430602  0.8925526
##    7    extratrees  0.9448676  0.8956576
##   12    gini        0.9374433  0.8819784
##   12    extratrees  0.9474504  0.9006777
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0  598    6   11
##          1   21 6003  295
##          2   23  458 8075
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9474          
##                  95% CI : (0.9438, 0.9509)
##     No Information Rate : 0.5411          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9007          
##                                           
##  Mcnemar's Test P-Value : 2.289e-10       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.93146   0.9283   0.9635
## Specificity           0.99886   0.9650   0.9323
## Pos Pred Value        0.97236   0.9500   0.9438
## Neg Pred Value        0.99704   0.9494   0.9559
## Prevalence            0.04145   0.4175   0.5411
## Detection Rate        0.03861   0.3875   0.5213
## Detection Prevalence  0.03970   0.4079   0.5524
## Balanced Accuracy     0.96516   0.9466   0.9479
## [1] "----------------------------------------------------------------------------"
## [1] "2 56 134"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13941, 13942, 13939, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9428022  0.8650640
##    2  0.9285348  0.8312834
##    3  0.9321493  0.8377285
##    4  0.9245316  0.8191893
##    5  0.9254347  0.8199656
##    6  0.9209160  0.8082910
##    7  0.9198846  0.8053442
##    8  0.9164622  0.7963059
##    9  0.9171716  0.7971990
##   10  0.9122649  0.7850007
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   577    19    73
##          1    11 10764   358
##          2    54   371  3263
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9428         
##                  95% CI : (0.939, 0.9464)
##     No Information Rate : 0.7201         
##     P-Value [Acc > NIR] : <2e-16         
##                                          
##                   Kappa : 0.8651         
##                                          
##  Mcnemar's Test P-Value : 0.1572         
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.89875   0.9650   0.8833
## Specificity           0.99380   0.9149   0.9640
## Pos Pred Value        0.86248   0.9669   0.8848
## Neg Pred Value        0.99561   0.9105   0.9635
## Prevalence            0.04145   0.7201   0.2385
## Detection Rate        0.03725   0.6949   0.2107
## Detection Prevalence  0.04319   0.7187   0.2381
## Balanced Accuracy     0.94628   0.9400   0.9236
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13941, 13941, 13940, 13940, 13942, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9535191  0.8859737
##    2    extratrees  0.9264045  0.8126124
##    7    gini        0.9668820  0.9203505
##    7    extratrees  0.9654622  0.9164190
##   12    gini        0.9644940  0.9147834
##   12    extratrees  0.9681737  0.9232827
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   602     6    16
##          1     3 11060   343
##          2    37    88  3335
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9682          
##                  95% CI : (0.9653, 0.9709)
##     No Information Rate : 0.7201          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9233          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.93769   0.9916   0.9028
## Specificity           0.99852   0.9202   0.9894
## Pos Pred Value        0.96474   0.9697   0.9639
## Neg Pred Value        0.99731   0.9770   0.9702
## Prevalence            0.04145   0.7201   0.2385
## Detection Rate        0.03886   0.7140   0.2153
## Detection Prevalence  0.04028   0.7363   0.2234
## Balanced Accuracy     0.96811   0.9559   0.9461
## [1] "----------------------------------------------------------------------------"
## [1] "3 12 456"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13942, 13940, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9874758  0.9169031
##    2  0.9839895  0.8932119
##    3  0.9855387  0.9032746
##    4  0.9819233  0.8786485
##    5  0.9830853  0.8855905
##    6  0.9805027  0.8678730
##    7  0.9796636  0.8611427
##    8  0.9781149  0.8506923
##    9  0.9774690  0.8445550
##   10  0.9770170  0.8404403
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   265    12    31
##          1    14   873    64
##          2    23    50 14158
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9875          
##                  95% CI : (0.9856, 0.9892)
##     No Information Rate : 0.9201          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.9168          
##                                           
##  Mcnemar's Test P-Value : 0.3827          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.87748  0.93369   0.9933
## Specificity           0.99717  0.99464   0.9410
## Pos Pred Value        0.86039  0.91798   0.9949
## Neg Pred Value        0.99756  0.99574   0.9245
## Prevalence            0.01950  0.06036   0.9201
## Detection Rate        0.01711  0.05636   0.9140
## Detection Prevalence  0.01988  0.06139   0.9187
## Balanced Accuracy     0.93733  0.96417   0.9672
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13940, 13942, 13941, 13940, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9869589  0.9068708
##    2    extratrees  0.9784370  0.8376276
##    7    gini        0.9908323  0.9366460
##    7    extratrees  0.9925105  0.9485103
##   12    gini        0.9901869  0.9327936
##   12    extratrees  0.9926398  0.9496670
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   258     5     3
##          1    17   886    18
##          2    27    44 14232
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9926          
##                  95% CI : (0.9912, 0.9939)
##     No Information Rate : 0.9201          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9497          
##                                           
##  Mcnemar's Test P-Value : 5.46e-08        
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.85430  0.94759   0.9985
## Specificity           0.99947  0.99760   0.9426
## Pos Pred Value        0.96992  0.96200   0.9950
## Neg Pred Value        0.99711  0.99664   0.9823
## Prevalence            0.01950  0.06036   0.9201
## Detection Rate        0.01666  0.05720   0.9188
## Detection Prevalence  0.01717  0.05946   0.9234
## Balanced Accuracy     0.92689  0.97259   0.9706
## [1] "----------------------------------------------------------------------------"
## [1] "3 14 256"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13941, 13941, 13941, 13941, 13940, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9420268  0.8440218
##    2  0.9255648  0.7994158
##    3  0.9319549  0.8133516
##    4  0.9251767  0.7937615
##    5  0.9257577  0.7939737
##    6  0.9202701  0.7779535
##    7  0.9198826  0.7753614
##    8  0.9178158  0.7688370
##    9  0.9152342  0.7596282
##   10  0.9133622  0.7532809
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   272    29    20
##          1    19  2945   401
##          2    11   418 11375
## 
## Overall Statistics
##                                           
##                Accuracy : 0.942           
##                  95% CI : (0.9382, 0.9457)
##     No Information Rate : 0.7615          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.844           
##                                           
##  Mcnemar's Test P-Value : 0.1682          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.90066   0.8682   0.9643
## Specificity           0.99677   0.9653   0.8839
## Pos Pred Value        0.84735   0.8752   0.9637
## Neg Pred Value        0.99802   0.9631   0.8858
## Prevalence            0.01950   0.2190   0.7615
## Detection Rate        0.01756   0.1901   0.7343
## Detection Prevalence  0.02072   0.2172   0.7620
## Balanced Accuracy     0.94872   0.9168   0.9241
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13940, 13941, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9504851  0.8585932
##    2    extratrees  0.9238873  0.7716491
##    7    gini        0.9640418  0.9000715
##    7    extratrees  0.9634611  0.8978881
##   12    gini        0.9603617  0.8900222
##   12    extratrees  0.9663664  0.9064713
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   266     3     1
##          1    21  2996    88
##          2    15   393 11707
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9664          
##                  95% CI : (0.9634, 0.9691)
##     No Information Rate : 0.7615          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9066          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.88079   0.8833   0.9925
## Specificity           0.99974   0.9910   0.8896
## Pos Pred Value        0.98519   0.9649   0.9663
## Neg Pred Value        0.99763   0.9680   0.9736
## Prevalence            0.01950   0.2190   0.7615
## Detection Rate        0.01717   0.1934   0.7558
## Detection Prevalence  0.01743   0.2005   0.7821
## Balanced Accuracy     0.94027   0.9371   0.9410
## [1] "----------------------------------------------------------------------------"
## [1] "3 15 246"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13940, 13942, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8993535  0.8054045
##    2  0.8714636  0.7514294
##    3  0.8788876  0.7657736
##    4  0.8651382  0.7392037
##    5  0.8683644  0.7455511
##    6  0.8609415  0.7310483
##    7  0.8566812  0.7227039
##    8  0.8486758  0.7070864
##    9  0.8467391  0.7033896
##   10  0.8418981  0.6938403
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0  265   18   24
##          1   14 7311  730
##          2   23  750 6355
## 
## Overall Statistics
##                                          
##                Accuracy : 0.8994         
##                  95% CI : (0.8945, 0.904)
##     No Information Rate : 0.5216         
##     P-Value [Acc > NIR] : <2e-16         
##                                          
##                   Kappa : 0.8054         
##                                          
##  Mcnemar's Test P-Value : 0.8515         
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.87748   0.9049   0.8939
## Specificity           0.99723   0.8996   0.9078
## Pos Pred Value        0.86319   0.9076   0.8916
## Neg Pred Value        0.99756   0.8967   0.9098
## Prevalence            0.01950   0.5216   0.4589
## Detection Rate        0.01711   0.4720   0.4103
## Detection Prevalence  0.01982   0.5200   0.4602
## Balanced Accuracy     0.93736   0.9023   0.9009
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13942, 13941, 13941, 13941, 13942, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9327312  0.8692779
##    2    extratrees  0.8929629  0.7908406
##    7    gini        0.9424797  0.8883148
##    7    extratrees  0.9469983  0.8971712
##   12    gini        0.9382187  0.8800577
##   12    extratrees  0.9504847  0.9039716
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0  267    2    4
##          1   12 7771  420
##          2   23  306 6685
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9505          
##                  95% CI : (0.9469, 0.9538)
##     No Information Rate : 0.5216          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.904           
##                                           
##  Mcnemar's Test P-Value : 2.31e-08        
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.88411   0.9619   0.9404
## Specificity           0.99960   0.9417   0.9607
## Pos Pred Value        0.97802   0.9473   0.9531
## Neg Pred Value        0.99770   0.9577   0.9500
## Prevalence            0.01950   0.5216   0.4589
## Detection Rate        0.01724   0.5017   0.4316
## Detection Prevalence  0.01762   0.5296   0.4528
## Balanced Accuracy     0.94186   0.9518   0.9506
## [1] "----------------------------------------------------------------------------"
## [1] "3 16 245"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13942, 13941, 13940, 13940, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9241428  0.8061735
##    2  0.9062619  0.7612224
##    3  0.9105860  0.7689827
##    4  0.8975464  0.7344976
##    5  0.9014198  0.7433450
##    6  0.8925758  0.7201536
##    7  0.8917364  0.7155327
##    8  0.8877342  0.7046009
##    9  0.8856678  0.6974127
##   10  0.8803091  0.6830634
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   268     6    41
##          1     6  3120   559
##          2    28   535 10927
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9241          
##                  95% CI : (0.9199, 0.9283)
##     No Information Rate : 0.7442          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8062          
##                                           
##  Mcnemar's Test P-Value : 0.3954          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.88742   0.8522   0.9479
## Specificity           0.99691   0.9522   0.8579
## Pos Pred Value        0.85079   0.8467   0.9510
## Neg Pred Value        0.99776   0.9542   0.8500
## Prevalence            0.01950   0.2363   0.7442
## Detection Rate        0.01730   0.2014   0.7054
## Detection Prevalence  0.02034   0.2379   0.7418
## Balanced Accuracy     0.94216   0.9022   0.9029
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13940, 13941, 13942, 13940, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9353133  0.8239951
##    2    extratrees  0.8910910  0.6798730
##    7    gini        0.9543585  0.8802316
##    7    extratrees  0.9506136  0.8688969
##   12    gini        0.9495812  0.8675928
##   12    extratrees  0.9555203  0.8827027
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   255     1     3
##          1     4  3207   185
##          2    43   453 11339
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9555          
##                  95% CI : (0.9522, 0.9587)
##     No Information Rate : 0.7442          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.8827          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.84437   0.8760   0.9837
## Specificity           0.99974   0.9840   0.8748
## Pos Pred Value        0.98456   0.9443   0.9581
## Neg Pred Value        0.99691   0.9625   0.9486
## Prevalence            0.01950   0.2363   0.7442
## Detection Rate        0.01646   0.2070   0.7320
## Detection Prevalence  0.01672   0.2192   0.7640
## Balanced Accuracy     0.92205   0.9300   0.9293
## [1] "----------------------------------------------------------------------------"
## [1] "3 24 156"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13940, 13940, 13941, 13941, 13942, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9444167  0.8597840
##    2  0.9296972  0.8223006
##    3  0.9324733  0.8274564
##    4  0.9260825  0.8102922
##    5  0.9277615  0.8134811
##    6  0.9231130  0.8011232
##    7  0.9242756  0.8034572
##    8  0.9192395  0.7898016
##    9  0.9194330  0.7890571
##   10  0.9163339  0.7805569
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   269    29    18
##          1    23  3337   406
##          2    10   375 11023
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9444         
##                  95% CI : (0.9407, 0.948)
##     No Information Rate : 0.739          
##     P-Value [Acc > NIR] : <2e-16         
##                                          
##                   Kappa : 0.8599         
##                                          
##  Mcnemar's Test P-Value : 0.2398         
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.89073   0.8920   0.9630
## Specificity           0.99691   0.9635   0.9048
## Pos Pred Value        0.85127   0.8861   0.9663
## Neg Pred Value        0.99783   0.9655   0.8961
## Prevalence            0.01950   0.2415   0.7390
## Detection Rate        0.01737   0.2154   0.7116
## Detection Prevalence  0.02040   0.2431   0.7365
## Balanced Accuracy     0.94382   0.9277   0.9339
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13942, 13940, 13941, 13940, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9530677  0.8758028
##    2    extratrees  0.9305365  0.8101922
##    7    gini        0.9664951  0.9133285
##    7    extratrees  0.9655269  0.9101746
##   12    gini        0.9598455  0.8961432
##   12    extratrees  0.9673340  0.9152470
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   263     4     2
##          1    21  3373    97
##          2    18   364 11348
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9673          
##                  95% CI : (0.9644, 0.9701)
##     No Information Rate : 0.739           
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9153          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.87086   0.9016   0.9914
## Specificity           0.99960   0.9900   0.9055
## Pos Pred Value        0.97770   0.9662   0.9674
## Neg Pred Value        0.99744   0.9693   0.9737
## Prevalence            0.01950   0.2415   0.7390
## Detection Rate        0.01698   0.2178   0.7326
## Detection Prevalence  0.01737   0.2254   0.7573
## Balanced Accuracy     0.93523   0.9458   0.9484
## [1] "----------------------------------------------------------------------------"
## [1] "3 25 146"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13942, 13942, 13940, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8994850  0.8043598
##    2  0.8721779  0.7513073
##    3  0.8787627  0.7637221
##    4  0.8652063  0.7371751
##    5  0.8644958  0.7356377
##    6  0.8508745  0.7090613
##    7  0.8522288  0.7116464
##    8  0.8469347  0.7010256
##    9  0.8438365  0.6948077
##   10  0.8389940  0.6851783
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0  271   17   29
##          1   14 7656  725
##          2   17  755 6006
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8995          
##                  95% CI : (0.8946, 0.9042)
##     No Information Rate : 0.5441          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8044          
##                                           
##  Mcnemar's Test P-Value : 0.2584          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.89735   0.9084   0.8885
## Specificity           0.99697   0.8954   0.9116
## Pos Pred Value        0.85489   0.9120   0.8861
## Neg Pred Value        0.99796   0.8912   0.9135
## Prevalence            0.01950   0.5441   0.4364
## Detection Rate        0.01750   0.4943   0.3877
## Detection Prevalence  0.02046   0.5420   0.4376
## Balanced Accuracy     0.94716   0.9019   0.9000
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13940, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9313095  0.8651400
##    2    extratrees  0.8921224  0.7860811
##    7    gini        0.9388626  0.8803037
##    7    extratrees  0.9430592  0.8884495
##   12    gini        0.9299536  0.8627259
##   12    extratrees  0.9460290  0.8943760
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0  264    2    3
##          1   11 8113  480
##          2   27  313 6277
## 
## Overall Statistics
##                                           
##                Accuracy : 0.946           
##                  95% CI : (0.9424, 0.9495)
##     No Information Rate : 0.5441          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.8944          
##                                           
##  Mcnemar's Test P-Value : 4.376e-13       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.87417   0.9626   0.9286
## Specificity           0.99967   0.9305   0.9611
## Pos Pred Value        0.98141   0.9429   0.9486
## Neg Pred Value        0.99750   0.9543   0.9456
## Prevalence            0.01950   0.5441   0.4364
## Detection Rate        0.01704   0.5238   0.4052
## Detection Prevalence  0.01737   0.5555   0.4272
## Balanced Accuracy     0.93692   0.9465   0.9448
## [1] "----------------------------------------------------------------------------"
## [1] "3 26 145"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13940, 13941, 13941, 13940, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9196886  0.8059030
##    2  0.8983203  0.7550486
##    3  0.9022581  0.7621636
##    4  0.8916712  0.7354080
##    5  0.8928333  0.7378336
##    6  0.8844396  0.7166678
##    7  0.8808903  0.7058660
##    8  0.8748873  0.6899098
##    9  0.8731443  0.6843440
##   10  0.8693362  0.6750099
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   270     6    37
##          1     9  3443   608
##          2    23   561 10533
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9197          
##                  95% CI : (0.9153, 0.9239)
##     No Information Rate : 0.7216          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8059          
##                                           
##  Mcnemar's Test P-Value : 0.1241          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.89404   0.8586   0.9423
## Specificity           0.99717   0.9463   0.8646
## Pos Pred Value        0.86262   0.8480   0.9475
## Neg Pred Value        0.99789   0.9504   0.8525
## Prevalence            0.01950   0.2589   0.7216
## Detection Rate        0.01743   0.2223   0.6800
## Detection Prevalence  0.02021   0.2621   0.7177
## Balanced Accuracy     0.94560   0.9024   0.9034
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13940, 13942, 13941, 13941, 13940, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9338286  0.8312976
##    2    extratrees  0.8877993  0.6927236
##    7    gini        0.9490630  0.8735413
##    7    extratrees  0.9480958  0.8701946
##   12    gini        0.9422204  0.8565419
##   12    extratrees  0.9517104  0.8799599
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   259     2     5
##          1     2  3528   218
##          2    41   480 10955
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9517         
##                  95% CI : (0.9482, 0.955)
##     No Information Rate : 0.7216         
##     P-Value [Acc > NIR] : < 2.2e-16      
##                                          
##                   Kappa : 0.88           
##                                          
##  Mcnemar's Test P-Value : < 2.2e-16      
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.85762   0.8798   0.9801
## Specificity           0.99954   0.9808   0.8792
## Pos Pred Value        0.97368   0.9413   0.9546
## Neg Pred Value        0.99718   0.9590   0.9444
## Prevalence            0.01950   0.2589   0.7216
## Detection Rate        0.01672   0.2278   0.7072
## Detection Prevalence  0.01717   0.2420   0.7409
## Balanced Accuracy     0.92858   0.9303   0.9296
## [1] "----------------------------------------------------------------------------"
## [1] "3 45 126"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13941, 13941, 13941, 13942, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9223369  0.8193366
##    2  0.9039392  0.7771487
##    3  0.9085865  0.7858490
##    4  0.8986453  0.7620856
##    5  0.8961270  0.7553686
##    6  0.8865074  0.7320971
##    7  0.8865733  0.7309228
##    8  0.8805054  0.7154202
##    9  0.8785037  0.7108375
##   10  0.8735972  0.6984211
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   271    33    12
##          1    16 10279   554
##          2    15   573  3737
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9223         
##                  95% CI : (0.918, 0.9265)
##     No Information Rate : 0.7027         
##     P-Value [Acc > NIR] : < 2e-16        
##                                          
##                   Kappa : 0.8193         
##                                          
##  Mcnemar's Test P-Value : 0.08765        
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8974   0.9443   0.8685
## Specificity            0.9970   0.8762   0.9474
## Pos Pred Value         0.8576   0.9475   0.8640
## Neg Pred Value         0.9980   0.8694   0.9493
## Prevalence             0.0195   0.7027   0.2778
## Detection Rate         0.0175   0.6636   0.2413
## Detection Prevalence   0.0204   0.7004   0.2792
## Balanced Accuracy      0.9472   0.9103   0.9080
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13942, 13940, 13942, 13941, 13940, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9372503  0.8475938
##    2    extratrees  0.8940615  0.7278701
##    7    gini        0.9522922  0.8866129
##    7    extratrees  0.9511299  0.8831424
##   12    gini        0.9471923  0.8747350
##   12    extratrees  0.9544872  0.8916002
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   258     4     3
##          1    25 10686   459
##          2    19   195  3841
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9545          
##                  95% CI : (0.9511, 0.9577)
##     No Information Rate : 0.7027          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.8917          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.85430   0.9817   0.8926
## Specificity           0.99954   0.8949   0.9809
## Pos Pred Value        0.97358   0.9567   0.9472
## Neg Pred Value        0.99711   0.9539   0.9596
## Prevalence            0.01950   0.7027   0.2778
## Detection Rate        0.01666   0.6899   0.2480
## Detection Prevalence  0.01711   0.7211   0.2618
## Balanced Accuracy     0.92692   0.9383   0.9368
## [1] "----------------------------------------------------------------------------"
## [1] "3 46 125"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13941, 13939, 13942, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9026474  0.8088262
##    2  0.8768248  0.7580559
##    3  0.8835396  0.7709774
##    4  0.8715977  0.7471922
##    5  0.8688867  0.7416080
##    6  0.8613334  0.7266747
##    7  0.8574583  0.7191733
##    8  0.8529389  0.7099758
##    9  0.8490652  0.7018620
##   10  0.8431270  0.6902006
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0  271   19   32
##          1   13 5749  727
##          2   18  699 7962
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9026          
##                  95% CI : (0.8979, 0.9073)
##     No Information Rate : 0.563           
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8088          
##                                           
##  Mcnemar's Test P-Value : 0.1331          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.89735   0.8890   0.9130
## Specificity           0.99664   0.9180   0.8941
## Pos Pred Value        0.84161   0.8860   0.9174
## Neg Pred Value        0.99796   0.9202   0.8886
## Prevalence            0.01950   0.4175   0.5630
## Detection Rate        0.01750   0.3711   0.5140
## Detection Prevalence  0.02079   0.4189   0.5603
## Balanced Accuracy     0.94700   0.9035   0.9035
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13941, 13941, 13941, 13940, 13940, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9324078  0.8656783
##    2    extratrees  0.8884442  0.7748464
##    7    gini        0.9393807  0.8799957
##    7    extratrees  0.9453854  0.8918057
##   12    gini        0.9318279  0.8649360
##   12    extratrees  0.9488713  0.8988482
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0  259    2    3
##          1   16 6006  285
##          2   27  459 8433
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9489          
##                  95% CI : (0.9453, 0.9523)
##     No Information Rate : 0.563           
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.8989          
##                                           
##  Mcnemar's Test P-Value : 2.902e-15       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.85762   0.9287   0.9670
## Specificity           0.99967   0.9666   0.9282
## Pos Pred Value        0.98106   0.9523   0.9455
## Neg Pred Value        0.99718   0.9498   0.9562
## Prevalence            0.01950   0.4175   0.5630
## Detection Rate        0.01672   0.3877   0.5444
## Detection Prevalence  0.01704   0.4072   0.5758
## Balanced Accuracy     0.92864   0.9477   0.9476
## [1] "----------------------------------------------------------------------------"
## [1] "3 56 124"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13941, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9464157  0.8707244
##    2  0.9327940  0.8376367
##    3  0.9378940  0.8482245
##    4  0.9324717  0.8343320
##    5  0.9323428  0.8329333
##    6  0.9295663  0.8255578
##    7  0.9280181  0.8213565
##    8  0.9233051  0.8091501
##    9  0.9239509  0.8100731
##   10  0.9215622  0.8039557
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   271    11    31
##          1     3 10752   366
##          2    28   391  3637
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9464          
##                  95% CI : (0.9428, 0.9499)
##     No Information Rate : 0.7201          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8707          
##                                           
##  Mcnemar's Test P-Value : 0.1357          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.89735   0.9640   0.9016
## Specificity           0.99723   0.9149   0.9634
## Pos Pred Value        0.86581   0.9668   0.8967
## Neg Pred Value        0.99796   0.9080   0.9653
## Prevalence            0.01950   0.7201   0.2604
## Detection Rate        0.01750   0.6941   0.2348
## Detection Prevalence  0.02021   0.7179   0.2618
## Balanced Accuracy     0.94729   0.9394   0.9325
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13942, 13941, 13939, 13942, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9546819  0.8862416
##    2    extratrees  0.9331185  0.8272936
##    7    gini        0.9668180  0.9181937
##    7    extratrees  0.9648173  0.9127952
##   12    gini        0.9632028  0.9096440
##   12    extratrees  0.9685616  0.9223843
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0   259     1     6
##          1     4 11060   344
##          2    39    93  3684
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9686          
##                  95% CI : (0.9657, 0.9713)
##     No Information Rate : 0.7201          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9224          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity           0.85762   0.9916   0.9132
## Specificity           0.99954   0.9197   0.9885
## Pos Pred Value        0.97368   0.9695   0.9654
## Neg Pred Value        0.99718   0.9770   0.9700
## Prevalence            0.01950   0.7201   0.2604
## Detection Rate        0.01672   0.7140   0.2378
## Detection Prevalence  0.01717   0.7365   0.2464
## Balanced Accuracy     0.92858   0.9557   0.9509
## [1] "----------------------------------------------------------------------------"
## [1] "4 12 356"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13940, 13941, 13942, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9414467  0.8573649
##    2  0.9293093  0.8274946
##    3  0.9326021  0.8331121
##    4  0.9267277  0.8182022
##    5  0.9257592  0.8144324
##    6  0.9216276  0.8030048
##    7  0.9206594  0.7995742
##    8  0.9180770  0.7917822
##    9  0.9156239  0.7848813
##   10  0.9124603  0.7763073
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0  2676    32   382
##          1    45   877    44
##          2   378    26 11030
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9414          
##                  95% CI : (0.9376, 0.9451)
##     No Information Rate : 0.7396          
##     P-Value [Acc > NIR] : < 2e-16         
##                                           
##                   Kappa : 0.8573          
##                                           
##  Mcnemar's Test P-Value : 0.07703         
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8635  0.93797   0.9628
## Specificity            0.9666  0.99389   0.8999
## Pos Pred Value         0.8660  0.90787   0.9647
## Neg Pred Value         0.9659  0.99601   0.8950
## Prevalence             0.2001  0.06036   0.7396
## Detection Rate         0.1728  0.05662   0.7121
## Detection Prevalence   0.1995  0.06236   0.7382
## Balanced Accuracy      0.9150  0.96593   0.9313
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13940, 13941, 13941, 13942, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9508711  0.8739377
##    2    extratrees  0.9249832  0.7989887
##    7    gini        0.9635255  0.9086552
##    7    extratrees  0.9652683  0.9126557
##   12    gini        0.9601688  0.9007283
##   12    extratrees  0.9666885  0.9165294
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0  2712    24    74
##          1     9   903    23
##          2   378     8 11359
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9667          
##                  95% CI : (0.9637, 0.9695)
##     No Information Rate : 0.7396          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9166          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8751  0.96578   0.9915
## Specificity            0.9921  0.99780   0.9043
## Pos Pred Value         0.9651  0.96578   0.9671
## Neg Pred Value         0.9695  0.99780   0.9741
## Prevalence             0.2001  0.06036   0.7396
## Detection Rate         0.1751  0.05830   0.7333
## Detection Prevalence   0.1814  0.06036   0.7582
## Balanced Accuracy      0.9336  0.98179   0.9479
## [1] "----------------------------------------------------------------------------"
## [1] "4 13 256"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13942, 13940, 13942, 13940, 13942, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9420267  0.8466656
##    2  0.9260164  0.8044348
##    3  0.9320856  0.8172993
##    4  0.9248547  0.7965693
##    5  0.9250484  0.7950810
##    6  0.9200782  0.7803910
##    7  0.9191094  0.7770035
##    8  0.9152365  0.7655359
##    9  0.9131063  0.7580417
##   10  0.9139453  0.7597462
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0  2681    13   377
##          1    24   538    46
##          2   394    44 11373
## 
## Overall Statistics
##                                           
##                Accuracy : 0.942           
##                  95% CI : (0.9382, 0.9457)
##     No Information Rate : 0.7615          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8467          
##                                           
##  Mcnemar's Test P-Value : 0.297           
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8651  0.90420   0.9641
## Specificity            0.9685  0.99530   0.8814
## Pos Pred Value         0.8730  0.88487   0.9629
## Neg Pred Value         0.9663  0.99617   0.8850
## Prevalence             0.2001  0.03841   0.7615
## Detection Rate         0.1731  0.03473   0.7342
## Detection Prevalence   0.1983  0.03925   0.7625
## Balanced Accuracy      0.9168  0.94975   0.9228
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13942, 13941, 13941, 13940, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9497105  0.8586137
##    2    extratrees  0.9234998  0.7732693
##    7    gini        0.9631379  0.8992649
##    7    extratrees  0.9628791  0.8980527
##   12    gini        0.9629442  0.8994866
##   12    extratrees  0.9659777  0.9069241
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0  2701    12    70
##          1     8   546    10
##          2   390    37 11716
## 
## Overall Statistics
##                                          
##                Accuracy : 0.966          
##                  95% CI : (0.963, 0.9688)
##     No Information Rate : 0.7615         
##     P-Value [Acc > NIR] : < 2.2e-16      
##                                          
##                   Kappa : 0.907          
##                                          
##  Mcnemar's Test P-Value : < 2.2e-16      
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8716  0.91765   0.9932
## Specificity            0.9934  0.99879   0.8844
## Pos Pred Value         0.9705  0.96809   0.9648
## Neg Pred Value         0.9687  0.99672   0.9761
## Prevalence             0.2001  0.03841   0.7615
## Detection Rate         0.1744  0.03525   0.7564
## Detection Prevalence   0.1797  0.03641   0.7839
## Balanced Accuracy      0.9325  0.95822   0.9388
## [1] "----------------------------------------------------------------------------"
## [1] "4 15 236"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13940, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8848285  0.8115880
##    2  0.8557777  0.7640789
##    3  0.8620375  0.7735608
##    4  0.8507403  0.7547630
##    5  0.8453163  0.7455258
##    6  0.8340182  0.7268256
##    7  0.8315014  0.7218969
##    8  0.8269826  0.7139728
##    9  0.8235605  0.7076964
##   10  0.8165880  0.6959301
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 2693  268  135
##          1  265 7299  463
##          2  141  512 3714
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8848          
##                  95% CI : (0.8797, 0.8898)
##     No Information Rate : 0.5216          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8116          
##                                           
##  Mcnemar's Test P-Value : 0.4558          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8690   0.9035   0.8613
## Specificity            0.9675   0.9018   0.9416
## Pos Pred Value         0.8698   0.9093   0.8505
## Neg Pred Value         0.9672   0.8955   0.9462
## Prevalence             0.2001   0.5216   0.2784
## Detection Rate         0.1739   0.4712   0.2398
## Detection Prevalence   0.1999   0.5182   0.2819
## Balanced Accuracy      0.9182   0.9026   0.9014
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13941, 13942, 13940, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9165913  0.8609638
##    2    extratrees  0.8689475  0.7755739
##    7    gini        0.9359584  0.8944031
##    7    extratrees  0.9339576  0.8904758
##   12    gini        0.9280182  0.8813119
##   12    extratrees  0.9391223  0.8992980
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 2793   63   55
##          1  227 7832  335
##          2   79  184 3922
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9391          
##                  95% CI : (0.9352, 0.9428)
##     No Information Rate : 0.5216          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.8993          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9013   0.9694   0.9096
## Specificity            0.9905   0.9242   0.9765
## Pos Pred Value         0.9595   0.9330   0.9372
## Neg Pred Value         0.9757   0.9652   0.9655
## Prevalence             0.2001   0.5216   0.2784
## Detection Rate         0.1803   0.5056   0.2532
## Detection Prevalence   0.1879   0.5419   0.2702
## Balanced Accuracy      0.9459   0.9468   0.9430
## [1] "----------------------------------------------------------------------------"
## [1] "4 16 235"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13942, 13941, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8884436  0.8099499
##    2  0.8633313  0.7672010
##    3  0.8653316  0.7689716
##    4  0.8533890  0.7483733
##    5  0.8510652  0.7438586
##    6  0.8431245  0.7294258
##    7  0.8386700  0.7213997
##    8  0.8324084  0.7097083
##    9  0.8316984  0.7075584
##   10  0.8250487  0.6955164
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 2696   86  311
##          1   90 3124  477
##          2  313  451 7942
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8884          
##                  95% CI : (0.8834, 0.8934)
##     No Information Rate : 0.5636          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8099          
##                                           
##  Mcnemar's Test P-Value : 0.8433          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8700   0.8533   0.9097
## Specificity            0.9680   0.9521   0.8870
## Pos Pred Value         0.8716   0.8464   0.9122
## Neg Pred Value         0.9675   0.9545   0.8838
## Prevalence             0.2001   0.2363   0.5636
## Detection Rate         0.1740   0.2017   0.5127
## Detection Prevalence   0.1997   0.2383   0.5620
## Balanced Accuracy      0.9190   0.9027   0.8984
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13941, 13941, 13942, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9160739  0.8525646
##    2    extratrees  0.8577801  0.7396682
##    7    gini        0.9364101  0.8902274
##    7    extratrees  0.9352477  0.8874908
##   12    gini        0.9262745  0.8726723
##   12    extratrees  0.9402188  0.8965124
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 2759   27   67
##          1   62 3304  162
##          2  278  330 8501
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9402          
##                  95% CI : (0.9364, 0.9439)
##     No Information Rate : 0.5636          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.8966          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8903   0.9025   0.9738
## Specificity            0.9924   0.9811   0.9101
## Pos Pred Value         0.9671   0.9365   0.9333
## Neg Pred Value         0.9731   0.9702   0.9641
## Prevalence             0.2001   0.2363   0.5636
## Detection Rate         0.1781   0.2133   0.5488
## Detection Prevalence   0.1842   0.2278   0.5881
## Balanced Accuracy      0.9414   0.9418   0.9419
## [1] "----------------------------------------------------------------------------"
## [1] "4 23 156"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13942, 13942, 13942, 13940, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9391212  0.8522201
##    2  0.9233025  0.8141923
##    3  0.9282747  0.8231126
##    4  0.9209796  0.8049893
##    5  0.9225293  0.8071310
##    6  0.9176230  0.7946394
##    7  0.9166551  0.7908441
##    8  0.9132990  0.7819531
##    9  0.9120716  0.7780009
##   10  0.9085854  0.7683827
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0  2689    40   367
##          1    59   853    75
##          2   351    51 11005
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9391          
##                  95% CI : (0.9352, 0.9428)
##     No Information Rate : 0.739           
##     P-Value [Acc > NIR] : < 2e-16         
##                                           
##                   Kappa : 0.8522          
##                                           
##  Mcnemar's Test P-Value : 0.03552         
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8677  0.90360   0.9614
## Specificity            0.9672  0.99079   0.9006
## Pos Pred Value         0.8685  0.86424   0.9648
## Neg Pred Value         0.9669  0.99373   0.8917
## Prevalence             0.2001  0.06094   0.7390
## Detection Rate         0.1736  0.05507   0.7105
## Detection Prevalence   0.1999  0.06372   0.7364
## Balanced Accuracy      0.9174  0.94719   0.9310
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13941, 13942, 13940, 13940, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9513244  0.8755860
##    2    extratrees  0.9219505  0.7911196
##    7    gini        0.9643647  0.9110199
##    7    extratrees  0.9639782  0.9094582
##   12    gini        0.9617826  0.9048972
##   12    extratrees  0.9667538  0.9167968
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0  2724    27    61
##          1    13   896    31
##          2   362    21 11355
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9668          
##                  95% CI : (0.9638, 0.9695)
##     No Information Rate : 0.739           
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9169          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8790  0.94915   0.9920
## Specificity            0.9929  0.99698   0.9053
## Pos Pred Value         0.9687  0.95319   0.9674
## Neg Pred Value         0.9704  0.99670   0.9755
## Prevalence             0.2001  0.06094   0.7390
## Detection Rate         0.1759  0.05784   0.7331
## Detection Prevalence   0.1815  0.06068   0.7578
## Balanced Accuracy      0.9359  0.97306   0.9486
## [1] "----------------------------------------------------------------------------"
## [1] "4 25 136"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13941, 13942, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8854089  0.8085817
##    2  0.8578434  0.7626725
##    3  0.8617170  0.7677009
##    4  0.8488055  0.7461572
##    5  0.8480954  0.7439754
##    6  0.8400908  0.7304217
##    7  0.8361525  0.7232194
##    8  0.8302773  0.7124174
##    9  0.8256928  0.7039736
##   10  0.8224652  0.6980393
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 2695  310  106
##          1  294 7646  483
##          2  110  472 3374
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8854          
##                  95% CI : (0.8803, 0.8904)
##     No Information Rate : 0.5441          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8086          
##                                           
##  Mcnemar's Test P-Value : 0.8908          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8696   0.9072   0.8514
## Specificity            0.9664   0.8900   0.9495
## Pos Pred Value         0.8663   0.9078   0.8529
## Neg Pred Value         0.9674   0.8893   0.9489
## Prevalence             0.2001   0.5441   0.2558
## Detection Rate         0.1740   0.4936   0.2178
## Detection Prevalence   0.2008   0.5438   0.2554
## Balanced Accuracy      0.9180   0.8986   0.9004
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13941, 13940, 13941, 13941, 13942, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9187216  0.8610777
##    2    extratrees  0.8644292  0.7599647
##    7    gini        0.9356360  0.8915584
##    7    extratrees  0.9343450  0.8885964
##   12    gini        0.9262104  0.8757152
##   12    extratrees  0.9398969  0.8983798
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 2785   66   33
##          1  243 8182  338
##          2   71  180 3592
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9399         
##                  95% CI : (0.936, 0.9436)
##     No Information Rate : 0.5441         
##     P-Value [Acc > NIR] : < 2.2e-16      
##                                          
##                   Kappa : 0.8984         
##                                          
##  Mcnemar's Test P-Value : < 2.2e-16      
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8987   0.9708   0.9064
## Specificity            0.9920   0.9177   0.9782
## Pos Pred Value         0.9657   0.9337   0.9347
## Neg Pred Value         0.9751   0.9634   0.9681
## Prevalence             0.2001   0.5441   0.2558
## Detection Rate         0.1798   0.5282   0.2319
## Detection Prevalence   0.1862   0.5657   0.2481
## Balanced Accuracy      0.9453   0.9443   0.9423
## [1] "----------------------------------------------------------------------------"
## [1] "4 26 135"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13941, 13940, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8870244  0.8120247
##    2  0.8556498  0.7602799
##    3  0.8648173  0.7741288
##    4  0.8496453  0.7486847
##    5  0.8495814  0.7480899
##    6  0.8413170  0.7336835
##    7  0.8375088  0.7266375
##    8  0.8288579  0.7114352
##    9  0.8264696  0.7066365
##   10  0.8233068  0.7011643
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 2700  123  291
##          1  120 3434  484
##          2  279  453 7606
## 
## Overall Statistics
##                                          
##                Accuracy : 0.887          
##                  95% CI : (0.8819, 0.892)
##     No Information Rate : 0.5411         
##     P-Value [Acc > NIR] : <2e-16         
##                                          
##                   Kappa : 0.812          
##                                          
##  Mcnemar's Test P-Value : 0.7255         
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8712   0.8564   0.9075
## Specificity            0.9666   0.9474   0.8970
## Pos Pred Value         0.8671   0.8504   0.9122
## Neg Pred Value         0.9678   0.9497   0.8916
## Prevalence             0.2001   0.2589   0.5411
## Detection Rate         0.1743   0.2217   0.4910
## Detection Prevalence   0.2010   0.2607   0.5383
## Balanced Accuracy      0.9189   0.9019   0.9023
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9179489  0.8602226
##    2    extratrees  0.8655916  0.7629753
##    7    gini        0.9336345  0.8884435
##    7    extratrees  0.9353138  0.8905430
##   12    gini        0.9279532  0.8789290
##   12    extratrees  0.9402197  0.8991753
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 2776   48   64
##          1   67 3638  167
##          2  256  324 8150
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9402          
##                  95% CI : (0.9364, 0.9439)
##     No Information Rate : 0.5411          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.8992          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8958   0.9072   0.9724
## Specificity            0.9910   0.9796   0.9184
## Pos Pred Value         0.9612   0.9396   0.9336
## Neg Pred Value         0.9744   0.9680   0.9658
## Prevalence             0.2001   0.2589   0.5411
## Detection Rate         0.1792   0.2349   0.5261
## Detection Prevalence   0.1864   0.2500   0.5636
## Balanced Accuracy      0.9434   0.9434   0.9454
## [1] "----------------------------------------------------------------------------"
## [1] "4 35 126"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13942, 13940, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8900591  0.8199845
##    2  0.8617183  0.7735159
##    3  0.8686926  0.7841510
##    4  0.8533926  0.7585797
##    5  0.8516509  0.7553739
##    6  0.8429344  0.7407288
##    7  0.8397714  0.7350410
##    8  0.8331865  0.7237734
##    9  0.8309907  0.7197181
##   10  0.8257611  0.7103586
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 2702  292  116
##          1  273 7340  442
##          2  124  456 3745
## 
## Overall Statistics
##                                          
##                Accuracy : 0.8901         
##                  95% CI : (0.885, 0.8949)
##     No Information Rate : 0.5221         
##     P-Value [Acc > NIR] : <2e-16         
##                                          
##                   Kappa : 0.82           
##                                          
##  Mcnemar's Test P-Value : 0.7713         
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8719   0.9075   0.8703
## Specificity            0.9671   0.9034   0.9482
## Pos Pred Value         0.8688   0.9112   0.8659
## Neg Pred Value         0.9679   0.8994   0.9500
## Prevalence             0.2001   0.5221   0.2778
## Detection Rate         0.1744   0.4739   0.2418
## Detection Prevalence   0.2008   0.5200   0.2792
## Balanced Accuracy      0.9195   0.9055   0.9092
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13940, 13942, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9188521  0.8643072
##    2    extratrees  0.8699818  0.7766410
##    7    gini        0.9380893  0.8978472
##    7    extratrees  0.9363465  0.8943557
##   12    gini        0.9324723  0.8885426
##   12    extratrees  0.9397685  0.9003212
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 2782   63   51
##          1  246 7836  313
##          2   71  189 3939
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9398          
##                  95% CI : (0.9359, 0.9435)
##     No Information Rate : 0.5221          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9003          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8977   0.9688   0.9154
## Specificity            0.9908   0.9245   0.9768
## Pos Pred Value         0.9606   0.9334   0.9381
## Neg Pred Value         0.9748   0.9645   0.9678
## Prevalence             0.2001   0.5221   0.2778
## Detection Rate         0.1796   0.5059   0.2543
## Detection Prevalence   0.1870   0.5420   0.2711
## Balanced Accuracy      0.9443   0.9467   0.9461
## [1] "----------------------------------------------------------------------------"
## [1] "4 36 125"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8901878  0.8129410
##    2  0.8630739  0.7667930
##    3  0.8668182  0.7719780
##    4  0.8538413  0.7496552
##    5  0.8537765  0.7489627
##    6  0.8455767  0.7339677
##    7  0.8400254  0.7242351
##    8  0.8343443  0.7138849
##    9  0.8327296  0.7102699
##   10  0.8280170  0.7018771
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 2691   96  307
##          1  109 3130  446
##          2  299  444 7968
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8902          
##                  95% CI : (0.8852, 0.8951)
##     No Information Rate : 0.563           
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8129          
##                                           
##  Mcnemar's Test P-Value : 0.8171          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8683   0.8529   0.9137
## Specificity            0.9675   0.9530   0.8902
## Pos Pred Value         0.8697   0.8494   0.9147
## Neg Pred Value         0.9671   0.9543   0.8889
## Prevalence             0.2001   0.2369   0.5630
## Detection Rate         0.1737   0.2021   0.5144
## Detection Prevalence   0.1997   0.2379   0.5624
## Balanced Accuracy      0.9179   0.9030   0.9019
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13941, 13941, 13942, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9171726  0.8548371
##    2    extratrees  0.8620399  0.7485745
##    7    gini        0.9347961  0.8877232
##    7    extratrees  0.9371847  0.8910802
##   12    gini        0.9251767  0.8711720
##   12    extratrees  0.9393152  0.8950852
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 2784   41   69
##          1   63 3277  163
##          2  252  352 8489
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9393         
##                  95% CI : (0.9354, 0.943)
##     No Information Rate : 0.563          
##     P-Value [Acc > NIR] : < 2.2e-16      
##                                          
##                   Kappa : 0.8951         
##                                          
##  Mcnemar's Test P-Value : < 2.2e-16      
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8984   0.8929   0.9734
## Specificity            0.9911   0.9809   0.9108
## Pos Pred Value         0.9620   0.9355   0.9336
## Neg Pred Value         0.9750   0.9672   0.9637
## Prevalence             0.2001   0.2369   0.5630
## Detection Rate         0.1797   0.2116   0.5480
## Detection Prevalence   0.1868   0.2261   0.5870
## Balanced Accuracy      0.9447   0.9369   0.9421
## [1] "----------------------------------------------------------------------------"
## [1] "4 56 123"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13940, 13941, 13941, 13942, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9433825  0.8702188
##    2  0.9311164  0.8417899
##    3  0.9348600  0.8483590
##    4  0.9284037  0.8335170
##    5  0.9284046  0.8319067
##    6  0.9242723  0.8217650
##    7  0.9229167  0.8179951
##    8  0.9198191  0.8097360
##    9  0.9193662  0.8083484
##   10  0.9169778  0.8019186
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0  2681   362    40
##          1   356 10754    19
##          2    62    38  1178
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9434         
##                  95% CI : (0.9396, 0.947)
##     No Information Rate : 0.7201         
##     P-Value [Acc > NIR] : < 2e-16        
##                                          
##                   Kappa : 0.8702         
##                                          
##  Mcnemar's Test P-Value : 0.01105        
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8651   0.9641  0.95230
## Specificity            0.9676   0.9135  0.99298
## Pos Pred Value         0.8696   0.9663  0.92175
## Neg Pred Value         0.9663   0.9083  0.99585
## Prevalence             0.2001   0.7201  0.07986
## Detection Rate         0.1731   0.6943  0.07605
## Detection Prevalence   0.1990   0.7185  0.08250
## Balanced Accuracy      0.9163   0.9388  0.97264
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13942, 13941, 13942, 13940, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9528738  0.8868377
##    2    extratrees  0.9255651  0.8146344
##    7    gini        0.9668178  0.9221753
##    7    extratrees  0.9662363  0.9204611
##   12    gini        0.9622337  0.9114808
##   12    extratrees  0.9692061  0.9277158
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0  2740    63    28
##          1   341 11072     8
##          2    18    19  1201
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9692          
##                  95% CI : (0.9664, 0.9719)
##     No Information Rate : 0.7201          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9277          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8842   0.9926  0.97090
## Specificity            0.9927   0.9195  0.99740
## Pos Pred Value         0.9679   0.9694  0.97011
## Neg Pred Value         0.9716   0.9798  0.99747
## Prevalence             0.2001   0.7201  0.07986
## Detection Rate         0.1769   0.7148  0.07753
## Detection Prevalence   0.1828   0.7373  0.07992
## Balanced Accuracy      0.9384   0.9561  0.98415
## [1] "----------------------------------------------------------------------------"
## [1] "5 12 346"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13941, 13942, 13940, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9002600  0.8198694
##    2  0.8726926  0.7701433
##    3  0.8818616  0.7863763
##    4  0.8671416  0.7598726
##    5  0.8666253  0.7587737
##    6  0.8568117  0.7409493
##    7  0.8541002  0.7358157
##    8  0.8466760  0.7223355
##    9  0.8464823  0.7218290
##   10  0.8399622  0.7099018
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 7028   13  667
##          1   23  876   61
##          2  735   46 6041
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9003          
##                  95% CI : (0.8954, 0.9049)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : < 2e-16         
##                                           
##                   Kappa : 0.8199          
##                                           
##  Mcnemar's Test P-Value : 0.04246         
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9026  0.93690   0.8925
## Specificity            0.9117  0.99423   0.9104
## Pos Pred Value         0.9118  0.91250   0.8855
## Neg Pred Value         0.9026  0.99594   0.9160
## Prevalence             0.5026  0.06036   0.4370
## Detection Rate         0.4537  0.05655   0.3900
## Detection Prevalence   0.4976  0.06198   0.4404
## Balanced Accuracy      0.9072  0.96556   0.9014
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13941, 13941, 13940, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9317620  0.8760855
##    2    extratrees  0.8919954  0.8023572
##    7    gini        0.9445444  0.8995499
##    7    extratrees  0.9451901  0.9006813
##   12    gini        0.9399616  0.8912619
##   12    extratrees  0.9492569  0.9080788
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 7487    2  437
##          1    7  904   19
##          2  292   29 6313
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9493          
##                  95% CI : (0.9457, 0.9527)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9081          
##                                           
##  Mcnemar's Test P-Value : 2.29e-07        
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9616  0.96684   0.9326
## Specificity            0.9430  0.99821   0.9632
## Pos Pred Value         0.9446  0.97204   0.9516
## Neg Pred Value         0.9605  0.99787   0.9485
## Prevalence             0.5026  0.06036   0.4370
## Detection Rate         0.4833  0.05836   0.4076
## Detection Prevalence   0.5117  0.06004   0.4283
## Balanced Accuracy      0.9523  0.98253   0.9479
## [1] "----------------------------------------------------------------------------"
## [1] "5 13 246"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13940, 13941, 13941, 13940, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9017430  0.8165942
##    2  0.8757915  0.7680851
##    3  0.8816661  0.7788319
##    4  0.8691416  0.7552711
##    5  0.8704984  0.7578138
##    6  0.8604907  0.7389969
##    7  0.8570047  0.7320900
##    8  0.8491932  0.7175246
##    9  0.8491930  0.7173724
##   10  0.8435117  0.7067708
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 7056    8  685
##          1   18  539   51
##          2  712   48 6373
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9017          
##                  95% CI : (0.8969, 0.9064)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8166          
##                                           
##  Mcnemar's Test P-Value : 0.216           
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9062  0.90588   0.8965
## Specificity            0.9100  0.99537   0.9093
## Pos Pred Value         0.9106  0.88651   0.8935
## Neg Pred Value         0.9057  0.99624   0.9119
## Prevalence             0.5026  0.03841   0.4589
## Detection Rate         0.4555  0.03480   0.4114
## Detection Prevalence   0.5003  0.03925   0.4605
## Balanced Accuracy      0.9081  0.95062   0.9029
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13942, 13942, 13941, 13940, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9345388  0.8771292
##    2    extratrees  0.8970303  0.8057569
##    7    gini        0.9446757  0.8963200
##    7    extratrees  0.9464822  0.8997833
##   12    gini        0.9388017  0.8852852
##   12    extratrees  0.9508730  0.9079978
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 7487    1  401
##          1    1  547   13
##          2  298   47 6695
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9509          
##                  95% CI : (0.9473, 0.9542)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.908           
##                                           
##  Mcnemar's Test P-Value : 1.596e-07       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9616  0.91933   0.9418
## Specificity            0.9478  0.99906   0.9588
## Pos Pred Value         0.9490  0.97504   0.9510
## Neg Pred Value         0.9607  0.99678   0.9510
## Prevalence             0.5026  0.03841   0.4589
## Detection Rate         0.4833  0.03531   0.4322
## Detection Prevalence   0.5093  0.03622   0.4545
## Balanced Accuracy      0.9547  0.95919   0.9503
## [1] "----------------------------------------------------------------------------"
## [1] "5 14 236"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13940, 13941, 13941, 13942, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8854713  0.8159912
##    2  0.8570023  0.7702190
##    3  0.8630712  0.7790211
##    4  0.8508059  0.7591731
##    5  0.8486120  0.7553145
##    6  0.8366037  0.7355950
##    7  0.8347958  0.7323602
##    8  0.8278224  0.7207155
##    9  0.8240793  0.7141761
##   10  0.8190440  0.7058115
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 7050  267  432
##          1  276 2947  161
##          2  460  178 3719
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8855          
##                  95% CI : (0.8804, 0.8904)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.816           
##                                           
##  Mcnemar's Test P-Value : 0.5976          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9055   0.8688   0.8625
## Specificity            0.9093   0.9639   0.9429
## Pos Pred Value         0.9098   0.8709   0.8536
## Neg Pred Value         0.9049   0.9632   0.9467
## Prevalence             0.5026   0.2190   0.2784
## Detection Rate         0.4551   0.1903   0.2401
## Detection Prevalence   0.5003   0.2185   0.2813
## Balanced Accuracy      0.9074   0.9163   0.9027
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13940, 13940, 13941, 13942, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9192384  0.8681244
##    2    extratrees  0.8696569  0.7821734
##    7    gini        0.9375740  0.8989908
##    7    extratrees  0.9352494  0.8948228
##   12    gini        0.9295689  0.8860622
##   12    extratrees  0.9396391  0.9022188
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 7542  220  300
##          1   64 3075   74
##          2  180   97 3938
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9396          
##                  95% CI : (0.9358, 0.9433)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9022          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9687   0.9065   0.9133
## Specificity            0.9325   0.9886   0.9752
## Pos Pred Value         0.9355   0.9570   0.9343
## Neg Pred Value         0.9672   0.9742   0.9668
## Prevalence             0.5026   0.2190   0.2784
## Detection Rate         0.4869   0.1985   0.2542
## Detection Prevalence   0.5205   0.2074   0.2721
## Balanced Accuracy      0.9506   0.9476   0.9442
## [1] "----------------------------------------------------------------------------"
## [1] "5 16 234"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13942, 13941, 13940, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8912199  0.8257476
##    2  0.8608782  0.7774064
##    3  0.8707551  0.7922792
##    4  0.8563585  0.7691781
##    5  0.8566172  0.7691578
##    6  0.8481598  0.7553736
##    7  0.8459650  0.7513025
##    8  0.8405431  0.7425918
##    9  0.8351844  0.7333674
##   10  0.8295677  0.7241999
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 7040  414  275
##          1  435 3124  127
##          2  311  123 3641
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8912          
##                  95% CI : (0.8862, 0.8961)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8258          
##                                           
##  Mcnemar's Test P-Value : 0.4243          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9042   0.8533   0.9006
## Specificity            0.9106   0.9525   0.9621
## Pos Pred Value         0.9109   0.8475   0.8935
## Neg Pred Value         0.9039   0.9545   0.9648
## Prevalence             0.5026   0.2363   0.2610
## Detection Rate         0.4545   0.2017   0.2351
## Detection Prevalence   0.4990   0.2380   0.2631
## Balanced Accuracy      0.9074   0.9029   0.9313
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13940, 13942, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9204018  0.8704204
##    2    extratrees  0.8729531  0.7885933
##    7    gini        0.9419640  0.9065266
##    7    extratrees  0.9383484  0.9001997
##   12    gini        0.9338943  0.8936942
##   12    extratrees  0.9418341  0.9060083
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 7, splitrule = gini
##  and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 7483  271  186
##          1  190 3328   77
##          2  113   62 3780
## 
## Overall Statistics
##                                           
##                Accuracy : 0.942           
##                  95% CI : (0.9382, 0.9456)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9065          
##                                           
##  Mcnemar's Test P-Value : 2.322e-07       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9611   0.9090   0.9349
## Specificity            0.9407   0.9774   0.9847
## Pos Pred Value         0.9424   0.9257   0.9558
## Neg Pred Value         0.9599   0.9720   0.9772
## Prevalence             0.5026   0.2363   0.2610
## Detection Rate         0.4831   0.2148   0.2440
## Detection Prevalence   0.5126   0.2321   0.2553
## Balanced Accuracy      0.9509   0.9432   0.9598
## [1] "----------------------------------------------------------------------------"
## [1] "5 23 146"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13941, 13940, 13940, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8976746  0.8155386
##    2  0.8709470  0.7670820
##    3  0.8786949  0.7812038
##    4  0.8633956  0.7534767
##    5  0.8628141  0.7525732
##    6  0.8499682  0.7294496
##    7  0.8498381  0.7288868
##    8  0.8413801  0.7136013
##    9  0.8400887  0.7113805
##   10  0.8336980  0.6995271
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 7045   13  661
##          1   32  862  101
##          2  709   69 5998
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8977          
##                  95% CI : (0.8928, 0.9024)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : < 2e-16         
##                                           
##                   Kappa : 0.8155          
##                                           
##  Mcnemar's Test P-Value : 0.00129         
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9048  0.91314   0.8873
## Specificity            0.9125  0.99086   0.9109
## Pos Pred Value         0.9127  0.86633   0.8852
## Neg Pred Value         0.9046  0.99434   0.9126
## Prevalence             0.5026  0.06094   0.4364
## Detection Rate         0.4548  0.05565   0.3872
## Detection Prevalence   0.4983  0.06423   0.4374
## Balanced Accuracy      0.9087  0.95200   0.8991
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13941, 13941, 13940, 13941, 13940, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9308586  0.8744315
##    2    extratrees  0.8894133  0.7976019
##    7    gini        0.9443501  0.8991571
##    7    extratrees  0.9444796  0.8993996
##   12    gini        0.9365389  0.8849544
##   12    extratrees  0.9489986  0.9076454
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 7495    4  419
##          1    7  893   29
##          2  284   47 6312
## 
## Overall Statistics
##                                           
##                Accuracy : 0.949           
##                  95% CI : (0.9454, 0.9524)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9076          
##                                           
##  Mcnemar's Test P-Value : 8.476e-07       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9626  0.94597   0.9337
## Specificity            0.9451  0.99753   0.9621
## Pos Pred Value         0.9466  0.96125   0.9502
## Neg Pred Value         0.9616  0.99650   0.9494
## Prevalence             0.5026  0.06094   0.4364
## Detection Rate         0.4839  0.05765   0.4075
## Detection Prevalence   0.5112  0.05997   0.4289
## Balanced Accuracy      0.9539  0.97175   0.9479
## [1] "----------------------------------------------------------------------------"
## [1] "5 24 136"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13941, 13941, 13942, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8874765  0.8196752
##    2  0.8617169  0.7786708
##    3  0.8639116  0.7812637
##    4  0.8542919  0.7655823
##    5  0.8526130  0.7626963
##    6  0.8444786  0.7492614
##    7  0.8414447  0.7440602
##    8  0.8355054  0.7341129
##    9  0.8346015  0.7322267
##   10  0.8268551  0.7194470
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 7042  291  423
##          1  303 3304  139
##          2  441  146 3401
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8875          
##                  95% CI : (0.8824, 0.8924)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8197          
##                                           
##  Mcnemar's Test P-Value : 0.852           
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9044   0.8832   0.8582
## Specificity            0.9073   0.9624   0.9491
## Pos Pred Value         0.9079   0.8820   0.8528
## Neg Pred Value         0.9038   0.9628   0.9511
## Prevalence             0.5026   0.2415   0.2558
## Detection Rate         0.4546   0.2133   0.2196
## Detection Prevalence   0.5007   0.2418   0.2575
## Balanced Accuracy      0.9059   0.9228   0.9036
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13942, 13941, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9182708  0.8669221
##    2    extratrees  0.8732735  0.7892090
##    7    gini        0.9395746  0.9026520
##    7    extratrees  0.9373794  0.8985952
##   12    gini        0.9346680  0.8948236
##   12    extratrees  0.9420921  0.9064309
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 7548  214  306
##          1   70 3450   62
##          2  168   77 3595
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9421          
##                  95% CI : (0.9383, 0.9457)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9064          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9694   0.9222   0.9071
## Specificity            0.9325   0.9888   0.9787
## Pos Pred Value         0.9355   0.9631   0.9362
## Neg Pred Value         0.9679   0.9756   0.9684
## Prevalence             0.5026   0.2415   0.2558
## Detection Rate         0.4873   0.2227   0.2321
## Detection Prevalence   0.5209   0.2312   0.2479
## Balanced Accuracy      0.9510   0.9555   0.9429
## [1] "----------------------------------------------------------------------------"
## [1] "5 26 134"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13942, 13941, 13942, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8888952  0.8219449
##    2  0.8604907  0.7767874
##    3  0.8650741  0.7832258
##    4  0.8506134  0.7597141
##    5  0.8501617  0.7587817
##    6  0.8400256  0.7421370
##    7  0.8375727  0.7377619
##    8  0.8313106  0.7269755
##    9  0.8285997  0.7225078
##   10  0.8234996  0.7138932
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 7069  427  258
##          1  438 3429  165
##          2  279  154 3271
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8889          
##                  95% CI : (0.8838, 0.8938)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8219          
##                                           
##  Mcnemar's Test P-Value : 0.7196          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9079   0.8551   0.8855
## Specificity            0.9111   0.9475   0.9633
## Pos Pred Value         0.9117   0.8504   0.8831
## Neg Pred Value         0.9073   0.9493   0.9641
## Prevalence             0.5026   0.2589   0.2385
## Detection Rate         0.4564   0.2214   0.2112
## Detection Prevalence   0.5006   0.2603   0.2391
## Balanced Accuracy      0.9095   0.9013   0.9244
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13941, 13940, 13942, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9197553  0.8693838
##    2    extratrees  0.8720468  0.7869272
##    7    gini        0.9384122  0.9007589
##    7    extratrees  0.9358944  0.8961447
##   12    gini        0.9337636  0.8932236
##   12    extratrees  0.9398333  0.9027896
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 7530  309  218
##          1  180 3635   83
##          2   76   66 3393
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9398         
##                  95% CI : (0.936, 0.9435)
##     No Information Rate : 0.5026         
##     P-Value [Acc > NIR] : < 2.2e-16      
##                                          
##                   Kappa : 0.9028         
##                                          
##  Mcnemar's Test P-Value : < 2.2e-16      
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9671   0.9065   0.9185
## Specificity            0.9316   0.9771   0.9880
## Pos Pred Value         0.9346   0.9325   0.9598
## Neg Pred Value         0.9656   0.9677   0.9748
## Prevalence             0.5026   0.2589   0.2385
## Detection Rate         0.4861   0.2347   0.2190
## Detection Prevalence   0.5201   0.2516   0.2282
## Balanced Accuracy      0.9494   0.9418   0.9532
## [1] "----------------------------------------------------------------------------"
## [1] "5 34 126"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13942, 13941, 13940, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8896070  0.8227354
##    2  0.8624934  0.7790768
##    3  0.8675938  0.7866738
##    4  0.8526160  0.7623893
##    5  0.8543585  0.7648919
##    6  0.8450618  0.7494259
##    7  0.8423495  0.7447150
##    8  0.8370560  0.7357556
##    9  0.8320861  0.7274375
##   10  0.8270502  0.7189195
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 7046  264  424
##          1  280 2991  136
##          2  460  146 3743
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8896          
##                  95% CI : (0.8846, 0.8945)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8227          
##                                           
##  Mcnemar's Test P-Value : 0.5142          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9050   0.8794   0.8699
## Specificity            0.9107   0.9656   0.9458
## Pos Pred Value         0.9110   0.8779   0.8607
## Neg Pred Value         0.9046   0.9661   0.9497
## Prevalence             0.5026   0.2196   0.2778
## Detection Rate         0.4549   0.1931   0.2416
## Detection Prevalence   0.4993   0.2199   0.2808
## Balanced Accuracy      0.9078   0.9225   0.9078
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13940, 13942, 13942, 13940, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9196898  0.8689003
##    2    extratrees  0.8739819  0.7895543
##    7    gini        0.9402836  0.9035029
##    7    extratrees  0.9364749  0.8968955
##   12    gini        0.9345376  0.8941530
##   12    extratrees  0.9410586  0.9045364
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 7527  218  307
##          1   76 3104   50
##          2  183   79 3946
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9411          
##                  95% CI : (0.9372, 0.9447)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9045          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9667   0.9127   0.9170
## Specificity            0.9319   0.9896   0.9766
## Pos Pred Value         0.9348   0.9610   0.9377
## Neg Pred Value         0.9652   0.9758   0.9684
## Prevalence             0.5026   0.2196   0.2778
## Detection Rate         0.4859   0.2004   0.2547
## Detection Prevalence   0.5198   0.2085   0.2717
## Balanced Accuracy      0.9493   0.9511   0.9468
## [1] "----------------------------------------------------------------------------"
## [1] "5 36 124"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13942, 13940, 13941, 13942, 13940, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8919318  0.8268242
##    2  0.8651396  0.7839653
##    3  0.8706926  0.7923900
##    4  0.8588773  0.7731706
##    5  0.8575879  0.7709437
##    6  0.8499059  0.7584622
##    7  0.8459027  0.7516428
##    8  0.8355087  0.7343053
##    9  0.8349929  0.7333028
##   10  0.8296985  0.7242835
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 7057  413  280
##          1  443 3132  127
##          2  286  125 3627
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8919          
##                  95% CI : (0.8869, 0.8968)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8268          
##                                           
##  Mcnemar's Test P-Value : 0.7696          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9064   0.8534   0.8991
## Specificity            0.9100   0.9518   0.9641
## Pos Pred Value         0.9106   0.8460   0.8982
## Neg Pred Value         0.9058   0.9544   0.9645
## Prevalence             0.5026   0.2369   0.2604
## Detection Rate         0.4556   0.2022   0.2342
## Detection Prevalence   0.5003   0.2390   0.2607
## Balanced Accuracy      0.9082   0.9026   0.9316
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13941, 13940, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9196279  0.8689771
##    2    extratrees  0.8714028  0.7857420
##    7    gini        0.9382196  0.9004051
##    7    extratrees  0.9370576  0.8980155
##   12    gini        0.9307315  0.8883792
##   12    extratrees  0.9412537  0.9050390
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 7537  309  216
##          1  161 3290   65
##          2   88   71 3753
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9413          
##                  95% CI : (0.9374, 0.9449)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9051          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9680   0.8965   0.9303
## Specificity            0.9319   0.9809   0.9861
## Pos Pred Value         0.9349   0.9357   0.9594
## Neg Pred Value         0.9665   0.9683   0.9757
## Prevalence             0.5026   0.2369   0.2604
## Detection Rate         0.4866   0.2124   0.2423
## Detection Prevalence   0.5205   0.2270   0.2526
## Balanced Accuracy      0.9499   0.9387   0.9582
## [1] "----------------------------------------------------------------------------"
## [1] "5 46 123"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13942, 13942, 13940, 13940, 13943, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8992242  0.8225641
##    2  0.8772115  0.7836850
##    3  0.8808921  0.7900751
##    4  0.8700463  0.7708514
##    5  0.8684326  0.7678741
##    6  0.8566180  0.7472597
##    7  0.8553916  0.7449067
##    8  0.8484859  0.7327691
##    9  0.8441610  0.7248633
##   10  0.8406102  0.7186907
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 7027  674   19
##          1  721 5727   43
##          2   38   66 1175
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8992          
##                  95% CI : (0.8944, 0.9039)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.8226          
##                                           
##  Mcnemar's Test P-Value : 0.005161        
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9025   0.8856  0.94988
## Specificity            0.9100   0.9153  0.99270
## Pos Pred Value         0.9102   0.8823  0.91869
## Neg Pred Value         0.9023   0.9178  0.99564
## Prevalence             0.5026   0.4175  0.07986
## Detection Rate         0.4536   0.3697  0.07586
## Detection Prevalence   0.4984   0.4190  0.08257
## Balanced Accuracy      0.9063   0.9005  0.97129
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13940, 13942, 13940, 13941, 13942, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9340855  0.8831554
##    2    extratrees  0.8918007  0.8066469
##    7    gini        0.9442859  0.9014470
##    7    extratrees  0.9468029  0.9059226
##   12    gini        0.9368624  0.8882469
##   12    extratrees  0.9502895  0.9121017
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 7497  427    2
##          1  277 6027   39
##          2   12   13 1196
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9503          
##                  95% CI : (0.9468, 0.9537)
##     No Information Rate : 0.5026          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9121          
##                                           
##  Mcnemar's Test P-Value : 2.847e-11       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9629   0.9320  0.96686
## Specificity            0.9443   0.9650  0.99825
## Pos Pred Value         0.9459   0.9502  0.97952
## Neg Pred Value         0.9618   0.9519  0.99713
## Prevalence             0.5026   0.4175  0.07986
## Detection Rate         0.4840   0.3891  0.07721
## Detection Prevalence   0.5117   0.4095  0.07883
## Balanced Accuracy      0.9536   0.9485  0.98255
## [1] "----------------------------------------------------------------------------"
## [1] "6 12 345"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13942, 13941, 13941, 13940, 13942, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9240805  0.8227434
##    2  0.9041320  0.7771365
##    3  0.9117506  0.7921310
##    4  0.8975466  0.7586442
##    5  0.8998711  0.7630839
##    6  0.8911551  0.7421746
##    7  0.8901222  0.7378664
##    8  0.8859255  0.7274539
##    9  0.8834727  0.7199601
##   10  0.8778557  0.7053701
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0  2852     2   519
##          1     4   871    77
##          2   512    62 10591
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9241          
##                  95% CI : (0.9198, 0.9282)
##     No Information Rate : 0.7222          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8228          
##                                           
##  Mcnemar's Test P-Value : 0.5062          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8468  0.93155   0.9467
## Specificity            0.9570  0.99443   0.8666
## Pos Pred Value         0.8455  0.91492   0.9486
## Neg Pred Value         0.9574  0.99560   0.8622
## Prevalence             0.2174  0.06036   0.7222
## Detection Rate         0.1841  0.05623   0.6837
## Detection Prevalence   0.2178  0.06146   0.7208
## Balanced Accuracy      0.9019  0.96299   0.9067
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13941, 13941, 13942, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9378959  0.8477714
##    2    extratrees  0.8965778  0.7283916
##    7    gini        0.9543579  0.8915981
##    7    extratrees  0.9513878  0.8830350
##   12    gini        0.9524855  0.8872566
##   12    extratrees  0.9535186  0.8889409
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 7, splitrule = gini
##  and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0  2988     1   233
##          1     0   868    27
##          2   380    66 10927
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9544         
##                  95% CI : (0.951, 0.9576)
##     No Information Rate : 0.7222         
##     P-Value [Acc > NIR] : < 2.2e-16      
##                                          
##                   Kappa : 0.8916         
##                                          
##  Mcnemar's Test P-Value : 2.224e-11      
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8872  0.92834   0.9768
## Specificity            0.9807  0.99814   0.8964
## Pos Pred Value         0.9274  0.96983   0.9608
## Neg Pred Value         0.9690  0.99541   0.9368
## Prevalence             0.2174  0.06036   0.7222
## Detection Rate         0.1929  0.05604   0.7054
## Detection Prevalence   0.2080  0.05778   0.7342
## Balanced Accuracy      0.9339  0.96324   0.9366
## [1] "----------------------------------------------------------------------------"
## [1] "6 13 245"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13940, 13941, 13941, 13941, 13940, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9255622  0.8130173
##    2  0.9045822  0.7612446
##    3  0.9101327  0.7718873
##    4  0.9000643  0.7465836
##    5  0.9005807  0.7455008
##    6  0.8941893  0.7290577
##    7  0.8932216  0.7239793
##    8  0.8897347  0.7143854
##    9  0.8864420  0.7044479
##   10  0.8823753  0.6934154
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0  2860     1   516
##          1     1   532    66
##          2   507    62 10945
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9256          
##                  95% CI : (0.9213, 0.9297)
##     No Information Rate : 0.7442          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.813           
##                                           
##  Mcnemar's Test P-Value : 0.9769          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8492  0.89412   0.9495
## Specificity            0.9574  0.99550   0.8564
## Pos Pred Value         0.8469  0.88815   0.9506
## Neg Pred Value         0.9581  0.99577   0.8536
## Prevalence             0.2174  0.03841   0.7442
## Detection Rate         0.1846  0.03434   0.7066
## Detection Prevalence   0.2180  0.03867   0.7433
## Balanced Accuracy      0.9033  0.94481   0.9030
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13940, 13942, 13940, 13940, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9365380  0.8309808
##    2    extratrees  0.8937362  0.6933053
##    7    gini        0.9540357  0.8818446
##    7    extratrees  0.9511296  0.8729086
##   12    gini        0.9497752  0.8711616
##   12    extratrees  0.9553267  0.8845920
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0  2933     1   191
##          1     0   541    12
##          2   435    53 11324
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9553         
##                  95% CI : (0.952, 0.9585)
##     No Information Rate : 0.7442         
##     P-Value [Acc > NIR] : < 2.2e-16      
##                                          
##                   Kappa : 0.8847         
##                                          
##  Mcnemar's Test P-Value : < 2.2e-16      
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8708  0.90924   0.9824
## Specificity            0.9842  0.99919   0.8769
## Pos Pred Value         0.9386  0.97830   0.9587
## Neg Pred Value         0.9648  0.99638   0.9448
## Prevalence             0.2174  0.03841   0.7442
## Detection Rate         0.1893  0.03493   0.7311
## Detection Prevalence   0.2017  0.03570   0.7626
## Balanced Accuracy      0.9275  0.95422   0.9296
## [1] "----------------------------------------------------------------------------"
## [1] "6 14 235"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13942, 13941, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8892185  0.8114103
##    2  0.8602317  0.7621287
##    3  0.8659126  0.7705067
##    4  0.8520981  0.7464721
##    5  0.8521634  0.7460455
##    6  0.8421560  0.7280908
##    7  0.8388635  0.7212901
##    8  0.8335054  0.7114521
##    9  0.8298252  0.7047647
##   10  0.8241441  0.6942165
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 2868   95  423
##          1   88 2949  350
##          2  412  348 7957
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8892          
##                  95% CI : (0.8842, 0.8941)
##     No Information Rate : 0.5636          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8114          
##                                           
##  Mcnemar's Test P-Value : 0.9364          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8515   0.8694   0.9115
## Specificity            0.9573   0.9638   0.8876
## Pos Pred Value         0.8470   0.8707   0.9128
## Neg Pred Value         0.9587   0.9634   0.8859
## Prevalence             0.2174   0.2190   0.5636
## Detection Rate         0.1852   0.1904   0.5137
## Detection Prevalence   0.2186   0.2187   0.5628
## Balanced Accuracy      0.9044   0.9166   0.8995
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13940, 13941, 13942, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9163974  0.8535631
##    2    extratrees  0.8639768  0.7522267
##    7    gini        0.9353140  0.8886410
##    7    extratrees  0.9359587  0.8889844
##   12    gini        0.9276960  0.8757267
##   12    extratrees  0.9386052  0.8939297
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 3018   65  160
##          1   32 3032   81
##          2  318  295 8489
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9386          
##                  95% CI : (0.9347, 0.9423)
##     No Information Rate : 0.5636          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.8939          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8961   0.8939   0.9724
## Specificity            0.9814   0.9907   0.9093
## Pos Pred Value         0.9306   0.9641   0.9327
## Neg Pred Value         0.9714   0.9708   0.9623
## Prevalence             0.2174   0.2190   0.5636
## Detection Rate         0.1948   0.1957   0.5480
## Detection Prevalence   0.2094   0.2030   0.5876
## Balanced Accuracy      0.9388   0.9423   0.9409
## [1] "----------------------------------------------------------------------------"
## [1] "6 15 234"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13942, 13942, 13941, 13940, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8908977  0.8222845
##    2  0.8595861  0.7714262
##    3  0.8692050  0.7864890
##    4  0.8577139  0.7675636
##    5  0.8556483  0.7637498
##    6  0.8461585  0.7479246
##    7  0.8422199  0.7413335
##    8  0.8367321  0.7318060
##    9  0.8344730  0.7276077
##   10  0.8270477  0.7149629
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 2858  433  100
##          1  416 7293  294
##          2   94  353 3649
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8909          
##                  95% CI : (0.8859, 0.8958)
##     No Information Rate : 0.5216          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8223          
##                                           
##  Mcnemar's Test P-Value : 0.1163          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8486   0.9027   0.9025
## Specificity            0.9560   0.9042   0.9610
## Pos Pred Value         0.8428   0.9113   0.8909
## Neg Pred Value         0.9578   0.8950   0.9654
## Prevalence             0.2174   0.5216   0.2610
## Detection Rate         0.1845   0.4708   0.2356
## Detection Prevalence   0.2189   0.5167   0.2644
## Balanced Accuracy      0.9023   0.9035   0.9317
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13942, 13942, 13941, 13940, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9216278  0.8700753
##    2    extratrees  0.8744368  0.7865860
##    7    gini        0.9401557  0.9018611
##    7    extratrees  0.9381546  0.8980082
##   12    gini        0.9311177  0.8871959
##   12    extratrees  0.9416408  0.9040109
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 3029  168   60
##          1  309 7799  225
##          2   30  112 3758
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9416          
##                  95% CI : (0.9378, 0.9453)
##     No Information Rate : 0.5216          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.904           
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8993   0.9653   0.9295
## Specificity            0.9812   0.9279   0.9876
## Pos Pred Value         0.9300   0.9359   0.9636
## Neg Pred Value         0.9723   0.9609   0.9754
## Prevalence             0.2174   0.5216   0.2610
## Detection Rate         0.1955   0.5035   0.2426
## Detection Prevalence   0.2103   0.5380   0.2518
## Balanced Accuracy      0.9403   0.9466   0.9586
## [1] "----------------------------------------------------------------------------"
## [1] "6 23 145"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13940, 13942, 13942, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9200136  0.8138005
##    2  0.8984514  0.7640849
##    3  0.9047771  0.7772318
##    4  0.8930921  0.7490155
##    5  0.8926402  0.7467552
##    6  0.8841822  0.7268668
##    7  0.8827626  0.7214406
##    8  0.8754674  0.7035420
##    9  0.8741116  0.6990309
##   10  0.8717223  0.6928042
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0  2865     2   519
##          1     3   845   118
##          2   500    97 10541
## 
## Overall Statistics
##                                           
##                Accuracy : 0.92            
##                  95% CI : (0.9156, 0.9242)
##     No Information Rate : 0.7216          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8139          
##                                           
##  Mcnemar's Test P-Value : 0.4565          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8507  0.89513   0.9430
## Specificity            0.9570  0.99168   0.8615
## Pos Pred Value         0.8461  0.87474   0.9464
## Neg Pred Value         0.9584  0.99318   0.8536
## Prevalence             0.2174  0.06094   0.7216
## Detection Rate         0.1850  0.05455   0.6805
## Detection Prevalence   0.2186  0.06236   0.7190
## Balanced Accuracy      0.9038  0.94340   0.9023
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13942, 13941, 13942, 13941, 13940, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9349893  0.8400683
##    2    extratrees  0.8905739  0.7104764
##    7    gini        0.9512588  0.8838748
##    7    extratrees  0.9500967  0.8797945
##   12    gini        0.9466751  0.8730654
##   12    extratrees  0.9537119  0.8893104
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0  2944     0   177
##          1     0   864    36
##          2   424    80 10965
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9537         
##                  95% CI : (0.9503, 0.957)
##     No Information Rate : 0.7216         
##     P-Value [Acc > NIR] : < 2.2e-16      
##                                          
##                   Kappa : 0.8894         
##                                          
##  Mcnemar's Test P-Value : NA             
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8741  0.91525   0.9809
## Specificity            0.9854  0.99753   0.8831
## Pos Pred Value         0.9433  0.96000   0.9561
## Neg Pred Value         0.9657  0.99452   0.9470
## Prevalence             0.2174  0.06094   0.7216
## Detection Rate         0.1901  0.05578   0.7079
## Detection Prevalence   0.2015  0.05810   0.7404
## Balanced Accuracy      0.9298  0.95639   0.9320
## [1] "----------------------------------------------------------------------------"
## [1] "6 24 135"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13941, 13941, 13941, 13942, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8916735  0.8201001
##    2  0.8643650  0.7753823
##    3  0.8693367  0.7821527
##    4  0.8546171  0.7574907
##    5  0.8562313  0.7598196
##    6  0.8447399  0.7405572
##    7  0.8420278  0.7354187
##    8  0.8378960  0.7278018
##    9  0.8344744  0.7214189
##   10  0.8286636  0.7112662
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 2874   87  426
##          1   82 3325  342
##          2  412  329 7613
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8917          
##                  95% CI : (0.8867, 0.8965)
##     No Information Rate : 0.5411          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8201          
##                                           
##  Mcnemar's Test P-Value : 0.8887          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8533   0.8888   0.9084
## Specificity            0.9577   0.9639   0.8958
## Pos Pred Value         0.8485   0.8869   0.9113
## Neg Pred Value         0.9592   0.9646   0.8924
## Prevalence             0.2174   0.2415   0.5411
## Detection Rate         0.1855   0.2147   0.4915
## Detection Prevalence   0.2187   0.2420   0.5393
## Balanced Accuracy      0.9055   0.9264   0.9021
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13940, 13941, 13941, 13942, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9204000  0.8649010
##    2    extratrees  0.8732732  0.7779977
##    7    gini        0.9381536  0.8965162
##    7    extratrees  0.9369912  0.8938166
##   12    gini        0.9291158  0.8814358
##   12    extratrees  0.9428019  0.9039613
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 3048   62  161
##          1   30 3422   86
##          2  290  257 8134
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9428         
##                  95% CI : (0.939, 0.9464)
##     No Information Rate : 0.5411         
##     P-Value [Acc > NIR] : < 2.2e-16      
##                                          
##                   Kappa : 0.904          
##                                          
##  Mcnemar's Test P-Value : < 2.2e-16      
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9050   0.9147   0.9705
## Specificity            0.9816   0.9901   0.9231
## Pos Pred Value         0.9318   0.9672   0.9370
## Neg Pred Value         0.9738   0.9733   0.9637
## Prevalence             0.2174   0.2415   0.5411
## Detection Rate         0.1968   0.2209   0.5251
## Detection Prevalence   0.2112   0.2284   0.5604
## Balanced Accuracy      0.9433   0.9524   0.9468
## [1] "----------------------------------------------------------------------------"
## [1] "6 25 134"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13942, 13940, 13941, 13943, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8904461  0.8175082
##    2  0.8595854  0.7662529
##    3  0.8650748  0.7742409
##    4  0.8559729  0.7586003
##    5  0.8546169  0.7562524
##    6  0.8448699  0.7393430
##    7  0.8409960  0.7323714
##    8  0.8336365  0.7193789
##    9  0.8315057  0.7150733
##   10  0.8280186  0.7091497
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 2873  424   89
##          1  411 7655  340
##          2   84  349 3265
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8904          
##                  95% CI : (0.8854, 0.8953)
##     No Information Rate : 0.5441          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8175          
##                                           
##  Mcnemar's Test P-Value : 0.9266          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8530   0.9083   0.8839
## Specificity            0.9577   0.8937   0.9633
## Pos Pred Value         0.8485   0.9107   0.8829
## Neg Pred Value         0.9591   0.8909   0.9636
## Prevalence             0.2174   0.5441   0.2385
## Detection Rate         0.1855   0.4942   0.2108
## Detection Prevalence   0.2186   0.5427   0.2387
## Balanced Accuracy      0.9054   0.9010   0.9236
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13942, 13941, 13940, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9163984  0.8574208
##    2    extratrees  0.8692075  0.7701578
##    7    gini        0.9377672  0.8954455
##    7    extratrees  0.9370576  0.8935650
##   12    gini        0.9295037  0.8817537
##   12    extratrees  0.9406725  0.9000565
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 3038  159   65
##          1  303 8165  261
##          2   27  104 3368
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9407          
##                  95% CI : (0.9368, 0.9443)
##     No Information Rate : 0.5441          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9001          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9020   0.9688   0.9117
## Specificity            0.9815   0.9201   0.9889
## Pos Pred Value         0.9313   0.9354   0.9626
## Neg Pred Value         0.9730   0.9611   0.9728
## Prevalence             0.2174   0.5441   0.2385
## Detection Rate         0.1961   0.5271   0.2174
## Detection Prevalence   0.2106   0.5635   0.2259
## Balanced Accuracy      0.9418   0.9445   0.9503
## [1] "----------------------------------------------------------------------------"
## [1] "6 34 125"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13941, 13942, 13941, 13940, 13940, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8921252  0.8167930
##    2  0.8623640  0.7664080
##    3  0.8712075  0.7801139
##    4  0.8599752  0.7609294
##    5  0.8577157  0.7562837
##    6  0.8466753  0.7371817
##    7  0.8464170  0.7357410
##    8  0.8372499  0.7195863
##    9  0.8358936  0.7165758
##   10  0.8311175  0.7079905
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 2876   83  438
##          1   86 3001  341
##          2  406  317 7942
## 
## Overall Statistics
##                                          
##                Accuracy : 0.8921         
##                  95% CI : (0.8871, 0.897)
##     No Information Rate : 0.563          
##     P-Value [Acc > NIR] : <2e-16         
##                                          
##                   Kappa : 0.8168         
##                                          
##  Mcnemar's Test P-Value : 0.5435         
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8539   0.8824   0.9107
## Specificity            0.9570   0.9647   0.8932
## Pos Pred Value         0.8466   0.8754   0.9166
## Neg Pred Value         0.9593   0.9668   0.8859
## Prevalence             0.2174   0.2196   0.5630
## Detection Rate         0.1857   0.1937   0.5127
## Detection Prevalence   0.2193   0.2213   0.5594
## Balanced Accuracy      0.9055   0.9235   0.9019
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13941, 13942, 13941, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9180769  0.8568112
##    2    extratrees  0.8670756  0.7587016
##    7    gini        0.9363459  0.8906586
##    7    extratrees  0.9378312  0.8924007
##   12    gini        0.9292450  0.8785835
##   12    extratrees  0.9413172  0.8988323
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 3018   62  160
##          1   31 3086   84
##          2  319  253 8477
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9413         
##                  95% CI : (0.9375, 0.945)
##     No Information Rate : 0.563          
##     P-Value [Acc > NIR] : < 2.2e-16      
##                                          
##                   Kappa : 0.8989         
##                                          
##  Mcnemar's Test P-Value : < 2.2e-16      
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8961   0.9074   0.9720
## Specificity            0.9817   0.9905   0.9155
## Pos Pred Value         0.9315   0.9641   0.9368
## Neg Pred Value         0.9714   0.9744   0.9621
## Prevalence             0.2174   0.2196   0.5630
## Detection Rate         0.1948   0.1992   0.5473
## Detection Prevalence   0.2092   0.2066   0.5842
## Balanced Accuracy      0.9389   0.9489   0.9438
## [1] "----------------------------------------------------------------------------"
## [1] "6 35 124"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13941, 13940, 13942, 13941, 13942, 13941, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.8916726  0.8232221
##    2  0.8629451  0.7766134
##    3  0.8713363  0.7893048
##    4  0.8591985  0.7694420
##    5  0.8584255  0.7679380
##    6  0.8468706  0.7486481
##    7  0.8466122  0.7476251
##    8  0.8398981  0.7363922
##    9  0.8378961  0.7327547
##   10  0.8328605  0.7241549
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 2865  439   98
##          1  414 7328  317
##          2   89  321 3619
## 
## Overall Statistics
##                                           
##                Accuracy : 0.8917          
##                  95% CI : (0.8867, 0.8965)
##     No Information Rate : 0.5221          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8232          
##                                           
##  Mcnemar's Test P-Value : 0.7552          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8507   0.9060   0.8971
## Specificity            0.9557   0.9012   0.9642
## Pos Pred Value         0.8422   0.9093   0.8982
## Neg Pred Value         0.9584   0.8977   0.9638
## Prevalence             0.2174   0.5221   0.2604
## Detection Rate         0.1850   0.4731   0.2336
## Detection Prevalence   0.2196   0.5203   0.2601
## Balanced Accuracy      0.9032   0.9036   0.9307
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13942, 13942, 13942, 13940, 13941, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9205939  0.8680473
##    2    extratrees  0.8739816  0.7851272
##    7    gini        0.9391881  0.9001734
##    7    extratrees  0.9385407  0.8986125
##   12    gini        0.9316357  0.8879048
##   12    extratrees  0.9428015  0.9058384
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction    0    1    2
##          0 3037  165   60
##          1  303 7823  230
##          2   28  100 3744
## 
## Overall Statistics
##                                          
##                Accuracy : 0.9428         
##                  95% CI : (0.939, 0.9464)
##     No Information Rate : 0.5221         
##     P-Value [Acc > NIR] : < 2.2e-16      
##                                          
##                   Kappa : 0.9058         
##                                          
##  Mcnemar's Test P-Value : < 2.2e-16      
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.9017   0.9672   0.9281
## Specificity            0.9814   0.9280   0.9888
## Pos Pred Value         0.9310   0.9362   0.9669
## Neg Pred Value         0.9729   0.9629   0.9750
## Prevalence             0.2174   0.5221   0.2604
## Detection Rate         0.1961   0.5050   0.2417
## Detection Prevalence   0.2106   0.5394   0.2500
## Balanced Accuracy      0.9416   0.9476   0.9585
## [1] "----------------------------------------------------------------------------"
## [1] "6 45 123"
## k-Nearest Neighbors 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13942, 13941, 13942, 13943, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9227890  0.8303628
##    2  0.9027757  0.7863682
##    3  0.9098784  0.7999655
##    4  0.8965793  0.7701836
##    5  0.8987098  0.7736084
##    6  0.8900591  0.7544985
##    7  0.8866374  0.7457181
##    8  0.8805686  0.7316033
##    9  0.8808249  0.7306180
##   10  0.8772104  0.7221207
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0  2868   536     2
##          1   496 10256    65
##          2     4    93  1170
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9228          
##                  95% CI : (0.9185, 0.9269)
##     No Information Rate : 0.7027          
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8303          
##                                           
##  Mcnemar's Test P-Value : 0.0664          
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8515   0.9422  0.94584
## Specificity            0.9556   0.8782  0.99319
## Pos Pred Value         0.8420   0.9481  0.92344
## Neg Pred Value         0.9586   0.8654  0.99529
## Prevalence             0.2174   0.7027  0.07986
## Detection Rate         0.1852   0.6621  0.07553
## Detection Prevalence   0.2199   0.6983  0.08179
## Balanced Accuracy      0.9036   0.9102  0.96952
## Random Forest 
## 
## 15490 samples
##    12 predictor
##     3 classes: '0', '1', '2' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 13940, 13941, 13940, 13942, 13941, 13942, ... 
## Resampling results across tuning parameters:
## 
##   mtry  splitrule   Accuracy   Kappa    
##    2    gini        0.9367985  0.8540829
##    2    extratrees  0.8956748  0.7446318
##    7    gini        0.9539698  0.8966729
##    7    extratrees  0.9518400  0.8908731
##   12    gini        0.9497741  0.8873300
##   12    extratrees  0.9548738  0.8983049
## 
## Tuning parameter 'min.node.size' was held constant at a value of 1
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 12, splitrule =
##  extratrees and min.node.size = 1.
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction     0     1     2
##          0  2943   191     1
##          1   425 10670    58
##          2     0    24  1178
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9549          
##                  95% CI : (0.9515, 0.9581)
##     No Information Rate : 0.7027          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.8983          
##                                           
##  Mcnemar's Test P-Value : < 2.2e-16       
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2
## Sensitivity            0.8738   0.9802  0.95230
## Specificity            0.9842   0.8951  0.99832
## Pos Pred Value         0.9388   0.9567  0.98003
## Neg Pred Value         0.9656   0.9504  0.99587
## Prevalence             0.2174   0.7027  0.07986
## Detection Rate         0.1900   0.6888  0.07605
## Detection Prevalence   0.2024   0.7200  0.07760
## Balanced Accuracy      0.9290   0.9377  0.97531
## [1] "----------------------------------------------------------------------------"
#print(arr_accuracy_knn)
#confusionMatrix(knn)
#print(arr_accuracy_svm)
#confusionMatrix(svm_radial) 
#print(arr_accuracy_rf)
#confusionMatrix(rf)

cbind(possible_comb, arr_accuracy_knn, arr_accuracy_rf)
##       possible_comb arr_accuracy_knn    arr_accuracy_rf    
##  [1,] "1234 5 6"    "0.895739186571982" "0.944286636539703"
##  [2,] "1235 4 6"    "0.890768237572628" "0.93989670755326" 
##  [3,] "1245 3 6"    "0.929502905100065" "0.954938670109748"
##  [4,] "1345 2 6"    "0.922401549386701" "0.956488056810846"
##  [5,] "2345 1 6"    "0.928147191736604" "0.95823111684958" 
##  [6,] "1236 4 5"    "0.888508715300194" "0.942091672046482"
##  [7,] "1246 3 5"    "0.905616526791478" "0.950871530019367"
##  [8,] "1346 2 5"    "0.897546804389929" "0.949838605551969"
##  [9,] "2346 1 5"    "0.902517753389284" "0.950806972240155"
## [10,] "1256 3 4"    "0.944544867656553" "0.966623628147192"
## [11,] "1356 2 4"    "0.941639767591995" "0.966752743705617"
## [12,] "2356 1 4"    "0.944544867656553" "0.965590703679793"
## [13,] "1456 2 3"    "0.985474499677211" "0.990897353131052"
## [14,] "2456 1 3"    "0.990187217559716" "0.993673337637185"
## [15,] "3456 1 2"    "0.988315041962556" "0.993673337637185"
## [16,] "1 23 456"    "0.9848934796643"   "0.991284699806327"
## [17,] "1 24 356"    "0.943963847643641" "0.967979341510652"
## [18,] "1 25 346"    "0.899870884441575" "0.950484183344093"
## [19,] "1 26 345"    "0.921949644932214" "0.955648805681085"
## [20,] "1 34 256"    "0.942995480955455" "0.966494512588767"
## [21,] "1 35 246"    "0.90135571336346"  "0.949903163331181"
## [22,] "1 36 245"    "0.923692704970949" "0.955777921239509"
## [23,] "1 45 236"    "0.920464816010329" "0.9536475145255"  
## [24,] "1 46 235"    "0.900581020012912" "0.947579083279535"
## [25,] "1 56 234"    "0.945255003227889" "0.968689477081988"
## [26,] "2 13 456"    "0.985603615235636" "0.991672046481601"
## [27,] "2 14 356"    "0.938928340865074" "0.967269205939316"
## [28,] "2 15 346"    "0.894964493221433" "0.949838605551969"
## [29,] "2 16 345"    "0.920787604906391" "0.955132343447385"
## [30,] "2 34 156"    "0.94151065203357"  "0.966881859264041"
## [31,] "2 35 146"    "0.898579728857327" "0.950161394448031"
## [32,] "2 36 145"    "0.917882504841834" "0.952420916720465"
## [33,] "2 45 136"    "0.917753389283409" "0.953195610071013"
## [34,] "2 46 135"    "0.899289864428664" "0.94744996772111" 
## [35,] "2 56 134"    "0.942801807617818" "0.968173014848289"
## [36,] "3 12 456"    "0.987475790832795" "0.992640413169787"
## [37,] "3 14 256"    "0.942027114267269" "0.966365397030342"
## [38,] "3 15 246"    "0.899354422207876" "0.950484183344093"
## [39,] "3 16 245"    "0.924144609425436" "0.95551969012266" 
## [40,] "3 24 156"    "0.944415752098128" "0.967333763718528"
## [41,] "3 25 146"    "0.899483537766301" "0.946029696578438"
## [42,] "3 26 145"    "0.919690122659781" "0.951710781149129"
## [43,] "3 45 126"    "0.922336991607489" "0.954486765655261"
## [44,] "3 46 125"    "0.902646868947708" "0.948870238863783"
## [45,] "3 56 124"    "0.946417043253712" "0.968560361523564"
## [46,] "4 12 356"    "0.941446094254358" "0.966688185926404"
## [47,] "4 13 256"    "0.942027114267269" "0.965978050355068"
## [48,] "4 15 236"    "0.884828921885087" "0.939122014202711"
## [49,] "4 16 235"    "0.888444157520981" "0.940219496449322"
## [50,] "4 23 156"    "0.939122014202711" "0.966752743705616"
## [51,] "4 25 136"    "0.885409941897999" "0.93989670755326" 
## [52,] "4 26 135"    "0.887023886378309" "0.940219496449322"
## [53,] "4 35 126"    "0.890058102001291" "0.939767591994835"
## [54,] "4 36 125"    "0.890187217559716" "0.939315687540349"
## [55,] "4 56 123"    "0.943382827630729" "0.969205939315688"
## [56,] "5 12 346"    "0.90025823111685"  "0.949257585539057"
## [57,] "5 13 246"    "0.901743060038735" "0.950871530019367"
## [58,] "5 14 236"    "0.885474499677211" "0.939638476436411"
## [59,] "5 16 234"    "0.891220142027114" "0.941962556488057"
## [60,] "5 23 146"    "0.897675919948354" "0.948999354422208"
## [61,] "5 24 136"    "0.887475790832795" "0.942091672046482"
## [62,] "5 26 134"    "0.888896061975468" "0.939832149774048"
## [63,] "5 34 126"    "0.889606197546804" "0.941058747579083"
## [64,] "5 36 124"    "0.891930277598451" "0.94125242091672" 
## [65,] "5 46 123"    "0.899225306649451" "0.950290510006456"
## [66,] "6 12 345"    "0.924080051646223" "0.954357650096837"
## [67,] "6 13 245"    "0.925564880568108" "0.955326016785023"
## [68,] "6 14 235"    "0.88921885087153"  "0.938605551969012"
## [69,] "6 15 234"    "0.890897353131052" "0.941639767591995"
## [70,] "6 23 145"    "0.920012911555842" "0.953712072304713"
## [71,] "6 24 135"    "0.891672046481601" "0.942801807617818"
## [72,] "6 25 134"    "0.890445448676565" "0.940671400903809"
## [73,] "6 34 125"    "0.892123950936088" "0.941316978695933"
## [74,] "6 35 124"    "0.891672046481601" "0.942801807617818"
## [75,] "6 45 123"    "0.922788896061976" "0.954874112330536"