hillClimbing: Hill-Climbing

View source: R/localSearch.R

hillClimbingR Documentation

Hill-Climbing

Description

Generates a search function based on the hill climbing method. This function is called internally within the searchAlgorithm function. The Hill-Climbing \insertCiteRussell2009FSinR method starts with a certain set of features and in each iteration it searches among its neighbors to advance towards a better solution. The method ends as soon as no better solutions are found.

Usage

hillClimbing(start = NULL, nneigh = NULL, repeats = 1, verbose = FALSE)

Arguments

start

Binary vector with the set of initial features

nneigh

Number of neighbors to evaluate in each iteration of the algorithm. By default: all posibles. It is important to note that a high value of this parameter considerably increases the computation time.

repeats

Number of repetitions of the algorithm

verbose

Print the partial results in each iteration

Value

Returns a search function that is used to guide the feature selection process.

Author(s)

Francisco Aragón Royón

References

\insertAllCited

Examples

 

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

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

# Generates the search function with Hill-Climbing
hc_search <- hillClimbing()
# Performs the search process directly (parameters: dataset, target variable and evaluator)
hc_search(iris, 'Species', filter_evaluator)


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