public class ENN extends Metodo
clasesTest, clasesTrain, datosTest, datosTrain, distanceEu, entradas, ficheroSalida, ficheroTest, ficheroTraining, nEntradas, nominalDistance, nominalTest, nominalTrain, nulosTest, nulosTrain, realTest, realTrain, relation, salida, stdDev, test, training
Constructor and Description |
---|
ENN(java.lang.String ficheroScript)
Default builder.
|
Modifier and Type | Method and Description |
---|---|
void |
ejecutar()
Executes the algorithm
|
int |
evaluaKNN(int i,
int[] vecinos,
double[] distancias,
int[] votos,
boolean test,
boolean distanceEu)
Executes KNN to predict the class of the instance i.
|
int |
getK()
Returns the number k of the NN used.
|
void |
leerConfiguracion(java.lang.String ficheroScript)
Reads configuration script, and extracts its contents.
|
void |
setK(int k)
Sets the number of NN used.
|
normalizar
public ENN(java.lang.String ficheroScript)
ficheroScript
- Name of the configuration files.public void setK(int k)
k
- number of NN used.public int getK()
public int evaluaKNN(int i, int[] vecinos, double[] distancias, int[] votos, boolean test, boolean distanceEu)
i
- Index of the instance to predict.vecinos
- Resulting neighbors of the new instance.distancias
- Resulting distances to each neighbor.votos
- Resulting votes for each class.test
- True if the instance belong to the test dataset.distanceEu
- True= Euclidean distance; False= HVDMpublic void ejecutar()
public void leerConfiguracion(java.lang.String ficheroScript)
leerConfiguracion
in class Metodo
ficheroScript
- Name of the configuration script