public class TriTrainingGenerator extends PrototypeGenerator
Modifier and Type | Field and Description |
---|---|
protected int |
numberOfClass
Number of classes.
|
protected int |
numberOfPrototypes
Number of prototypes.
|
algorithmName, generatedDataSet, Instancetest, Instancetrain, SEED, seedDefaultValueList, testDataSet, trainingDataSet, transductiveDataSet
Constructor and Description |
---|
TriTrainingGenerator(PrototypeSet _trainingDataSet,
int neigbors,
int poblacion,
int perc,
int iteraciones,
double c1,
double c2,
double vmax,
double wstart,
double wend)
Build a new TriTrainingGenerator Algorithm
|
TriTrainingGenerator(PrototypeSet t,
PrototypeSet unlabeled,
PrototypeSet test,
Parameters parameters)
Build a new TriTrainingGenerator Algorithm
|
Modifier and Type | Method and Description |
---|---|
Pair<PrototypeSet,PrototypeSet> |
applyAlgorithm()
Apply the TriTrainingGenerator method.
|
int[] |
classify(int idAlg,
PrototypeSet train,
PrototypeSet test,
boolean save)
Classify a test set with the algorithm specified.
|
void |
getSolicitaGarbageColector()
Asks for the garbage collector.
|
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 which contains the test data set.
3: Seed of the random number generator.
|
protected double |
measureError(PrototypeSet data,
int id)
Measure combined error excluded the classifier 'id' on the given data set
|
int |
votingRule(int InstanceID)
Classifies a instance with the given index.
|
absoluteAccuracy, absoluteAccuracyAndError, absoluteAccuracyKNN, accuracy, accuracy2, desordenar_vector_sin, desordenar_vector, execute, generateReducedDataSet, getResultingAccuracy, getResultsOfAccuracy, getSeed, getSetSizeFromPercentage, getSetSizeFromPercentage, getTime, inic_vector_sin, inic_vector, saveResultsOfAccuracyIn, selecRandomSet, setInstanceTest, setInstanceTrain, setSeed
protected int numberOfPrototypes
protected int numberOfClass
public TriTrainingGenerator(PrototypeSet _trainingDataSet, int neigbors, int poblacion, int perc, int iteraciones, double c1, double c2, double vmax, double wstart, double wend)
_trainingDataSet
- Original prototype set to be reduced.neigbors
- number of neighbours considered. (not used)poblacion
- population size. (not used)perc
- Reduction percentage of the prototype set.iteraciones
- number of iterations. (not used)wend
- ending w value. (not used)c1
- class 1 value. (not used)vmax
- maximum v value. (not used)c2
- class 2 value. (not used)wstart
- starting w value. (not used)public TriTrainingGenerator(PrototypeSet t, PrototypeSet unlabeled, PrototypeSet test, Parameters parameters)
t
- Original prototype set to be reduced.unlabeled
- Original unlabeled prototype set for SSL.test
- Origital test prototype set.parameters
- Parameters of the algorithm (only % of reduced set).public void getSolicitaGarbageColector()
public int[] classify(int idAlg, PrototypeSet train, PrototypeSet test, boolean save) throws java.lang.Exception
idAlg
- classifier id to use (KNN, C4.5, SMO or NB)train
- training dataset to build the model.test
- test dataset to evaluate.save.
- It indicates if it will save the results in the variable PREDICTIONS!java.lang.Exception
protected double measureError(PrototypeSet data, int id) throws java.lang.Exception
data
- Instances The data setid
- int The id of classifier to be excludedjava.lang.Exception
- Some Exceptionpublic int votingRule(int InstanceID)
InstanceID
- index of the instance to classify.public Pair<PrototypeSet,PrototypeSet> applyAlgorithm() throws java.lang.Exception
applyAlgorithm
in class PrototypeGenerator
java.lang.Exception
- if the algorithm can not be applied.public static void main(java.lang.String[] args)
args
- Arguments of the main function.