train_model.rsa_model | R Documentation |
This function trains an RSA (representational similarity analysis) model using the specified method and distance calculation.
## S3 method for class 'rsa_model'
train_model(obj, train_dat, y, indices, ...)
obj |
An object of class |
train_dat |
The training data. |
y |
The response variable. |
indices |
The indices of the training data. |
... |
Additional arguments passed to the training method. |
Depending on obj$regtype
:
"lm"
+ no constraints + obj$semipartial=TRUE
: semi-partial correlations
"lm"
+ no constraints + obj$semipartial=FALSE
: T-values of each predictor
"lm"
+ nneg
constraints: raw coefficients from constrained glmnet
"rfit"
: robust regression coefficients
"pearson"
or "spearman"
: correlation coefficients
dset_info <- gen_sample_dataset(D = c(8, 8, 8), nobs = 20,
response_type = "categorical", data_mode = "image", nlevels = 2)
dismat <- dist(matrix(rnorm(20 * 20), 20, 20))
rdes <- rsa_design(~ dismat, list(dismat = dismat))
rsa_mod <- rsa_model(dset_info$dataset, rdes, regtype = "lm")
train_model(rsa_mod, dset_info$dataset$train_data,
dset_info$design$y_train,
indices = seq_len(ncol(dset_info$dataset$train_data)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.