public class SSMASFLSDE extends Metodo
Modifier and Type | Field and Description |
---|---|
protected int |
numberOfClass |
protected int |
numberOfPrototypes |
protected int |
numberOfStrategies |
java.lang.String |
Script |
clasesTest, clasesTrain, datosTest, datosTrain, distanceEu, entradas, ficheroSalida, ficheroTest, ficheroTraining, ficheroValidation, nEntradas, nominalDistance, nominalTrain, nulosTrain, realTest, realTrain, relation, salida, stdDev, test, training
Constructor and Description |
---|
SSMASFLSDE(java.lang.String ficheroScript) |
SSMASFLSDE(java.lang.String ficheroScript,
InstanceSet train) |
Modifier and Type | Method and Description |
---|---|
static Prototype |
_1nn(Prototype current,
PrototypeSet dataSet)
Implements the 1NN algorithm
|
double |
classficationAccuracy1NN(PrototypeSet training,
PrototypeSet test) |
void |
desordenar_vector_sin(int[] vector) |
protected static double |
distance(double[] instance1,
double[] instance2)
Calculates the Euclidean distance between two instances
|
protected static double |
distanceWeighting(double[] instance1,
double[] instance2,
double[] Weights)
Calculates the Euclidean distance between two instances
|
void |
ejecutar() |
void |
establishTrain(PrototypeSet trainPG) |
static int |
evaluate(double[] example,
double[][] trainData,
int nClasses,
int[] trainOutput,
int k)
Evaluates a instance to predict its class.
|
void |
inic_vector_sin(int[] vector,
int without) |
void |
leerConfiguracion(java.lang.String ficheroScript)
Reads the parameters of the algorithm.
|
double |
lsff(double Fi,
double CRi,
PrototypeSet[] population,
int actual,
int mejor)
Local Search Fitness Function
|
PrototypeSet |
mutant(PrototypeSet[] population,
int actual,
int mejor,
double SFi) |
static PrototypeSet |
readPrototypeSet(java.lang.String nameOfFile)
Reads the prototype set from a data file.
|
static PrototypeSet |
readPrototypeSet2(InstanceSet training) |
PrototypeSet |
reduceSet(PrototypeSet initial)
Generate a reduced prototype set by the SADEGenerator method.
|
PrototypeSet |
SFGSS(PrototypeSet[] population,
int actual,
int mejor,
double CRi)
SFGSS local Search.
|
PrototypeSet |
SFHC(PrototypeSet[] population,
int actual,
int mejor,
double SFi,
double CRi)
SFHC local search
|
static void |
writeOutput(java.lang.String filename,
int[][] realClass,
int[][] prediction,
Attribute[] inputs,
Attribute output,
java.lang.String relation)
Prints output files.
|
normalizar
public java.lang.String Script
protected int numberOfClass
protected int numberOfPrototypes
protected int numberOfStrategies
public SSMASFLSDE(java.lang.String ficheroScript)
public SSMASFLSDE(java.lang.String ficheroScript, InstanceSet train)
public void establishTrain(PrototypeSet trainPG)
public static PrototypeSet readPrototypeSet(java.lang.String nameOfFile)
nameOfFile
- Name of data file to be read.public static PrototypeSet readPrototypeSet2(InstanceSet training)
public void inic_vector_sin(int[] vector, int without)
public void desordenar_vector_sin(int[] vector)
public PrototypeSet mutant(PrototypeSet[] population, int actual, int mejor, double SFi)
public double lsff(double Fi, double CRi, PrototypeSet[] population, int actual, int mejor)
Fi
- xt
- xr
- xs
- actual
- public PrototypeSet SFGSS(PrototypeSet[] population, int actual, int mejor, double CRi)
population
- public PrototypeSet SFHC(PrototypeSet[] population, int actual, int mejor, double SFi, double CRi)
xt
- xr
- xs
- actual
- SFi
- public static Prototype _1nn(Prototype current, PrototypeSet dataSet)
current
- Prototype which the algorithm will find its nearest-neighbor.dataSet
- Prototype set in which the algorithm will search.public double classficationAccuracy1NN(PrototypeSet training, PrototypeSet test)
public PrototypeSet reduceSet(PrototypeSet initial)
public void ejecutar()
public static void writeOutput(java.lang.String filename, int[][] realClass, int[][] prediction, Attribute[] inputs, Attribute output, java.lang.String relation)
filename
- Name of output filerealClass
- Real output of instancesprediction
- Predicted output for instancesprotected static double distance(double[] instance1, double[] instance2)
instance1
- First instanceinstance2
- Second instanceprotected static double distanceWeighting(double[] instance1, double[] instance2, double[] Weights)
instance1
- First instanceinstance2
- Second instancepublic static int evaluate(double[] example, double[][] trainData, int nClasses, int[] trainOutput, int k)
example
- Instance evaluatedpublic void leerConfiguracion(java.lang.String ficheroScript)
Metodo
leerConfiguracion
in class Metodo
ficheroScript
- Configuration script