silhouette_score.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_CORE_CV_METRICS_SILHOUETTE_SCORE_HPP
13 #define MLPACK_CORE_CV_METRICS_SILHOUETTE_SCORE_HPP
14 
15 #include <mlpack/core.hpp>
16 
17 namespace mlpack {
18 namespace cv {
19 
41 {
42  public:
51  template<typename DataType, typename Metric>
52  static double Overall(const DataType& X,
53  const arma::Row<size_t>& labels,
54  const Metric& metric);
55 
63  template<typename DataType>
64  static arma::rowvec SamplesScore(const DataType& distances,
65  const arma::Row<size_t>& labels);
66 
76  template<typename DataType, typename Metric>
77  static arma::rowvec SamplesScore(const DataType& X,
78  const arma::Row<size_t>& labels,
79  const Metric& metric);
80 
90  static double MeanDistanceFromCluster(const arma::colvec& distances,
91  const arma::Row<size_t>& labels,
92  const size_t& label,
93  const bool& sameCluster = false);
94 
99  static const bool NeedsMinimization = false;
100 };
101 
102 } // namespace cv
103 } // namespace mlpack
104 
105 // Include implementation.
106 #include "silhouette_score_impl.hpp"
107 
108 #endif
static const bool NeedsMinimization
Information for hyper-parameter tuning code.
Linear algebra utility functions, generally performed on matrices or vectors.
static double Overall(const DataType &X, const arma::Row< size_t > &labels, const Metric &metric)
Find the overall silhouette score.
static arma::rowvec SamplesScore(const DataType &distances, const arma::Row< size_t > &labels)
Find the individual silhouette scores for precomputted dissimilarites.
Include all of the base components required to write mlpack methods, and the main mlpack Doxygen docu...
static double MeanDistanceFromCluster(const arma::colvec &distances, const arma::Row< size_t > &labels, const size_t &label, const bool &sameCluster=false)
Find mean distance of element from a given cluster.
The Silhouette Score is a metric of performance for clustering that represents the quality of cluster...