selectKBest: Select K best

View source: R/selectIndividualFeatures.R

selectKBestR Documentation

Select K best

Description

Generates a direct search function that takes the 'k' features with the greatest evaluations (The features evaluation is individual). This function is called internally within the directSearchAlgorithm function.

Usage

selectKBest(k = 1)

Arguments

k

Number (positive integer) of returned features

Value

Returns a direct search function that is used in the feature selection process.

Author(s)

Adan M. Rodriguez

Francisco Aragón Royón

Examples

 

## The direct application of this function is an advanced use that consists of using this 
# function directly and performing a direct search process
## Classification problem


# Generates the filter evaluation function
filter_evaluator <- filterEvaluator('IEConsistency')

# Generates the direct search function with k-best
skb_direct_search <- selectKBest()
# Performs the direct search process directly (parameters: dataset, target variable and evaluator)
skb_direct_search(iris, 'Species', filter_evaluator)


FSinR documentation built on Nov. 5, 2025, 5:24 p.m.