autoplot.cvLV: Create cross-validation colorplot

View source: R/cross_validate.R

autoplot.cvLVR Documentation

Create cross-validation colorplot

Description

This function views the cross-validation error in a colorplot as a function of the regularization weights. Hence, this approach is suitable to detect whether the cross-validation procedure contains a reasonable optimum.

Usage

## S3 method for class 'cvLV'
autoplot(object, target = "RMSE", ...)

Arguments

object

A cvLV object returned from cv.LV

target

The cross-validation target to pick, one of 'RMSE' or 'MAE'

...

other arguments passed to methods

Value

A ggplot colorplots cross-validation errors for the different weights combination

Examples

library(micInt)
library(phyloseq)
data("seawater")
physeq_list <- subdivide_by_environment(seawater,"Reactor")
time_series <- lapply(physeq_list$phyloseq,OTU_time_series,
time_points ="Week")
cv_res <- cv.LV(time_series,n_folds = 3,
kind = "integral",
weights = expand.grid(self= c(1,2),
interaction = c(1,2)
)
)
autoplot(cv_res, target = "MAE")

AlmaasLab/micInt documentation built on April 1, 2022, 10:37 a.m.