View source: R/trans_feature_selection_info_gain.R
| feature_selection_info_gain | R Documentation |
Rank and select features using information gain with optional discretization.
feature_selection_info_gain(
attribute,
features = NULL,
top = NULL,
cutoff = 0,
bins = 3
)
attribute |
target attribute name |
features |
optional vector of feature names (default: all columns except |
top |
optional number of top features to keep |
cutoff |
minimum information gain to keep a feature (default: 0) |
bins |
number of quantile bins for numeric features |
Numeric predictors are discretized by quantile bins before computing entropy-based information gain.
returns an object of class feature_selection_info_gain
data(iris)
fg <- feature_generation(
IsVersicolor = ifelse(Species == "versicolor", "versicolor", "not_versicolor")
)
iris_bin <- transform(fg, iris)
iris_bin$IsVersicolor <- factor(iris_bin$IsVersicolor)
fs <- feature_selection_info_gain("IsVersicolor", top = 2)
fs <- fit(fs, iris_bin)
fs$selected
iris_fs <- transform(fs, iris_bin)
names(iris_fs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.