feature_selection: Apply feature selection for the input data

Description Usage Arguments Value Examples

View source: R/feature_selection.R

Description

Take input as predictons and response and return the list of features that are important

Usage

1
feature_selection(X, y, mode, n_features)

Arguments

X

data.frame of predictors

y

vector of response and should be a factor in case of classification

mode

string regression or classification

n_features

int number of top important features select from all the features

Value

vector of feature nams of top n_features

Examples

1
2
feature_selection(data.frame(X1 = c(2, 4, 3), X2 = c(8, 7, 4)), c(4, 3, 5), "regression", 2)
feature_selection(data.frame(X1 = c(2, 4, 3), X2 = c(8, 7, 4)), factor(c(1, 1, 0)), "classification", 1)

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