selectKBest: Select K best

Description Usage Arguments Value Author(s) Examples

View source: R/selectIndividualFeatures.R

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run:  

## 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('determinationCoefficient')

# 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)

## End(Not run)

Example output

$bestFeatures
     Sepal.Length Sepal.Width Petal.Length Petal.Width
[1,]            1           0            0           0

$featuresSelected
[1] "Sepal.Length"

$valuePerFeature
[1] NA

Warning messages:
1: In model.response(mf, "numeric") :
  using type = "numeric" with a factor response will be ignored
2: In Ops.factor(y, z$residuals) :-not meaningful for factors
3: In model.response(mf, "numeric") :
  using type = "numeric" with a factor response will be ignored
4: In Ops.factor(y, z$residuals) :-not meaningful for factors
5: In model.response(mf, "numeric") :
  using type = "numeric" with a factor response will be ignored
6: In Ops.factor(y, z$residuals) :-not meaningful for factors
7: In model.response(mf, "numeric") :
  using type = "numeric" with a factor response will be ignored
8: In Ops.factor(y, z$residuals) :-not meaningful for factors

FSinR documentation built on Nov. 23, 2020, 5:10 p.m.