weka.clusterers
Interface SemiSupClusterer

All Known Implementing Classes:
HAC, MPCKMeans, PCKMeans, PCSoftKMeans, SeededKMeans

public interface SemiSupClusterer


Method Summary
 void buildClusterer(Instances data)
          Generates the clustering.
 void buildClusterer(Instances labeledData, Instances unlabeledData, int classIndex, int numClusters, int startingIndexOfTest)
          Generates the clustering using labeled seeds
 java.util.ArrayList getClusters()
          Returns an ArrayList of clusters
 Instances getInstances()
          Return the instances used for clustering
 int getNumClusters()
          Get the number of clusters.
 Clusterer getThisClusterer()
          We always want to implement SemiSupClusterer from a class extending Clusterer.
 double objectiveFunction()
          Returns objective function if it has one, else -1.
 void resetClusterer()
          Reset all values that have been learned
 void seedClusterer(java.util.HashMap seed_params)
          Seed the clusterer using specified seeding
 void setMetric(Metric m)
          Set the clusterer metric
 void setNumClusters(int n)
          Set the number of clusters.
 void setVerbose(boolean v)
          Sets verbose level
 void trainClusterer(Instances instances)
          Train the clusterer using provided training data
 

Method Detail

getThisClusterer

public Clusterer getThisClusterer()
We always want to implement SemiSupClusterer from a class extending Clusterer. We want to be able to return the underlying parent class.

Returns:
parent Clusterer class

setNumClusters

public void setNumClusters(int n)
Set the number of clusters.


getNumClusters

public int getNumClusters()
Get the number of clusters.


setVerbose

public void setVerbose(boolean v)
Sets verbose level


getClusters

public java.util.ArrayList getClusters()
                                throws java.lang.Exception
Returns an ArrayList of clusters

Throws:
java.lang.Exception

getInstances

public Instances getInstances()
                       throws java.lang.Exception
Return the instances used for clustering

Returns:
Instances used for clustering, or null
Throws:
java.lang.Exception

buildClusterer

public void buildClusterer(Instances data)
                    throws java.lang.Exception
Generates the clustering.

Parameters:
data - set of instances to cluster
Throws:
java.lang.Exception - if something is wrong

buildClusterer

public void buildClusterer(Instances labeledData,
                           Instances unlabeledData,
                           int classIndex,
                           int numClusters,
                           int startingIndexOfTest)
                    throws java.lang.Exception
Generates the clustering using labeled seeds

Parameters:
labeledData - set of labeled instances to use as seeds
unlabeledData - set of unlabeled instances
classIndex - attribute index in labeledData which holds class info
numClusters - number of clusters to create
startingIndexOfTest - from where test data starts in unlabeledData, useful if clustering is transductive, set to -1 if not relevant
Throws:
java.lang.Exception - if something is wrong

trainClusterer

public void trainClusterer(Instances instances)
                    throws java.lang.Exception
Train the clusterer using provided training data

Throws:
java.lang.Exception

seedClusterer

public void seedClusterer(java.util.HashMap seed_params)
                   throws java.lang.Exception
Seed the clusterer using specified seeding

Parameters:
seed_params - HashMap of seeding parameters
Throws:
java.lang.Exception

resetClusterer

public void resetClusterer()
                    throws java.lang.Exception
Reset all values that have been learned

Throws:
java.lang.Exception

setMetric

public void setMetric(Metric m)
               throws java.lang.Exception
Set the clusterer metric

Throws:
java.lang.Exception

objectiveFunction

public double objectiveFunction()
Returns objective function if it has one, else -1. Needed for SemiSupClustererEvaluation.