print.train: Print Method for the train Class

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Print the results of a train object.

Usage

1
2
3
4
5
6
7
## S3 method for class 'train'
print(x, 
      digits = min(3, getOption("digits") - 3), 
      printCall = FALSE, 
      details = FALSE, 
      selectCol = FALSE,
      ...)

Arguments

x

an object of class train.

digits

an integer specifying the number of significant digits to print.

printCall

a logical to print the call at the top of the output

details

a logical to show print or summary methods for the final model. In some cases (such as gbm, knn, lvq, naive Bayes and bagged tree models), no information will be printed even if details = TRUE

selectCol

a logical to a column with a star next to the final model

...

options passed to the generic print method

Details

The table of complexity parameters used, their resampled performance and a flag for which rows are optimal.

Value

A data frame with the complexity parameter(s) and performance (invisibly).

Author(s)

Max Kuhn

See Also

train

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
data(iris)
TrainData <- iris[,1:4]
TrainClasses <- iris[,5]

library(klaR)
rdaFit <- train(TrainData, TrainClasses, method = "rda",
                control = trainControl(method = "cv"))
print(rdaFit)

## End(Not run)

Example output

Loading required package: lattice
Loading required package: ggplot2
Loading required package: MASS
Regularized Discriminant Analysis 

150 samples
  4 predictor
  3 classes: 'setosa', 'versicolor', 'virginica' 

No pre-processing
Resampling: Bootstrapped (25 reps) 
Summary of sample sizes: 150, 150, 150, 150, 150, 150, ... 
Resampling results across tuning parameters:

  gamma  lambda  Accuracy   Kappa    
  0.0    0.0     0.9714363  0.9566049
  0.0    0.5     0.9780563  0.9667054
  0.0    1.0     0.9771220  0.9652933
  0.5    0.0     0.9571874  0.9352000
  0.5    0.5     0.9571490  0.9351507
  0.5    1.0     0.9616586  0.9420054
  1.0    0.0     0.9166619  0.8737580
  1.0    0.5     0.9160622  0.8728235
  1.0    1.0     0.9167402  0.8738876

Accuracy was used to select the optimal model using the largest value.
The final values used for the model were gamma = 0 and lambda = 0.5.

caret documentation built on May 2, 2019, 5:47 p.m.

Related to print.train in caret...