FairRoot/PandaRoot
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PndMvaCluster Class Reference

#include <PndMvaCluster.h>

Public Member Functions

 PndMvaCluster (DataPoints const &InputData, size_t nCluster)
 
 PndMvaCluster (DataPoints const &InputData, size_t nCluster, bool const prune, bool const forceLabels)
 
virtual ~PndMvaCluster ()
 
virtual DataPointsCluster (ClusteringType const ClType=KMEANS_HARD)
 
virtual DataPointsClusterAndLabel (ClusteringType const ClType, std::vector< std::string > const &labels)
 
size_t GetNumberOfClusters () const
 
size_t GetClusterDimension () const
 
void SetNumberOfClusters (size_t val)
 
void Setprune (bool const prune=false)
 
void SetForceToLabel (bool const forceLabel=false)
 

Private Member Functions

 PndMvaCluster (const PndMvaCluster &other)
 To avoid mistakes. More...
 
PndMvaClusteroperator= (const PndMvaCluster &other)
 
DataPointsK_Means ()
 
void InitCentroids ()
 
void InitialPartition ()
 
void ComputeCentroids ()
 
void ResetCenteroids ()
 
void ClearStructures ()
 
void ReInitEmptyCenter (size_t centerIdx)
 

Private Attributes

size_t m_num_Cluster
 
DataPoints m_PointSet
 number of cluster centers. More...
 
size_t m_dimension
 input data points. More...
 
DataPoints m_Centroids
 Data points dimension. More...
 
std::vector< size_t > m_PointsToClusters
 
std::vector< std::set< size_t > * > m_ClustersToPoints
 
bool m_prune
 
bool m_forceToLabel
 

Detailed Description

Definition at line 33 of file PndMvaCluster.h.

Constructor & Destructor Documentation

PndMvaCluster::PndMvaCluster ( DataPoints const &  InputData,
size_t  nCluster 
)
explicit

Constructor.

Parameters
InputDataInput Data points.
nClusterNumber of clusters to be created.
PndMvaCluster::PndMvaCluster ( DataPoints const &  InputData,
size_t  nCluster,
bool const  prune,
bool const  forceLabels 
)
explicit

Constructor.

Parameters
InputDataInput Data points.
nClusterNumber of clusters to be created.
prunePrune the created cluster.
forceLabelsForce to label the undecided and unknown points.
virtual PndMvaCluster::~PndMvaCluster ( )
virtual

Destructor.

PndMvaCluster::PndMvaCluster ( const PndMvaCluster other)
private

To avoid mistakes.

Member Function Documentation

void PndMvaCluster::ClearStructures ( )
private
virtual DataPoints* PndMvaCluster::Cluster ( ClusteringType const  ClType = KMEANS_HARD)
virtual

Compute Cluster centers for the current input data.

Parameters
ClTypeClustering algorithm.
Returns
Vector containing the cluster centroids.
virtual DataPoints* PndMvaCluster::ClusterAndLabel ( ClusteringType const  ClType,
std::vector< std::string > const &  labels 
)
virtual

Compute Cluster centers for the current input data. The label of the majority of their members determines the label of the center.

Parameters
ClTypeClustering algorithm (default is KMEANS_HARD).
labelsThe labes of the currently available classes.
Returns
Vector containing the cluster centroids.
void PndMvaCluster::ComputeCentroids ( )
private
size_t PndMvaCluster::GetClusterDimension ( ) const
inline

Get the dimension of the input data points.

Returns
Dimension of the data points.

Definition at line 174 of file PndMvaCluster.h.

References m_dimension.

175 {
176  return m_dimension;
177 };
size_t m_dimension
input data points.
size_t PndMvaCluster::GetNumberOfClusters ( ) const
inline

Get the number of cluster centeroids.

Returns
Number of cluster centeroids.

Definition at line 169 of file PndMvaCluster.h.

References m_num_Cluster.

170 {
171  return m_num_Cluster;
172 };
size_t m_num_Cluster
void PndMvaCluster::InitCentroids ( )
private
void PndMvaCluster::InitialPartition ( )
private
DataPoints* PndMvaCluster::K_Means ( )
private
PndMvaCluster& PndMvaCluster::operator= ( const PndMvaCluster other)
private
void PndMvaCluster::ReInitEmptyCenter ( size_t  centerIdx)
private
void PndMvaCluster::ResetCenteroids ( )
private
void PndMvaCluster::SetForceToLabel ( bool const  forceLabel = false)
inline

The centroids that do not have a label (unknown, undecided) will get the label of the nearest data point from the input data set.

Parameters
forceLabelForce the labeling even if the determined label is unknown or undecided.

Definition at line 188 of file PndMvaCluster.h.

References m_forceToLabel.

189 {
190  m_forceToLabel = label;
191 };
void PndMvaCluster::SetNumberOfClusters ( size_t  val)
inline

Set the number of centroids.

Parameters
valNumber of centeroids.

Definition at line 179 of file PndMvaCluster.h.

References m_num_Cluster, and val.

180 {
181  m_num_Cluster = val;
182 };
Double_t val[nBoxes][nFEBox]
Definition: createCalib.C:11
size_t m_num_Cluster
void PndMvaCluster::Setprune ( bool const  prune = false)
inline

Set if the created cluster list needs to be pruned. Remove the unknown and undecided labels.

Parameters
pruneIf prune after clustering.

Definition at line 184 of file PndMvaCluster.h.

References m_prune.

185 {
186  m_prune = prune;
187 };

Member Data Documentation

DataPoints PndMvaCluster::m_Centroids
private

Data points dimension.

Definition at line 155 of file PndMvaCluster.h.

std::vector< std::set<size_t>* > PndMvaCluster::m_ClustersToPoints
private

Definition at line 161 of file PndMvaCluster.h.

size_t PndMvaCluster::m_dimension
private

input data points.

Definition at line 152 of file PndMvaCluster.h.

Referenced by GetClusterDimension().

bool PndMvaCluster::m_forceToLabel
private

Definition at line 164 of file PndMvaCluster.h.

Referenced by SetForceToLabel().

size_t PndMvaCluster::m_num_Cluster
private

Definition at line 150 of file PndMvaCluster.h.

Referenced by GetNumberOfClusters(), and SetNumberOfClusters().

DataPoints PndMvaCluster::m_PointSet
private

number of cluster centers.

Definition at line 151 of file PndMvaCluster.h.

std::vector<size_t> PndMvaCluster::m_PointsToClusters
private

Definition at line 158 of file PndMvaCluster.h.

bool PndMvaCluster::m_prune
private

Definition at line 163 of file PndMvaCluster.h.

Referenced by Setprune().


The documentation for this class was generated from the following file: