public class LVQ1 extends LVQGenerator
LVQ1
Implements LVQ1 algorithm.Modifier and Type | Field and Description |
---|---|
protected double |
alpha_0
Alpha parameter.
|
protected static double |
ALPHA_DEFAULT_VALUE
Default alpha_0 learning parameter of the algorithm LVQ1
|
protected int |
chosenRandomIndex
Random number index
|
protected static int |
IALPHA
Index of the alpha parameter.
|
protected java.util.ArrayList<java.lang.Integer> |
randomIndexes
Random number list of indexes
|
initial, initialset, iterations, numberOfPrototypesGenerated
algorithmName, generatedDataSet, SEED, seedDefaultValueList, trainingDataSet
Constructor and Description |
---|
LVQ1(PrototypeSet traDataSet,
int it,
double percNumProt,
double alpha_0)
Constructs a new LVQ1 algorithm.
|
LVQ1(PrototypeSet traDataSet,
int it,
int numProt,
double alpha_0)
Constructs a new LVQ1 algorithm.
|
LVQ1(PrototypeSet traDataSet,
Parameters parameters)
Constructs a new LVQ1 algorithm.
|
LVQ1(PrototypeSet InitialSet,
PrototypeSet traDataSet,
int it,
int numProt,
double alpha_0)
WITH INITIAL CODE-BOOKS
Constructs a new LVQ1 algorithm.
|
Modifier and Type | Method and Description |
---|---|
protected void |
correct(Prototype i,
PrototypeSet tData)
Corrects the instance using a particular method
|
protected Prototype |
extract(PrototypeSet tData)
Extracts a instance using a particular method
|
protected PrototypeSet |
initDataSet()
Initialize the output data set
|
protected PrototypeSet |
initDataSetRandomMode()
Initialize the output data set ignoring the a priority probabilities
|
static void |
main(java.lang.String[] args)
General main for all the prototoype generators
Arguments:
0: Filename with the training data set to be condensed.
1: Filename wich will contain the test data set
3: k Number of neighbors used in the KNN function
|
protected void |
penalize(Prototype m,
Prototype x)
Applies a penalization to prototype m
|
protected void |
reward(Prototype m,
Prototype x)
Applies a reward to prototype m
|
reduceSet
absoluteAccuracy, absoluteAccuracyAndError, absoluteAccuracyKNN, accuracy, accuracy2, desordenar_vector_sin, desordenar_vector, execute, generateReducedDataSet, getResultingAccuracy, getResultingAccuracy, getResults, getResultsOfAccuracy, getResultsOfAccuracy, getSeed, getSetSizeFromPercentage, getSetSizeFromPercentage, getTime, inic_vector_sin, inic_vector, saveResultsOfAccuracyIn, saveResultsOfAccuracyIn, selecRandomSet, setSeed, showResultsOfAccuracy, showResultsOfAccuracy
protected static double ALPHA_DEFAULT_VALUE
protected double alpha_0
protected static final int IALPHA
protected int chosenRandomIndex
protected java.util.ArrayList<java.lang.Integer> randomIndexes
public LVQ1(PrototypeSet traDataSet, int it, int numProt, double alpha_0)
traDataSet
- Training data prototypesit
- Number of iterations that will execute the algorithm.numProt
- Number of prototypes to be returned.alpha_0
- Alpha algorithm parameter.public LVQ1(PrototypeSet InitialSet, PrototypeSet traDataSet, int it, int numProt, double alpha_0)
InitialSet
- Initial dataset.traDataSet
- Training data prototypesit
- Number of iterations that will execute the algorithm.numProt
- Number of prototypes to be returned.alpha_0
- Alpha algorithm parameter.public LVQ1(PrototypeSet traDataSet, int it, double percNumProt, double alpha_0)
traDataSet
- Training data prototypesit
- Number of iterations that will execute the algorithm.percNumProt
- Number of prototypes to be returned expressed as % of training size.alpha_0
- Alpha algorithm parameter.public LVQ1(PrototypeSet traDataSet, Parameters parameters)
traDataSet
- Training data prototypesparameters
- Parameters of the algorithm.protected void reward(Prototype m, Prototype x)
reward
in class LVQGenerator
m
- Rewarded prototype (nearest to x). IT IS MODIFIED.x
- Original prototype.protected void penalize(Prototype m, Prototype x)
penalize
in class LVQGenerator
m
- Penalized prototype (nearest to x). IT IS MODIFIED.x
- Original prototype.protected PrototypeSet initDataSet()
protected PrototypeSet initDataSetRandomMode()
protected Prototype extract(PrototypeSet tData)
tData
- is the training data set.protected void correct(Prototype i, PrototypeSet tData)
i
- is a instance of the instance set.tData
- is the training data set. IS MODIFIED.public static void main(java.lang.String[] args)
args
- Arguments of the main function.