public class CLCCGenerator extends PrototypeGenerator
Modifier and Type | Field and Description |
---|---|
protected int |
m_KValue
Final number of features that were considered in last build.
|
protected int |
m_numFeatures
Number of features to consider in random feature selection.
|
protected int |
numberOfClass
Number of classes.
|
protected int |
numberOfPrototypes
Number of prototypes.
|
algorithmName, generatedDataSet, Instancetest, Instancetrain, SEED, seedDefaultValueList, testDataSet, trainingDataSet, transductiveDataSet
Constructor and Description |
---|
CLCCGenerator(PrototypeSet _trainingDataSet,
int neigbors,
int poblacion,
int perc,
int iteraciones,
double c1,
double c2,
double vmax,
double wstart,
double wend)
Build a new CLCCGenerator Algorithm
|
CLCCGenerator(PrototypeSet t,
PrototypeSet unlabeled,
PrototypeSet test,
Parameters parameters)
Build a new CLCCGenerator Algorithm
|
Modifier and Type | Method and Description |
---|---|
Pair<PrototypeSet,PrototypeSet> |
applyAlgorithm()
Apply the CLCCGenerator method.
|
PrototypeSet |
co_forest_sim(PrototypeSet labeled,
PrototypeSet unlabeled)
It applies a coforest-sim algorithm and fill the this.confidence matrix.
|
PrototypeSet[] |
createCluster(PrototypeSet clusterCenters,
PrototypeSet Lstar)
Creates a cluster from the centers and the complete set of prototypes
|
protected boolean |
isHighConfidence(Prototype inst,
int idExcluded)
To judege whether the confidence for a given instance of H* is high enough,
which is affected by the onfidence threshold.
|
PrototypeSet[] |
localClusterCenter(PrototypeSet Lstar)
Returns the local cluster centers for a given prototype set.
|
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.
|
double |
objetiveFunction(PrototypeSet[] cluster,
PrototypeSet Lstar,
PrototypeSet centers)
Returns the objective function value of the clusters given.
|
double |
penalty(int numCluster,
int n)
Returns the penalty for the cluster given.
|
PrototypeSet |
ProcessCluster(PrototypeSet[] CX,
PrototypeSet Lstar)
Process the cluster given to obtain the best cluster evaluated with the data given.
|
PrototypeSet |
resampleWithWeights(PrototypeSet data,
int id,
boolean[] sampled)
Resample instances w.r.t the weight
|
int |
votingRule(Prototype inst)
Returns the predicted class for a given prototype.
|
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 m_numFeatures
protected int m_KValue
protected int numberOfPrototypes
protected int numberOfClass
public CLCCGenerator(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 CLCCGenerator(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 final PrototypeSet resampleWithWeights(PrototypeSet data, int id, boolean[] sampled)
data
- Instances -- the original data setid
- of the classifiersampled
- boolean[] -- the output parameter, indicating whether the instance is sampledprotected boolean isHighConfidence(Prototype inst, int idExcluded) throws java.lang.Exception
inst
- Instance -- The instanceidExcluded
- int -- the index of the individual should be excluded from H*java.lang.Exception
- - some exceptionpublic int votingRule(Prototype inst) throws java.lang.Exception
inst
- given prototype.java.lang.Exception
public PrototypeSet co_forest_sim(PrototypeSet labeled, PrototypeSet unlabeled) throws java.lang.Exception
labeled
- unlabeled
- java.lang.Exception
public double penalty(int numCluster, int n)
numCluster
- number of clustersn
- number of instances.public double objetiveFunction(PrototypeSet[] cluster, PrototypeSet Lstar, PrototypeSet centers)
cluster
- vector that codes the clusters.Lstar
- prototype set to evaluate the clusters.centers
- center of each cluster.public PrototypeSet[] createCluster(PrototypeSet clusterCenters, PrototypeSet Lstar)
clusterCenters
- cluster centers given.Lstar
- complete prototype set.public PrototypeSet[] localClusterCenter(PrototypeSet Lstar)
Lstar
- given prototype set.public PrototypeSet ProcessCluster(PrototypeSet[] CX, PrototypeSet Lstar)
CX
- Clusters centers.Lstar
- prototype set to evaluate the different clusters.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.