minModel: Minimalist Model

Description Usage Arguments Value See Also Examples

View source: R/heuristics.R

Description

Fit the Minimalist heuristic by specifying columns and a dataset. It searches cues in a random order, making a decision based on the first cue that discriminates (has differing values on the two objects).

Usage

1
2
3
4
5
6
7
minModel(
  train_data,
  criterion_col,
  cols_to_fit,
  reverse_cues = TRUE,
  fit_name = "minModel"
)

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. By default, the model will reverse the cue values for cues with cue validity < 0.5, so a cue with validity 0 becomes a cue with validity 1. Set this to FALSE if you do not want that, i.e. the cue stays validity 0.

fit_name

Optional The name other functions can use to label output. It defaults to the class name.

Value

An object of class minModel, which can be passed to a variety of functions to make predictions, e.g. predictPair and percentCorrectList.

See Also

predictPairProb for prediction.

Examples

1
2
3
4
5
## Fit column (5,4) to column (1,0), having validity 1.0, and column (0,1),
## validity 0.
train_matrix <- cbind(c(5,4), c(1,0), c(0,1))
min <- minModel(train_matrix, 1, c(2,3))
predictPair(oneRow(train_matrix, 1), oneRow(train_matrix, 2), min)

heuristica documentation built on Sept. 8, 2021, 9:08 a.m.