public class FuzzyGAPClassifier extends GeneticIndividualForClassification
FuzzyGAPClassifier is designed to allow a Fuzzy Classifier evolve by means of
an Genetic Algorithm and Programming (GAP). This class is a specification of
class GeneticIndividualForClassification
.
c, Co, X
CUSTOM_CESAR, fitnessType, g, STANDARD
Constructor and Description |
---|
FuzzyGAPClassifier(FuzzyGAPClassifier p)
The copy constructor for this class.
|
FuzzyGAPClassifier(FuzzyPartition[] a,
FuzzyPartition b,
int MAXH,
int tf,
Randomize r)
A constructor of the class specifying the input and class variables
partitions, the maximum height of the tree, the fitness type and the
Randomize object to use.
|
Modifier and Type | Method and Description |
---|---|
GeneticIndividual |
clone()
This method clones the current object.
|
void |
crossover(GeneticIndividual p2,
GeneticIndividual p3,
GeneticIndividual p4,
int croosoverID)
This method performs the crossover genetic operation between the current
object and the first parameter.
|
void |
debug()
This method performs the debug operation, which allow to analyze the behaviour
of the learning process.
|
void |
localOptimization(int MAXITER,
int loOptID)
This method performs the local optimization: as this method does not have any
local optimization defined an exception is thrown.
|
void |
mutation(double alpha,
int mutationID)
This method performs the mutation genetic operation of the current
FuzzyGAPClassifier.
|
void |
parametersFromGenotype()
This method sets the current classifier of according to it's genotype.
|
void |
Random()
This method initialize the current object randomly.
|
void |
set(FuzzyGAPClassifier p)
This method copies the given FuzzyGAPClassifier in the current object.
|
fitness, getCo, setExamples
public FuzzyGAPClassifier(FuzzyPartition[] a, FuzzyPartition b, int MAXH, int tf, Randomize r)
A constructor of the class specifying the input and class variables partitions, the maximum height of the tree, the fitness type and the Randomize object to use.
a
- the input variables FuzzyPartition
arrayb
- the class variable FuzzyPartition
MAXH
- the maximum height of the treetf
- the type of Fitness function to evaluate the individualr
- the Randomize object to be used in the genetic evolutionpublic FuzzyGAPClassifier(FuzzyGAPClassifier p)
The copy constructor for this class.
p
- the FuzzyGAPClassifier
to be copiedpublic void set(FuzzyGAPClassifier p)
This method copies the given FuzzyGAPClassifier in the current object.
p
- the FuzzyGAPClassifier
object to be assigned to the current onepublic GeneticIndividual clone()
This method clones the current object.
clone
in class GeneticIndividual
GeneticIndividual
object which is a copy of the current objectpublic void parametersFromGenotype()
This method sets the current classifier of according to it's genotype.
parametersFromGenotype
in class GeneticIndividual
public void Random()
This method initialize the current object randomly.
Random
in class GeneticIndividual
public void mutation(double alpha, int mutationID) throws invalidMutation
This method performs the mutation genetic operation of the current FuzzyGAPClassifier. This methods updates its classifier according its genotype.
mutation
in class GeneticIndividual
alpha
- this parameter is fixed according to GenotypeFuzzyGAP
mutationID
- the type of mutation operation as stated in GenotypeFuzzyGAP
.invalidMutation
- if non supported mutationIDpublic void crossover(GeneticIndividual p2, GeneticIndividual p3, GeneticIndividual p4, int croosoverID) throws invalidCrossover
This method performs the crossover genetic operation between the current object and the first parameter. The crossed individuals are left in the second and thrid parameters. Both individuals have their classifier updated according to their genotypes.
crossover
in class GeneticIndividual
p2
- the GeneticIndividual
to cross withp3
- the first crossed GeneticIndividual
p4
- the second crossed GeneticIndividual
croosoverID
- this value should be fixed to:
OperatorIdent.GAPCRUCEGA for a genetic algorithm crossover
OperatorIdent.GAPCRUCEGP for genetic programming crossoverinvalidCrossover
- in case of invalid crossoverIDpublic void debug()
This method performs the debug operation, which allow to analyze the behaviour of the learning process.
debug
in class GeneticIndividualForClassification
public void localOptimization(int MAXITER, int loOptID) throws invalidOptim
This method performs the local optimization: as this method does not have any local optimization defined an exception is thrown.
localOptimization
in class GeneticIndividual
MAXITER
- an integer with the maximum number of iterations in the
local optimization looploOptID
- the chosen local optimization methodinvalidOptim