rrda.heatmap | R Documentation |
rrda.cv
function.This function creates a heatmap to visualize the Mean Squared Error (MSE) results from the cross-validation of the Bhat matrix obtained from the rrda.cv function. The heatmap displays the MSE for different ranks of Bhat and values of the regularization parameter lambda, allowing users to visually assess the best combination of rank and lambda. The function also allows the user to highlight the points corresponding to the minimum MSE and the 1-standard error rule, helping to identify optimal model parameters.
rrda.heatmap(
cv_result,
nrank = NULL,
min_l = NULL,
max_l = NULL,
highlight_min = TRUE,
title = NULL
)
cv_result |
A result list from the function |
nrank |
A numeric vector specifying the ranks of Bhat to be plotted. Default is |
min_l |
Minimum lambda value to be plotted. Default is |
max_l |
Maximum lambda value to be plotted. Default is |
highlight_min |
Logical indicating if the marks should be plotted on the best prediction point, and 1se point. Default is |
title |
Title of the figure |
A heatmap of MSE cross-validation results.
set.seed(10)
simdata<-rdasim1(n = 10,p = 30,q = 30,k = 3) # data generation
X <- simdata$X
Y <- simdata$Y
cv_result<- rrda.cv(Y = Y, X = X, maxrank = 5, nfold = 5) # cv
rrda.summary(cv_result = cv_result)
rrda.heatmap(cv_result=cv_result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.