public class CHC_Chromosome
extends java.lang.Object
implements java.lang.Comparable
Title: CHC_RuleBase
Description: Chromosome that represents a modified data base and rule base used in the CHC algorithm
Company: KEEL
Modifier and Type | Field and Description |
---|---|
static double |
MAX_LATERAL_TUNING
Maximum lateral tuning.
|
static double |
MIN_LATERAL_TUNING
Minimum lateral tuning.
|
Constructor and Description |
---|
CHC_Chromosome()
Default constructor
|
CHC_Chromosome(boolean[] data_rules,
double[] data_tuning)
Creates a CHC chromosome from a boolean array representing a chromosome
|
CHC_Chromosome(CHC_Chromosome orig)
Creates a CHC chromosome from another chromosome (copies a chromosome)
|
CHC_Chromosome(int size_rules,
boolean value_rules,
int size_tuning,
double value_tuning)
Creates a CHC_Chromosome of specified size with all its elements set to the specified value
|
CHC_Chromosome(int size_rule,
int size_tuning)
Creates a random CHC_Chromosome of specified size
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object aThat)
Compares this object with the specified object for order, according to the fitness measure
|
java.util.ArrayList<CHC_Chromosome> |
createDescendants(CHC_Chromosome ch_b)
Obtains a new pair of CHC_chromosome from this chromosome and another chromosome, swapping half the differing bits at random
|
void |
evaluate(myDataset dataset,
java.util.ArrayList<Rule> rule_population,
GP_COACH_H gp_coach_obj,
boolean has_low,
boolean has_high,
int labels_low,
int labels_high,
double alpha)
Evaluates this chromosome, computing the fitness of the rule
and the weight.
|
double |
getFitness()
Obtains the fitness associated to this CHC_Chromosome, its fitness measure
|
int |
hammingDistance(CHC_Chromosome ch_b,
int bitsgen)
Obtains the Hamming distance between this and another chromosome
|
boolean |
not_eval()
Checks if the current chromosome has been evaluated or not.
|
double[] |
obtainLateralTuning()
Obtains the lateral tuning of the data base associated to the current chromosome
|
boolean[] |
obtainSelectedRules()
Obtains the selected rules of the rule base associated to the current chromosome
|
public static final double MIN_LATERAL_TUNING
public static final double MAX_LATERAL_TUNING
public CHC_Chromosome()
public CHC_Chromosome(CHC_Chromosome orig)
orig
- Original chromosome that is going to be copiedpublic CHC_Chromosome(int size_rule, int size_tuning)
size_rule
- Size of the new chromosome considering the number of rules in the rule basesize_tuning
- Size of the new chromosome considering the number fuzzy labels in the data basepublic CHC_Chromosome(int size_rules, boolean value_rules, int size_tuning, double value_tuning)
size_rules
- Size of the rule part of the new chromosomevalue_rules
- Value that all elements of the rule part of the chromosome are going to havesize_tuning
- Size of the tuning part of the new chromosomevalue_tuning
- Value that all elements of the tuning part of the chromosome are going to havepublic CHC_Chromosome(boolean[] data_rules, double[] data_tuning)
data_rules
- boolean array representing the rule part of a chromosomedata_tuning
- boolean array representing the tuning part of a chromosomepublic boolean not_eval()
public void evaluate(myDataset dataset, java.util.ArrayList<Rule> rule_population, GP_COACH_H gp_coach_obj, boolean has_low, boolean has_high, int labels_low, int labels_high, double alpha)
dataset
- Training dataset used in this algorithmrule_population
- Rule population that is selected by the CHC chromosomegp_coach_obj
- GP-COACH-H object that we will use to train an element in the training set with our ruleshas_low
- true, if the associated rule base contains low granularity rules; false otherwisehas_high
- true, if the associated rule base contains high granularity rules; false otherwiselabels_low
- Number of fuzzy labels in low granularity ruleslabels_high
- Number of fuzzy labels in high granularity rulesalpha
- Alpha of the raw_fitness evaluation functionpublic double getFitness()
public int hammingDistance(CHC_Chromosome ch_b, int bitsgen)
ch_b
- Other chromosome that we want to compute the Hamming distance tobitsgen
- Number of bits per gen in the gray codificationpublic java.util.ArrayList<CHC_Chromosome> createDescendants(CHC_Chromosome ch_b)
ch_b
- Other chromosome that we want to use to create another chromosomepublic boolean[] obtainSelectedRules()
public double[] obtainLateralTuning()
public int compareTo(java.lang.Object aThat)
compareTo
in interface java.lang.Comparable
aThat
- object to compare with.