public class PittsburghClassifier extends GeneticIndividualForClassification
PittsburghClassifier is designed to allow a Fuzzy Classifier evolve by means of
an Genetic Algorithm. This class is a specification of class
GeneticIndividualForClassification
.
c, C, Co, X
CUSTOM_CESAR, fitnessType, g, STANDARD
Constructor and Description |
---|
PittsburghClassifier()
Default constructor
|
PittsburghClassifier(FuzzyClassifier s,
int tf,
Randomize rand)
A constructor of the class specifying the Fuzzy classifier o be train, the fitness
type and the Randomize object to use.
|
PittsburghClassifier(PittsburghClassifier p)
The copy constructor for this class.
|
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 |
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(PittsburghClassifier p)
This method copies the given
PittsburghClassifier in the current object. |
debug, fitness, getCo, setExamples
public PittsburghClassifier()
Default constructor
public PittsburghClassifier(FuzzyClassifier s, int tf, Randomize rand)
A constructor of the class specifying the Fuzzy classifier o be train, the fitness type and the Randomize object to use.
s
- the FuzzyClassifier
to be cloned, used and train in this classtf
- the type of Fitness function to evaluate the individualrand
- the Randomize object to be used in the genetic evolutionpublic PittsburghClassifier(PittsburghClassifier p)
The copy constructor for this class.
p
- the PittsburghClassifier
to be copiedpublic GeneticIndividual clone()
This method clones the current object.
clone
in class GeneticIndividual
GeneticIndividual
object which is a copy of the current objectpublic void set(PittsburghClassifier p)
This method copies the given PittsburghClassifier
in the current object.
p
- the PittsburghClassifier
object to be assigned to the current onepublic void parametersFromGenotype()
This method sets the current classifier of according to it's genotype.
parametersFromGenotype
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 GenotypePitts
mutationID
- the type of mutation operation as stated in GenotypePitts
.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 according to GenotypePitts
invalidCrossover
- in case of invalid crossoverIDpublic void Random()
This method initialize the current object randomly.
Random
in class GeneticIndividual
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
- for all local optimization method