Learn R Programming

FSinR (version 1.0.8)

lvw: Las Vegas Wrapper

Description

The lvw method LiuSetiono1996FSinR starts with a certain set of features and in each step a new set is randomly generated, if the new set is better it is saved as the best solution. The algorithm ends when there are no improvements in a certain number of iterations.

Usage

lvw(
  data,
  class,
  featureSetEval,
  start = sample(0:1, ncol(data) - 1, replace = TRUE),
  K = 50,
  verbose = FALSE
)

Arguments

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

class
  • The name of the dependent variable

featureSetEval
  • The measure for evaluate features

start
  • Binary vector with the set of initial features (1: selected and 0: unselected) for the algorithm

K
  • The maximum number of iterations without improvement to finalize the algorithm

verbose
  • Print the partial results in each iteration

Value

A list is returned containing:

bestFeatures

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

bestFitness

Evaluation measure obtained with the feature selection

initialVector

The vector with which the algorithm started

initialFitness

The evaluation measure of the initial vector

trace

Matrix with the results of each iteration. It contains the number of the iteration, the value of k, the best set of features selected by the algorithm up to that iteration (1: selected, 0: not selected) and the value of the evaluation measure obtained from that best set of features

References

Examples

Run this code
# NOT RUN {
## lvw method for iris dataset (filter method)
lvw(iris, 'Species', roughsetConsistency, K=15, verbose=TRUE)
# }

Run the code above in your browser using DataLab