Class featureselector
Here it is documented the main class of the program. featureselector class gather all the procedures and
objects needed to compute the ACO algorithm applied correctly to Feature Selection.
- class featureselector.FeatureSelector(dtype='mat', data_training_name=None, class_training_name=None, numberAnts=1, iterations=1, n_features=1, data_testing_name=None, class_testing_name=None, alpha=1, beta=1, Q_constant=1, initialPheromone=1.0, evaporationRate=0.1)
Bases:
objectClass for Ant System Optimization algorithm designed for Feature Selection.
- Parameters
dtype (MAT or CSV) – Format of the dataset.
data_training_name (Numpy array) – Path to the training data file (mat) or path to the dataset file (csv).
class_training (Numpy array) – Path to the training classes file (mat).
data_testing (Numpy array) – Path to the testing data file (mat).
class_testing (Numpy array) – Path to the testing classes file (mat).
numberAnts (Integer) – Number of ants of the colonies.
iterations (Integer) – Number of colonies of the algorithm.
n_features (Integer) – Number of features to be selected.
alpha (Float) – Parameter which determines the weight of tau.
beta (Float) – Parameter which determines the weight of eta.
Q_constant (Float) – Parameter for the pheromones update function.
initialPheromone (Float) – Initial value for the pheromones.
evaporationRate (Float) – Rate of the pheromones evaporation.
- __init__(dtype='mat', data_training_name=None, class_training_name=None, numberAnts=1, iterations=1, n_features=1, data_testing_name=None, class_testing_name=None, alpha=1, beta=1, Q_constant=1, initialPheromone=1.0, evaporationRate=0.1)
Constructor method.
- __weakref__
list of weak references to the object (if defined)
- acoFS()
Compute the original ACO algorithm workflow. Firstly it resets the values of the ants (
featureselector.FeatureSelector.resetInitialValues()),
- antBuildSubset(index_ant)
Global and local search for the ACO algorithm. It completes the subset of features of the ant searching.
- Parameters
index_ant (Integer) – Ant that is going to do the local search.
- defineLUT()
Defines the Look-Up Table (LUT) for the algorithm.
- printTestingResults()
Function for printing the entire summary of the algorithm, including the test results.
- redefineLUT(feature)
Re-defines the Look-Up Table (LUT) for the algorithm.
- resetInitialValues()
Initialize the ant array and assign each one a random initial feature.
- updatePheromones()
Update the pheromones trail depending on which variant of the algorithm it is selected.