Base class for clustering. More...
#include <shark/Models/Clustering/AbstractClustering.h>
Inheritance diagram for shark::AbstractClustering< InputT >:Public Types | |
| enum | Feature { HAS_SOFT_MEMBERSHIP = 1 } |
| typedef InputT | InputType |
| typedef unsigned int | OutputType |
| typedef Batch< InputType >::type | BatchInputType |
| typedef Batch< OutputType >::type | BatchOutputType |
| typedef TypedFlags< Feature > | Features |
| typedef TypedFeatureNotAvailableException< Feature > | FeatureNotAvailableException |
Public Types inherited from shark::IParameterizable< VectorType > | |
| typedef VectorType | ParameterVectorType |
Public Member Functions | |
| const Features & | features () const |
| virtual void | updateFeatures () |
| bool | hasSoftMembershipFunction () const |
| virtual std::size_t | numberOfClusters () const =0 |
| return the number of clusters | |
| virtual Shape | inputShape () const =0 |
| virtual unsigned int | hardMembership (InputType const &pattern) const |
| Compute best matching cluster. | |
| virtual BatchOutputType | hardMembership (BatchInputType const &patterns) const |
| Compute best matching cluster for a batch of inputs. | |
| virtual RealVector | softMembership (InputType const &pattern) const |
| Compute cluster membership function. | |
| virtual RealMatrix | softMembership (BatchInputType const &patterns) const |
| Compute cluster membership function. | |
| void | read (InArchive &archive) |
| empty default implementation of ISerializable::read | |
| void | write (OutArchive &archive) const |
| empty default implementation of ISerializable::write | |
Public Member Functions inherited from shark::INameable | |
| virtual | ~INameable () |
| virtual std::string | name () const |
| returns the name of the object | |
Public Member Functions inherited from shark::IParameterizable< VectorType > | |
| virtual | ~IParameterizable () |
| virtual ParameterVectorType | parameterVector () const |
| Return the parameter vector. | |
| virtual void | setParameterVector (ParameterVectorType const &newParameters) |
| Set the parameter vector. | |
| virtual std::size_t | numberOfParameters () const |
| Return the number of parameters. | |
Public Member Functions inherited from shark::ISerializable | |
| virtual | ~ISerializable () |
| Virtual d'tor. | |
| void | load (InArchive &archive, unsigned int version) |
| Versioned loading of components, calls read(...). | |
| void | save (OutArchive &archive, unsigned int version) const |
| Versioned storing of components, calls write(...). | |
| BOOST_SERIALIZATION_SPLIT_MEMBER () | |
Protected Attributes | |
| Features | m_features |
Base class for clustering.
Definition at line 97 of file AbstractClustering.h.
| typedef Batch<InputType>::type shark::AbstractClustering< InputT >::BatchInputType |
Definition at line 102 of file AbstractClustering.h.
| typedef Batch<OutputType>::type shark::AbstractClustering< InputT >::BatchOutputType |
Definition at line 103 of file AbstractClustering.h.
| typedef TypedFeatureNotAvailableException<Feature> shark::AbstractClustering< InputT >::FeatureNotAvailableException |
Definition at line 108 of file AbstractClustering.h.
| typedef TypedFlags<Feature> shark::AbstractClustering< InputT >::Features |
Definition at line 108 of file AbstractClustering.h.
| typedef InputT shark::AbstractClustering< InputT >::InputType |
Definition at line 100 of file AbstractClustering.h.
| typedef unsigned int shark::AbstractClustering< InputT >::OutputType |
Definition at line 101 of file AbstractClustering.h.
| enum shark::AbstractClustering::Feature |
| Enumerator | |
|---|---|
| HAS_SOFT_MEMBERSHIP | |
Definition at line 105 of file AbstractClustering.h.
|
inline |
Definition at line 108 of file AbstractClustering.h.
|
inlinevirtual |
Compute best matching cluster for a batch of inputs.
Reimplemented in shark::HierarchicalClustering< InputT >.
Definition at line 142 of file AbstractClustering.h.
References shark::batchSize(), SHARK_ASSERT, and shark::AbstractClustering< InputT >::softMembership().
|
inlinevirtual |
Compute best matching cluster.
Definition at line 129 of file AbstractClustering.h.
References shark::getBatchElement(), and shark::AbstractClustering< InputT >::hardMembership().
Referenced by shark::HardClusteringModel< InputT >::eval(), shark::HardClusteringModel< InputT >::eval(), and shark::AbstractClustering< InputT >::hardMembership().
|
inline |
Tests whether the clustering can compute a (soft) member ship function, describing the membership of a sample to the different clusters.
Definition at line 113 of file AbstractClustering.h.
References shark::AbstractClustering< InputT >::HAS_SOFT_MEMBERSHIP, and shark::AbstractClustering< InputT >::m_features.
Referenced by shark::SoftClusteringModel< InputT >::SoftClusteringModel().
|
pure virtual |
Implemented in shark::Centroids, and shark::HierarchicalClustering< InputT >.
Referenced by shark::HardClusteringModel< InputT >::inputShape(), and shark::SoftClusteringModel< InputT >::inputShape().
|
pure virtual |
return the number of clusters
Implemented in shark::Centroids, and shark::HierarchicalClustering< InputT >.
Referenced by shark::HardClusteringModel< InputT >::outputShape(), and shark::SoftClusteringModel< InputT >::outputShape().
|
inlinevirtual |
empty default implementation of ISerializable::read
Reimplemented from shark::ISerializable.
Reimplemented in shark::Centroids.
Definition at line 178 of file AbstractClustering.h.
|
inlinevirtual |
Compute cluster membership function.
Reimplemented in shark::Centroids.
Definition at line 173 of file AbstractClustering.h.
References shark::AbstractClustering< InputT >::HAS_SOFT_MEMBERSHIP, and SHARK_FEATURE_EXCEPTION.
|
inlinevirtual |
Compute cluster membership function.
Reimplemented in shark::Centroids.
Definition at line 162 of file AbstractClustering.h.
References shark::AbstractClustering< InputT >::softMembership().
Referenced by shark::SoftClusteringModel< InputT >::eval(), shark::SoftClusteringModel< InputT >::eval(), shark::AbstractClustering< InputT >::hardMembership(), and shark::AbstractClustering< InputT >::softMembership().
|
inlinevirtual |
Definition at line 108 of file AbstractClustering.h.
|
inlinevirtual |
empty default implementation of ISerializable::write
Reimplemented from shark::ISerializable.
Reimplemented in shark::Centroids.
Definition at line 181 of file AbstractClustering.h.
|
protected |
Definition at line 108 of file AbstractClustering.h.
Referenced by shark::AbstractClustering< InputT >::hasSoftMembershipFunction().