diff --git a/M2/Linear Models/Biaised Models/Code_Lec3.html b/M2/Linear Models/Biaised Models/Code_Lec3.html
index 809b252..ffa5bd4 100644
--- a/M2/Linear Models/Biaised Models/Code_Lec3.html
+++ b/M2/Linear Models/Biaised Models/Code_Lec3.html
@@ -5229,8 +5229,8 @@ margin: 10px 0;
Custom Control Parameters
custom <- trainControl(
method = "repeatedcv",
- number = 5, # Using 5-fold cross-validation
- repeats = 3, # Repeating 3 times for robustness
+ number = 10, # Using 5-fold cross-validation
+ repeats = 10, # Repeating 3 times for robustness
summaryFunction = defaultSummary, # Default metrics (RMSE, MAE)
allowParallel = TRUE # Use parallel processing if resources allow
)
@@ -5247,7 +5247,7 @@ margin: 10px 0;
linear.mod$results
Ytrain <- cookie.train$sugars
@@ -5294,12 +5294,12 @@ margin: 10px 0;
)
library(plotly)
ggplotly(ggplot(Lasso))
-
-
+
+
Lasso$results %>% rmarkdown::paged_table()
@@ -5311,7 +5311,7 @@ margin: 10px 0;
Lasso$results[which.min(Lasso$results$RMSE), ]
par(mfrow = c(1, 2))
@@ -5348,12 +5348,12 @@ margin: 10px 0;
)
library(plotly)
ggplotly(ggplot(ridge))
-
-
+
+
ridge$results %>% rmarkdown::paged_table()
@@ -5365,7 +5365,7 @@ margin: 10px 0;
ridge$results[which.min(ridge$results$RMSE), ]
par(mfrow = c(1, 2))
@@ -5396,24 +5396,24 @@ margin: 10px 0;
trControl = custom
)
-
-
+
+
ElNet$results %>% rmarkdown::paged_table()
ElNet$results[which.min(ElNet$results$RMSE), ]
par(mfrow = c(1, 2))
@@ -5446,33 +5446,33 @@ margin: 10px 0;
trControl = custom
)
ggplotly(ggplot(pls_mod))
-
-
+
+
pls_mod$results %>% rmarkdown::paged_table()
pls_mod$results[which.min(pls_mod$results$RMSE), ]
vip(pls_mod, num_features = 20)
-
+
data.frame(Coefficients = as.matrix(coef(pls_mod$finalModel))) %>%
rmarkdown::paged_table()
@@ -5536,7 +5536,7 @@ margin: 10px 0;
ylab("Fitted value") +
xlab("Y") +
theme_bw()
-
+
@@ -5576,7 +5576,7 @@ Linear
0.000000
-11.598358
+11.5983578
|
@@ -5587,7 +5587,7 @@ Lasso
1.125158
|
-1.060734
+1.0607338
|
@@ -5598,7 +5598,7 @@ Ridge
2.526064
|
-2.594585
+2.5945854
|
@@ -5609,7 +5609,7 @@ ElNet
1.133296
|
-1.095012
+1.0950125
|
@@ -5617,10 +5617,10 @@ ElNet
PLS
|
-2.271071
+2.425705
|
-1.306989
+0.8836003
|