IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Classes | Namespaces | Functions
ClusteringUtils.h File Reference

Utility functions for clustering management. More...

#include <IPSDKMath/IPSDKMathExports.h>
#include <IPSDKMath/Clustering/ClusteringTypes.h>
#include <iostream>

Go to the source code of this file.

Classes

class  ipsdk::math::clustering::KernelKMeansCentroid< KernelType >
 

Namespaces

 ipsdk
 Main namespace for IPSDK library.
 
 ipsdk::math
 Namespace agregating IPSDK mathematical routines and classes.
 

Functions

IPSDKMATH_API ipReal64 ipsdk::math::clustering::computeCompactness (const VectorColl &clustersCentersColl, const VectorColl &dataColl, const UInt32Vector &indexColl)
 function allowing to compute compactness associated to a clustering result More...
 
template<typename KernelType >
IPSDKMATH_API ipReal64 ipsdk::math::clustering::computeKernelCompactness (const std::vector< KernelKMeansCentroid< KernelType > > &clustersCentroids, const VectorColl &dataColl, const UInt32Vector &indexColl)
 function allowing to compute compactness associated to a Kernel clustering result More...
 
IPSDKMATH_API ipReal64 ipsdk::math::clustering::computeValidityIndex (const VectorColl &clustersCentersColl, const VectorColl &dataColl, const UInt32Vector &indexColl, const eValidityIndexType &validityIndexType)
 function allowing to compute a validity index of a clustering More...
 
IPSDKMATH_API void ipsdk::math::clustering::generateKMeansPPInit (const ipUInt32 nbClusters, const VectorColl &inputDataColl, VectorColl &initClustersCenters)
 function allowing to generate an initial solution for K-Means algorithm using K-Means++ approach More...
 
template<typename KernelType >
IPSDKMATH_API void ipsdk::math::clustering::generateKernelKMeansPPInit (const KernelType &kernel, const ipUInt32 nbClusters, const VectorColl &inputDataColl, VectorColl &initClustersCenters)
 function allowing to generate an initial solution for Kernel K-Means algorithm using K-Means++ approach More...
 
IPSDKMATH_API ipUInt32 ipsdk::math::clustering::computeAssignment (const VectorColl &clustersCentersColl, const Vector &data)
 function allowing to compute cluster assignment using an euclidian distance to clusters centers More...
 
IPSDKMATH_API ipUInt32 ipsdk::math::clustering::computeKMeansAttempt (const VectorColl &inputDataColl, const ipUInt32 nbMaxIteration, VectorColl &inOutClustersCenters, UInt32Vector &assignments)
 function allowing to compute a kmeans attempt from an initial solution More...
 
template<typename KernelType >
IPSDKMATH_API ipUInt32 ipsdk::math::clustering::computeKernelAssignment (const std::vector< KernelKMeansCentroid< KernelType > > &clustersCentroids, const Vector &data)
 function allowing to compute cluster assignment using an kernel distance to clusters centroids More...
 
template<typename KernelType >
IPSDKMATH_API ipUInt32 ipsdk::math::clustering::computeKernelKMeansAttempt (const KernelType &kernel, const VectorColl &inputDataColl, const ipUInt32 nbMaxIteration, const ipReal64 minChangeRatio, std::vector< KernelKMeansCentroid< KernelType > > &inOutClustersCentroids, UInt32Vector &assignments)
 function allowing to compute a kernel kmeans attempt from an initial solution More...
 
IPSDKMATH_API void ipsdk::math::clustering::computeClustersCenters (const ipUInt32 nbClusters, const VectorColl &inputDataColl, const UInt32Vector &indexColl, VectorColl &clustersCentersColl)
 function allowing to compute clusters centers given data assignments using mean computation More...
 
IPSDKMATH_API ipUInt32 ipsdk::math::clustering::computeClusterPopulation (const ipUInt32 clusterIdx, const UInt32Vector &indexColl)
 function allowing to compute population associated to a given cluster More...
 
IPSDKMATH_API Vector ipsdk::math::clustering::computeClusterCenter (const ipUInt32 clusterIdx, const VectorColl &inputDataColl, const UInt32Vector &indexColl)
 function allowing to compute center associated to a given cluster More...
 
IPSDKMATH_API ipReal64 ipsdk::math::clustering::computeClusterStdDev (const ipUInt32 clusterIdx, const VectorColl &inputDataColl, const UInt32Vector &indexColl, const Vector &clusterCenter)
 function allowing to compute standard deviation associated to a given cluster More...
 
IPSDKMATH_API ipReal64 ipsdk::math::clustering::radialBasisKernelSigmaFromDynamic (const VectorColl &inputDataColl, const ipReal64 ratio=0.2)
 function allowing to compute a sigma value used for radial basis kernel computations based on input data dynamic. This function computes sum of ranges over all inputDataColl dimensions and multiply this value by input ratio value
 
IPSDKMATH_API std::ostream & ipsdk::math::clustering::operator<< (std::ostream &os, const KMeansClustering &clustering)
 operator allowing to write KMeansClustering data to a stream
 
template<typename KernelType >
IPSDKMATH_API std::ostream & ipsdk::math::clustering::operator<< (std::ostream &os, const KernelKMeansClustering< KernelType > &clustering)
 operator allowing to write KernelKMeansClustering data to a stream
 
template<typename KernelType >
IPSDKMATH_API std::ostream & ipsdk::math::clustering::operator<< (std::ostream &os, const SpectralClustering< KernelType > &clustering)
 operator allowing to write SpectralClustering data to a stream
 

Detailed Description

