public class Individuo
extends java.lang.Object
implements java.lang.Comparable
Title: Individuo (Individual).
Description: This class implements an individual for the genetic algorithm, used to build the decision trees.
Constructor and Description |
---|
Individuo(double[] pesos,
double valor)
Constructor of the class
|
Individuo(Individuo padre,
Individuo madre,
boolean[] mascara)
Create a new individual by crossing other two using a mask given as an argument.
|
Individuo(Individuo padre,
Individuo madre,
int puntoCorte)
Create a new individual by crossing other two at the position given.
|
Individuo(int tam)
Constructor of the class
|
Modifier and Type | Method and Description |
---|---|
Individuo |
clone() |
int |
compareTo(java.lang.Object a)
Funcion de minimizacion del fitness
|
double |
impureza(double[][] ejemplos,
int[] clases,
int n_clases)
Returns the impurity used as fitness of each individual.
|
int |
size()
Returns the size of the chromosome.
|
public Individuo(int tam)
tam
- size of the objectpublic Individuo(double[] pesos, double valor)
pesos
- weights of the objectvalor
- values of the objectpublic Individuo(Individuo padre, Individuo madre, int puntoCorte)
padre
- First individual.madre
- Second individual.puntoCorte
- Cross point.public Individuo(Individuo padre, Individuo madre, boolean[] mascara)
padre
- First individual.madre
- Second individual.mascara
- boolean mask.public double impureza(double[][] ejemplos, int[] clases, int n_clases)
ejemplos
- dataset's examples.clases
- classes considered.n_clases
- number of classes consideredpublic Individuo clone()
clone
in class java.lang.Object
public int size()
public int compareTo(java.lang.Object a)
compareTo
in interface java.lang.Comparable
a
- Object Otro arbol