@PublicationReference(author="Michael I. Jordan",title="Dirichlet Processes, Chinese Restaurant Processes and All That",type=Conference,publication="NIPS",year=2005,url="http://www.cs.berkeley.edu/~jordan/nips-tutorial05.ps") @PublicationReference(author="Radform M. Neal",title="Markov Chain Sampling Methods for Dirichlet Process Mixture Models",type=Journal,year=2000,publication="Journal of Computational and Graphical Statistics, Vol. 9, No. 2",pages={249,265},notes="Based in part on Algorithm 2 from Neal") @PublicationReference(author={"Michael D. Escobar","Mike West"},title="Bayesian Density Estimation and Inference Using Mixtures",type=Journal,publication="Journal of the American Statistical Association",year=1995) public class DirichletProcessClustering extends AnytimeAlgorithmWrapper<java.util.Collection<GaussianCluster>,DirichletProcessMixtureModel<Vector>> implements BatchClusterer<Vector,GaussianCluster>, AnytimeBatchLearner<java.util.Collection<? extends Vector>,java.util.Collection<GaussianCluster>>, Randomized, MeasurablePerformanceAlgorithm
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_DIMENSIONALITY
Default dimensionality, 2.
|
static int |
DEFAULT_SAMPLES
Default number of samples, 1000.
|
static java.lang.String |
PERFORMANCE_DESCRIPTION
Description of the performance value returned, "Number of Clusters".
|
DEFAULT_ITERATION, iteration
Constructor and Description |
---|
DirichletProcessClustering()
Creates a new instance of DirichletProcessClustering
|
DirichletProcessClustering(DirichletProcessMixtureModel<Vector> algorithm)
Creates a new instance of DirichletProcessClustering
|
DirichletProcessClustering(int dimensionality)
Creates a new instance of DirichletProcessClustering
|
Modifier and Type | Method and Description |
---|---|
DirichletProcessClustering |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
java.util.Collection<? extends Vector> |
getData()
Gets the data to use for learning.
|
boolean |
getKeepGoing()
Gets the keep going value, which indicates if the algorithm should
continue on to another step.
|
NamedValue<java.lang.Integer> |
getPerformance()
Gets the name-value pair that describes the current performance of the
algorithm.
|
java.util.Random |
getRandom()
Gets the random number generator used by this object.
|
java.util.ArrayList<GaussianCluster> |
getResult()
Gets the current result of the algorithm.
|
java.util.ArrayList<GaussianCluster> |
learn(java.util.Collection<? extends Vector> data)
The
learn method creates an object of ResultType using
data of type DataType , using some form of "learning" algorithm. |
void |
setRandom(java.util.Random random)
Sets the random number generator used by this object.
|
algorithmEnded, algorithmStarted, getAlgorithm, getIteration, getMaxIterations, isResultValid, readResolve, setAlgorithm, setMaxIterations, stepEnded, stepStarted, stop
addIterativeAlgorithmListener, fireAlgorithmEnded, fireAlgorithmStarted, fireStepEnded, fireStepStarted, getListeners, removeIterativeAlgorithmListener, setIteration, setListeners
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMaxIterations, setMaxIterations
addIterativeAlgorithmListener, getIteration, removeIterativeAlgorithmListener
isResultValid, stop
public static final java.lang.String PERFORMANCE_DESCRIPTION
public static final int DEFAULT_DIMENSIONALITY
public static final int DEFAULT_SAMPLES
public DirichletProcessClustering()
public DirichletProcessClustering(int dimensionality)
dimensionality
- Dimensionality of the observationspublic DirichletProcessClustering(DirichletProcessMixtureModel<Vector> algorithm)
algorithm
- Dirichlet Process Mixture model that is being wrappedpublic DirichletProcessClustering clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.clone
in interface CloneableSerializable
clone
in class AnytimeAlgorithmWrapper<java.util.Collection<GaussianCluster>,DirichletProcessMixtureModel<Vector>>
public java.util.ArrayList<GaussianCluster> getResult()
AnytimeAlgorithm
getResult
in interface AnytimeAlgorithm<java.util.Collection<GaussianCluster>>
public java.util.ArrayList<GaussianCluster> learn(java.util.Collection<? extends Vector> data)
BatchLearner
learn
method creates an object of ResultType
using
data of type DataType
, using some form of "learning" algorithm.learn
in interface BatchLearner<java.util.Collection<? extends Vector>,java.util.Collection<GaussianCluster>>
data
- The data that the learning algorithm will use to create an
object of ResultType
.public java.util.Random getRandom()
Randomized
getRandom
in interface Randomized
public void setRandom(java.util.Random random)
Randomized
setRandom
in interface Randomized
random
- The random number generator for this object to use.public NamedValue<java.lang.Integer> getPerformance()
MeasurablePerformanceAlgorithm
getPerformance
in interface MeasurablePerformanceAlgorithm
public boolean getKeepGoing()
AnytimeBatchLearner
getKeepGoing
in interface AnytimeBatchLearner<java.util.Collection<? extends Vector>,java.util.Collection<GaussianCluster>>
public java.util.Collection<? extends Vector> getData()
AnytimeBatchLearner
getData
in interface AnytimeBatchLearner<java.util.Collection<? extends Vector>,java.util.Collection<GaussianCluster>>