public class Ilga
extends java.lang.Object
This class contains the main body of the ILGA algorithm, presented by:
Guan, S.-U., Zhu, F. An incremental approach to genetic-algorithms-based classification. IEEE Transactions on Systems, Man, and Cybernetics, Part B: Cybernetics 35 (2), pp. 227-239
Constructor and Description |
---|
Ilga()
Default constructor
|
Ilga(java.lang.String paramfile)
Constructor for the KEEL parameter file
|
Modifier and Type | Method and Description |
---|---|
void |
crossOver()
It performs a one point crossover in the new poblation, using adjacent chromosomes as parents
|
void |
elitism()
Copy the survivorsPercent proportion of the old poblation into the bottom half of
the new one
|
void |
evaluate()
Its evaluate the NEW poblation, with the train data
|
void |
IGA(SEM sem,
int whichSEM) |
void |
mutate()
Applies mutation in the new poblation
|
void |
onePointCrossover(int cr1,
int cr2)
One-point crossover
|
protected void |
printRules()
Print the rules to the file passed as parameters in the configuration file
|
void |
run()
Runs the ILGA algorithm, with first creates and evolve a single SEM for
each attribute.
|
void |
selection()
Applies a roulette wheel selection
|
void |
tournament_selection()
Applies a tournament selection, with tournament size of 2
|
static void |
writeOutput(java.lang.String fileName,
java.lang.String[] instancesIN,
java.lang.String[] instancesOUT,
Attribute[] inputs,
Attribute output,
int nInputs,
java.lang.String relation)
Writes the output in KEEL format
|
public Ilga()
Default constructor
public Ilga(java.lang.String paramfile)
paramfile
- the file with the parameters of this methodpublic static void writeOutput(java.lang.String fileName, java.lang.String[] instancesIN, java.lang.String[] instancesOUT, Attribute[] inputs, Attribute output, int nInputs, java.lang.String relation)
fileName
- output fileinstancesIN
- output from instances of the input data setinstancesOUT
- class of classified instancesinputs
- the input attributesoutput
- the output attributenInputs
- number of input attributesrelation
- data set namepublic void onePointCrossover(int cr1, int cr2)
cr1
- index of parent 1 in poblationcr2
- index of parent 2 in poblationpublic void crossOver()
public void elitism()
public void mutate()
public void selection()
public void tournament_selection()
public void evaluate()
public void IGA(SEM sem, int whichSEM)
sem
- the SEM model evolved for the actual attributewhichSEM
- the rule set from which we will append the attributespublic void run()
protected void printRules()
Print the rules to the file passed as parameters in the configuration file