viralx_knn | R Documentation |
Explains the predictions of a K-Nearest Neighbors (KNN) model for CD4 and viral load data using the DALEX and DALEXtra packages. It provides insights into the specified variable's impact on the KNN model's predictions.
viralx_knn(vip_featured, hiv_data, knn_hyperparameters, vip_train, vip_new)
vip_featured |
The name of the variable to be explained. |
hiv_data |
The data frame containing the CD4 and viral load data. |
knn_hyperparameters |
A list of hyperparameters to be tuned for the KNN model. |
vip_train |
The training data used for creating the explainer object. |
vip_new |
A new observation for which to generate explanations. |
A data frame containing explanations for the specified variable.
hiv_data <- train2
knn_hyperparameters <- list(neighbors = 5, weight_func = "optimal", dist_power = 0.3304783)
vip_featured <- c("cd_2022")
vip_train <- hiv_data
vip_new <- vip_train[1,]
viralx_knn(vip_featured, hiv_data, knn_hyperparameters, vip_train, vip_new)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.