Utility functions for k-means clustering.
More...
Functions |
template<class __data_value_type , class __memory_space_type , class __memory_layout_type > |
void | cuv::libs::kmeans::compute_clusters (cuv::tensor< __data_value_type, __memory_space_type, __memory_layout_type > &clusters, const cuv::tensor< __data_value_type, __memory_space_type, __memory_layout_type > &data, const cuv::tensor< typename cuv::tensor< __data_value_type, __memory_space_type, __memory_layout_type >::index_type, __memory_space_type > &indices) |
| Compute the new cluster centers in one step.
|
template<class __data_value_type , class __memory_space_type , class __memory_layout_type > |
void | cuv::libs::kmeans::sort_by_index (cuv::tensor< __data_value_type, __memory_space_type, __memory_layout_type > &res, cuv::tensor< typename cuv::tensor< __data_value_type, __memory_space_type, __memory_layout_type >::index_type, __memory_space_type > &indices, const cuv::tensor< __data_value_type, __memory_space_type, __memory_layout_type > &data) |
| Sort the dataset according to the indices.
|
Detailed Description
Utility functions for k-means clustering.
Function Documentation
template<class __data_value_type , class __memory_space_type , class __memory_layout_type >
void cuv::libs::kmeans::compute_clusters |
( |
cuv::tensor< __data_value_type, __memory_space_type, __memory_layout_type > & |
clusters, |
|
|
const cuv::tensor< __data_value_type, __memory_space_type, __memory_layout_type > & |
data, |
|
|
const cuv::tensor< typename cuv::tensor< __data_value_type, __memory_space_type, __memory_layout_type >::index_type, __memory_space_type > & |
indices |
|
) |
| |
Compute the new cluster centers in one step.
- Parameters
-
clusters | the means to be updated |
data | the data of from which the means are computed |
indices | for every datapoint the index of the closest mean |
template<class __data_value_type , class __memory_space_type , class __memory_layout_type >
void cuv::libs::kmeans::sort_by_index |
( |
cuv::tensor< __data_value_type, __memory_space_type, __memory_layout_type > & |
res, |
|
|
cuv::tensor< typename cuv::tensor< __data_value_type, __memory_space_type, __memory_layout_type >::index_type, __memory_space_type > & |
indices, |
|
|
const cuv::tensor< __data_value_type, __memory_space_type, __memory_layout_type > & |
data |
|
) |
| |
Sort the dataset according to the indices.
- Parameters
-
res | space for the sorted data |
data | the data which is to be sorted |
indices | for every datapoint the index of the closest mean |