Learn R Programming

FSinR (version 1.0.8)

selectKBest: Select K best

Description

Takes the 'k' features with the greatest evaluations

Usage

selectKBest(data, class, featureEval, k = 1)

Arguments

data
  • A data frame with the features and the class of the examples

class
  • The name of the dependent variable

featureEval
  • The measure used to evaluate features

k
  • Number (positive integer) of returned features

Value

A list is returned containing:

bestFeatures

A vector with all features. Selected features are marked with 1, unselected features are marked with 0

featuresSelected

The names of the k returned features sorted according to the result of the evaluation measure

valuePerFeature

The evaluation measures of the k returned features

Examples

Run this code
# NOT RUN {
## Select K best for iris dataset (filter method)
selectKBest(iris, 'Species', roughsetConsistency, 2) # 2 best features
# }

Run the code above in your browser using DataLab