regModel: Linear regression (no intercept) wrapper for hueristica

Description Usage Arguments Details Value See Also

View source: R/heuristics.R

Description

A wrapper to create a lm model just specifying columns, generating a model formula for you __without an intercept__. This makes it easier to run automated comparisons with other models in heuristica.

Usage

1
regModel(train_matrix, criterion_col, cols_to_fit, fit_name = "regModel")

Arguments

train_matrix

A matrix (or data.frame) of data to train (fit) the model with.

criterion_col

The index of the criterion column– "y" in the formula.

cols_to_fit

A vector of column indexes to fit– the "x's" in the formula.

fit_name

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

Details

This version assumes you do NOT want to include the intercept. Excluding the intercept typically has higher out-of-sample accuracy if the goal is predicting rank order because the intercept does not affect the ranking, but estimating it wastes a degree of freedom.

Value

An object of class regModel, which is a subclass of lm.

See Also

lm for the regression function being wrapped.

predictPair for predicting whether row1 is greater. greater.


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