ForwardSelection: Implement forward feature selection and return data with...

Description Usage Arguments Value Examples

View source: R/rb4model.R

Description

Implement forward feature selection and return data with selected features Uses root mean squared error for regression and accuracy for classification

Usage

1
2
3
4
5
6
7
8
ForwardSelection(
  my_mod,
  feature,
  label,
  max_f = NA,
  type = "classification",
  cv = 3
)

Arguments

my_mod

model name in string (must be in caret::modelLookup())

feature

training dataset with features

label

training dataset with labels.

max_f

maximum amount of features to select

type

problem type. (Must be 'regression' or 'classification')

cv

number of folds for cross validation

Value

The dataset with selected features.

Examples

1
2
3
4
y <- iris$Species
x <- iris[c(1,2,3,4)]
ffs <- ForwardSelection(feature=x, label=y, my_mod="rf")
print(x[ffs])

UBC-MDS/rb4model documentation built on March 31, 2020, 12:54 a.m.