Fit Model
fit_model-methods.Rd
Fit a classification or regression model.
Arguments
- obj
A model fitting object.
- roi_x
An ROI containing the training data.
- y
The response vector.
- wts
A set of case weights.
- param
Tuning parameters.
- lev
Factor levels (for classification).
- last
Logical indicating if this is the last iteration.
- classProbs
Logical indicating if class probabilities should be returned.
- ...
Additional arguments to be passed to the method-specific function.
Examples
# \donttest{
ds <- gen_sample_dataset(
D = c(6, 6, 6), nobs = 20,
response_type = "categorical",
data_mode = "image", nlevels = 2
)
mdl <- load_model("sda_notune")
mspec <- mvpa_model(
model = mdl,
dataset = ds$dataset,
design = ds$design,
model_type = "classification"
)
grid <- tune_grid(mspec, ds$dataset$train_data, ds$design$y_train, len = 1)
fit <- fit_model(mspec, ds$dataset$train_data,
ds$design$y_train, wts = NULL, param = grid)
#> Error in UseMethod("fit_model"): no applicable method for 'fit_model' applied to an object of class "c('mvpa_model', 'model_spec', 'list')"
# }