Learn R Programming

FSinR (version 1.0.8)

aco: Ant Colony Optimization (Advanced Binary Ant Colony Optimization)

Description

The Ant Colony Optimization (Advanced Binary Ant Colony Optimization) Kashef2015FSinR algorithm consists of generating in each iteration a random population of individuals (ants) according to the values of a pheromone matrix (which is updated each iteration according to the paths most followed by the ants) and a heuristic (which determines how good is each path to follow by the ants). The evaluation measure is calculated for each individual. The algorithm ends once the established number of iterations has been reached

Usage

aco(
  data,
  class,
  featureSetEval,
  population = 10,
  iter = 10,
  a = 1,
  b = 1,
  p = 0.2,
  q = 1,
  t0 = 0.2,
  tmin = 0,
  tmax = 1,
  mode = 1,
  verbose = FALSE
)

Arguments

data
  • A data frame with the features and the class of the examples. All features must contain numerical values and not character, boolean, or factor type values since heuristics work only with numerical values. Otherwise the algorithm will generate error.

class
  • The name of the dependent variable

featureSetEval
  • The measure for evaluate features

population
  • The number of ants population

iter
  • The number of iterations

a
  • Parameter to control the influence of the pheromone (If a=0, no pheromone information is used)

b
  • Parameter to control the influence of the heuristic (If b=0, the attractiveness of the movements is not taken into account)

p
  • Rate of pheromone evaporation

q
  • Constant to determine the amount of pheromone deposited by the best ant. This amount is determined by the Q/F equation (for minimization) where F is the cost of the solution (F/Q for maximization)

t0
  • Initial pheromone level

tmin
  • Minimum pheromone value

tmax
  • Maximum pheromone value

mode
  • Heuristic information measurement. 1 -> min redundancy (by default). 2-> max-relevance and min-redundancy. 3-> feature-feature. 4-> based on F-score

verbose
  • Print the partial results in each iteration

Value

A list is returned containing for each repetition of the algorithm:

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

antsIter

List that contains as many elements as iterations has the algorithm. Each of the elements in the list are matrices that represent the population in that iteration. In this matrix the individuals and the evaluation measure of each one are shown

pheromoneIter

List that contains as many elements as iterations have the algorithm. Each of the elements in the list are matrices that represent the amount of pheromone between the paths of the different features (the reading of the matrix is from the columns to the rows, i.e. from top to bottom) in each iteration

References

Examples

Run this code
# NOT RUN {
## Ant Colony Optimization for iris dataset (filter method)
aco(iris, 'Species', roughsetConsistency, population = 10, iter = 5, verbose = TRUE)
# }

Run the code above in your browser using DataLab