What is the difference between the summary() and print() function within the context of modeling in the caret package in R? What exactly is the variance explained here for this model with 4 components 28.52% or 21.4%?
> summary(model)
Data: X dimension: 261 130
Y dimension: 261 1
Fit method: oscorespls
Number of components considered: 4
TRAINING: % variance explained
1 comps 2 comps 3 comps 4 comps
X 90.1526 92.91 94.86 96.10
.outcome 0.8772 17.17 23.99 28.52
vs
> print(model)
Partial Least Squares
261 samples
130 predictors
No pre-processing
Resampling: Cross-Validated (5 fold, repeated 50 times)
Summary of sample sizes: 209, 209, 209, 208, 209, 209, ...
Resampling results across tuning parameters:
ncomp RMSE Rsquared MAE
1 5.408986 0.03144022 4.129525
2 5.124799 0.14263362 3.839493
3 4.976591 0.19114791 3.809596
4 4.935419 0.21415260 3.799365
5 5.054086 0.19887704 3.886382
RMSE was used to select the optimal model using the smallest value.
The final value used for the model was ncomp = 4.
caret:::print.bagFDA
andcaret:::summary.bagFDA
to see what each are doing differently.