unitWeightModel {heuristica} | R Documentation |
Unit-weight linear model
Description
Unit-weight linear model inspired by Robyn Dawes.
Unit Weight Model assigns unit (+1 or -1) weights based on
cueValidity
.
A cue validity > 0.5 results in a weight of +1.
A cue validity < 0.5 results in a weight of -1.
This version differs from others in that it uses a weight of 0 if cue validity is 0.5 (rather than randomly assigning +1 or -1) to give faster convergence of average accuracy.
Usage
unitWeightModel(
train_data,
criterion_col,
cols_to_fit,
reverse_cues = TRUE,
fit_name = "unitWeightModel"
)
Arguments
train_data |
Training/fitting data as a matrix or data.frame. |
criterion_col |
The index of the column in train_data that has the criterion. |
cols_to_fit |
A vector of column indices in train_data, used to fit the criterion. |
reverse_cues |
Optional parameter to reverse cues as needed. |
fit_name |
Optional The name other functions can use to label output. It defaults to the class name. |
Value
An object of class
unitWeightModel. This is a list
containing at least the following components:
"cue_validities": A list of cue validities for the cues in order of cols_to_fit.
"linear_coef": A list of linear model coefficients (-1 or +1) for the cues in order of cols_to_fit. (It can only return -1's if reverse_cues=TRUE.)
References
Wikipedia's entry on https://en.wikipedia.org/wiki/Unit-weighted_regression.
See Also
cueValidity
for the metric used to to determine cue direction.
predictPair
for predicting whether row1 is greater.
predictPairProb
for predicting the probability row1 is
greater.