public class Core
extends java.lang.Object
This class contains the main body of the CORE algorithm, presented by:
Tan, K.C., Yu, Q., Ang, J.H. A coevolutionary algorithm for rules discovery in data mining. International Journal of Systems Science 37 (12), pp. 835-864
Constructor and Description |
---|
Core()
Default constructor, sets all structures to null.
|
Core(java.lang.String paramfile)
Creates a new instance of Core
|
Modifier and Type | Method and Description |
---|---|
void |
create_copopulation()
Creates a new copopulation, for restarting purposes.
|
void |
crossOver()
Applies the crossover between 2 chromosomes
|
void |
elitism()
Ensures the elitism, keeping the best rule.
|
void |
evaluate_copopulation()
Evaluates the current copopulation
|
void |
evaluate()
Evaluates the current population (set of rules) with the training data set
|
void |
evolve_copopulation()
Evaluates the copopulation, mutating and evaluating it for a established number
of iterations.
|
void |
initialize()
Initialize all populations (both Michigan and Pitts approaches) randomly
|
void |
mutate_copopulation()
Applies the mutation in the current copopulation.
|
void |
mutate()
Applies mutation in the new poblation
|
protected void |
printRules()
Print the final set of rules to disk
|
void |
regeneration()
Randomize the rules with fitness below the average, to obtain diversity.
|
void |
run()
Process the training and test files provided in the parameters file to the constructor.
|
void |
token_competition()
Performs the token competition.
|
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 Core()
Default constructor, sets all structures to null.
public Core(java.lang.String paramfile)
paramfile
- The path to the configuration file with all the parameters in KEEL formatpublic 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 tournament_selection()
public void mutate()
public void crossOver()
Applies the crossover between 2 chromosomes
public void initialize()
Initialize all populations (both Michigan and Pitts approaches) randomly
public void evaluate()
Evaluates the current population (set of rules) with the training data set
public void elitism()
Ensures the elitism, keeping the best rule. Besides, it sorts the rule set by their fitness.
public void token_competition()
Performs the token competition. The rules "fights" for covering the instances, following the fitness order.
public void regeneration()
Randomize the rules with fitness below the average, to obtain diversity.
public void create_copopulation()
Creates a new copopulation, for restarting purposes.
public void evaluate_copopulation()
Evaluates the current copopulation
public void mutate_copopulation()
Applies the mutation in the current copopulation.
public void evolve_copopulation()
Evaluates the copopulation, mutating and evaluating it for a established number of iterations.
public void run()
Process the training and test files provided in the parameters file to the constructor.
protected void printRules()
Print the final set of rules to disk