public class LVQ extends Metodo
clasesTrain, datosTrain, distanceEu, entradas, ficheroSalida, ficheroTest, ficheroTraining, ficheroValidation, nEntradas, nominalDistance, nominalTrain, nulosTrain, realTest, realTrain, relation, salida, stdDev, test, training
Constructor and Description |
---|
LVQ(java.lang.String ficheroScript)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
ejecutar()
Executes the LVQ algorithm.
|
protected static void |
escribeSalida(java.lang.String nombreFichero,
java.lang.String[] instanciasIN,
java.lang.String[] instanciasOUT,
Attribute[] entradas,
Attribute salida,
int nEntradas,
java.lang.String relation)
Prints on the given file the output values given as arguments.
|
void |
leerConfiguracion(java.lang.String ficheroScript)
Reads the parameters of the algorithm.
|
protected int |
NN(int nSel,
double[][] conj,
double[] ejemplo)
Computes and returns the Nearest Neighbour (NN) of the given example in the given dataset.
|
protected void |
printNetworkToFile(java.lang.String file_name,
java.lang.String header)
Save network weights to a file
|
normalizar
public LVQ(java.lang.String ficheroScript)
ficheroScript
- Configuration scriptpublic void ejecutar()
protected int NN(int nSel, double[][] conj, double[] ejemplo)
nSel
- number of examples in the given dataset.conj
- given dataset.ejemplo
- example given to compute its NN.public void leerConfiguracion(java.lang.String ficheroScript)
Metodo
leerConfiguracion
in class Metodo
ficheroScript
- Configuration scriptprotected static void escribeSalida(java.lang.String nombreFichero, java.lang.String[] instanciasIN, java.lang.String[] instanciasOUT, Attribute[] entradas, Attribute salida, int nEntradas, java.lang.String relation)
nombreFichero
- output filename.instanciasIN
- Real classes for each example.instanciasOUT
- Predicted classes for each example.entradas
- Input attributes.salida
- Output attributes.nEntradas
- Number of input attributes.relation
- Relation string.protected void printNetworkToFile(java.lang.String file_name, java.lang.String header)
Save network weights to a file
file_name
- Output file nameheader
- header of the data set for which the network has been adjusted to