Description Usage Arguments Value
View source: R/model-features.R
This function fits a sequential conditional logit model that predicts chord voicings from chord features.
1 2 3 | model_features(x, features = attr(x, "features"),
formula = linear_formula(x, features), keep_model = TRUE,
eval_model = TRUE, perm_int = TRUE, verbose = TRUE)
|
x |
A corpus's feature analysis as created by
|
features |
(Character vector)
Features to model, corresponding to columns of |
formula |
(Formula)
The formula used to predict chord voicings.
The default is created by |
keep_model |
(Logical scalar)
Determines whether the returned object should include the fitted model
from |
eval_model |
(Logical scalar) Whether to compute and return model evaluation metrics. |
perm_int |
(Logical scalar) Whether to compute and return permutation-based feature importance metrics (also known as model reliance metrics). |
verbose |
(Logical scalar) Whether to show progress messages during the computation. |
An object of class voicer_mod
with the following slots:
features
-
A character vector listing the features used to fit the model.
formula
-
A character vector corresponding to the formula used to fit the model.
weights
-
A tibble
describing the fitted weights.
This tibble has five columns:
feature
(the name of the feature, or more generally the effect),
estimate
(the estimate of the corresponding regression weight),
std_err
(the standard error of the regression weight),
z
(the z-statistic associated with the regression weight),
and p
(the p-value associated with the regression weight).
mod
-
A fitted model as created by mclogit
.
eval
-
Evaluation metrics for the fitted model.
This is a list with two components.
summary
is a tibble
listing six model statistics:
probability
, the mean probability assigned to the observed voicing;
accuracy
, the mean accuracy when predicting the correct voicing;
info_content
, the mean log probability of the observed voicing (base 2);
num_options
, the mean number of candidate voicings for each chord;
abs_rank
, the mean absolute rank of the chosen voicing
within the list of candidates as ranked by assigned probability;
pct_rank
, the mean percentile rank of the chosen voicing
within the list of candidates as ranked by assigned probability.
perm_int
is a tibble
listing permutation importances
(also known as model reliances) by feature,
with the permutation importance metrics mapping to
the columns of summary
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.