Utility functions for clustering management.

Author
E.Noirfalise
Date
2018/07/26

Function Documentation

◆ computeCompactness()

IPSDKMATH_API ipReal64 ipsdk::math::clustering::computeCompactness ( const VectorColl clustersCentersColl,
const VectorColl dataColl,
const UInt32Vector indexColl 
)

function allowing to compute compactness associated to a clustering result

Warning
there is no check on input collections size and content

◆ computeKernelCompactness()

template<typename KernelType >
IPSDKMATH_API ipReal64 ipsdk::math::clustering::computeKernelCompactness ( const std::vector< KernelKMeansCentroid< KernelType > > &  clustersCentroids,
const VectorColl dataColl,
const UInt32Vector indexColl 
)

function allowing to compute compactness associated to a Kernel clustering result

Warning
there is no check on input collections size and content

◆ computeValidityIndex()

IPSDKMATH_API ipReal64 ipsdk::math::clustering::computeValidityIndex ( const VectorColl clustersCentersColl,
const VectorColl dataColl,
const UInt32Vector indexColl,
const eValidityIndexType validityIndexType 
)

function allowing to compute a validity index of a clustering

See also
Cluster Validity Measurement Techniques, Ferenc Kovács, Csaba Legány, Attila Babos, AIKED'06 Proceedings of the 5th WSEAS International Conference on Artificial Intelligence, Knowledge Engineering and Data Bases Pages 388-393
Warning
there is no check on input collections size and content

◆ generateKMeansPPInit()

IPSDKMATH_API void ipsdk::math::clustering::generateKMeansPPInit ( const ipUInt32  nbClusters,
const VectorColl inputDataColl,
VectorColl initClustersCenters 
)

function allowing to generate an initial solution for K-Means algorithm using K-Means++ approach

Warning
there is no check on data size consistency
Exceptions
ipsdk::math::IPSDKMathExceptionif nbClusters > inputDataColl.size()

◆ generateKernelKMeansPPInit()

template<typename KernelType >
IPSDKMATH_API void ipsdk::math::clustering::generateKernelKMeansPPInit ( const KernelType &  kernel,
const ipUInt32  nbClusters,
const VectorColl inputDataColl,
VectorColl initClustersCenters 
)

function allowing to generate an initial solution for Kernel K-Means algorithm using K-Means++ approach

Warning
there is no check on data size consistency
Exceptions
ipsdk::math::IPSDKMathExceptionif nbClusters > inputDataColl.size()

◆ computeAssignment()

IPSDKMATH_API ipUInt32 ipsdk::math::clustering::computeAssignment ( const VectorColl clustersCentersColl,
const Vector data 
)

function allowing to compute cluster assignment using an euclidian distance to clusters centers

Warning
there is no check on input collections size and content

◆ computeKMeansAttempt()

IPSDKMATH_API ipUInt32 ipsdk::math::clustering::computeKMeansAttempt ( const VectorColl inputDataColl,
const ipUInt32  nbMaxIteration,
VectorColl inOutClustersCenters,
UInt32Vector assignments 
)

function allowing to compute a kmeans attempt from an initial solution

Warning
there is no check on input collections size and content
Returns
number of proceeded iterations (nbMaxIteration stands for failure)

◆ computeKernelAssignment()

template<typename KernelType >
IPSDKMATH_API ipUInt32 ipsdk::math::clustering::computeKernelAssignment ( const std::vector< KernelKMeansCentroid< KernelType > > &  clustersCentroids,
const Vector data 
)

function allowing to compute cluster assignment using an kernel distance to clusters centroids

Warning
there is no check on input collections size and content

◆ computeKernelKMeansAttempt()

template<typename KernelType >
IPSDKMATH_API ipUInt32 ipsdk::math::clustering::computeKernelKMeansAttempt ( const KernelType &  kernel,
const VectorColl inputDataColl,
const ipUInt32  nbMaxIteration,
const ipReal64  minChangeRatio,
std::vector< KernelKMeansCentroid< KernelType > > &  inOutClustersCentroids,
UInt32Vector assignments 
)

function allowing to compute a kernel kmeans attempt from an initial solution

Warning
there is no check on input collections size and content
Returns
number of proceeded iterations (nbMaxIteration stands for failure)

◆ computeClustersCenters()

IPSDKMATH_API void ipsdk::math::clustering::computeClustersCenters ( const ipUInt32  nbClusters,
const VectorColl inputDataColl,
const UInt32Vector indexColl,
VectorColl clustersCentersColl 
)

function allowing to compute clusters centers given data assignments using mean computation

Warning
there is no check on input collections size and content

◆ computeClusterPopulation()

IPSDKMATH_API ipUInt32 ipsdk::math::clustering::computeClusterPopulation ( const ipUInt32  clusterIdx,
const UInt32Vector indexColl 
)

function allowing to compute population associated to a given cluster

Warning
there is no check on input collections size and content

◆ computeClusterCenter()

IPSDKMATH_API Vector ipsdk::math::clustering::computeClusterCenter ( const ipUInt32  clusterIdx,
const VectorColl inputDataColl,
const UInt32Vector indexColl 
)

function allowing to compute center associated to a given cluster

Warning
there is no check on input collections size and content

◆ computeClusterStdDev()

IPSDKMATH_API ipReal64 ipsdk::math::clustering::computeClusterStdDev ( const ipUInt32  clusterIdx,
const VectorColl inputDataColl,
const UInt32Vector indexColl,
const Vector clusterCenter 
)

function allowing to compute standard deviation associated to a given cluster

Warning
there is no check on input collections size and content