tune_model: This function finds the best hyperparameters for a given...

View source: R/model_fit.R

tune_modelR Documentation

This function finds the best hyperparameters for a given model specification using a specified tuning grid and cross-validation.

Description

This function finds the best hyperparameters for a given model specification using a specified tuning grid and cross-validation.

Usage

tune_model(mspec, x, y, wts, param, nreps = 10)

Arguments

mspec

A model specification derived from the mvpa_model class.

x

The training data matrix.

y

The response vector.

wts

Optional class weights (if the underlying model supports it).

param

A data.frame representing the tuning grid, where parameter names are indicated by column names.

nreps

The number of bootstrap replications (default is 10).

Value

A data frame containing the best hyperparameter values.


bbuchsbaum/rMVPA documentation built on Feb. 1, 2024, 8:45 p.m.