jubatus_core  0.1.2
Jubatus: Online machine learning framework for distributed environment
Public Member Functions | Private Attributes | List of all members
jubatus::core::clustering::gmm_clustering_method Class Reference

#include <gmm_clustering_method.hpp>

Inheritance diagram for jubatus::core::clustering::gmm_clustering_method:
Inheritance graph
Collaboration diagram for jubatus::core::clustering::gmm_clustering_method:
Collaboration graph

Public Member Functions

void batch_update (wplist points)
 
wplist get_cluster (size_t cluster_id, const wplist &points) const
 
std::vector< wplistget_clusters (const wplist &points) const
 
std::vector< common::sfv_tget_k_center () const
 
common::sfv_t get_nearest_center (const common::sfv_t &point) const
 
int64_t get_nearest_center_index (const common::sfv_t &point) const
 
 gmm_clustering_method (size_t k)
 
void online_update (wplist points)
 
 ~gmm_clustering_method ()
 
- Public Member Functions inherited from jubatus::core::clustering::clustering_method
virtual ~clustering_method ()
 

Private Attributes

gmm gmm_
 
size_t k_
 
std::vector< common::sfv_tkcenters_
 
eigen_feature_mapper mapper_
 

Detailed Description

Definition at line 31 of file gmm_clustering_method.hpp.

Constructor & Destructor Documentation

jubatus::core::clustering::gmm_clustering_method::gmm_clustering_method ( size_t  k)
explicit
jubatus::core::clustering::gmm_clustering_method::~gmm_clustering_method ( )

Definition at line 34 of file gmm_clustering_method.cpp.

34  {
35 }

Member Function Documentation

void jubatus::core::clustering::gmm_clustering_method::batch_update ( wplist  points)
virtual

Implements jubatus::core::clustering::clustering_method.

Definition at line 37 of file gmm_clustering_method.cpp.

References jubatus::core::clustering::gmm::batch(), jubatus::core::clustering::eigen_feature_mapper::clear(), jubatus::core::clustering::eigen_feature_mapper::convert(), jubatus::core::clustering::gmm::get_centers(), jubatus::core::clustering::eigen_feature_mapper::get_dimension(), gmm_, gmm_clustering_method(), k_, kcenters_, mapper_, and jubatus::core::clustering::eigen_feature_mapper::revert().

37  {
38  if (points.empty()) {
39  *this = gmm_clustering_method(k_);
40  return;
41  }
42  mapper_.clear();
43  eigen_wsvec_list_t data = mapper_.convert(points, true);
44  gmm_.batch(data, mapper_.get_dimension(), k_);
46 }
void batch(const eigen_wsvec_list_t &data, int d, int k)
Definition: gmm.cpp:40
wplist revert(const eigen_wsvec_list_t &src) const
eigen_svec_list_t get_centers()
Definition: gmm.hpp:29
std::vector< eigen_wsvec_t > eigen_wsvec_list_t
Definition: gmm_types.hpp:42
eigen_wsvec_list_t convert(const wplist &src, bool update_map=true)

Here is the call graph for this function:

wplist jubatus::core::clustering::gmm_clustering_method::get_cluster ( size_t  cluster_id,
const wplist points 
) const
virtual

Implements jubatus::core::clustering::clustering_method.

Definition at line 65 of file gmm_clustering_method.cpp.

References get_clusters().

67  {
68  return get_clusters(points)[cluster_id];
69 }
std::vector< wplist > get_clusters(const wplist &points) const

Here is the call graph for this function:

std::vector< wplist > jubatus::core::clustering::gmm_clustering_method::get_clusters ( const wplist points) const
virtual

Implements jubatus::core::clustering::clustering_method.

Definition at line 71 of file gmm_clustering_method.cpp.

References get_nearest_center_index(), and k_.

Referenced by get_cluster().

72  {
73  std::vector<wplist> ret(k_);
74  for (wplist::const_iterator it = points.begin(); it != points.end(); ++it) {
75  int64_t c = get_nearest_center_index(it->data);
76  ret[c].push_back(*it);
77  }
78  return ret;
79 }
int64_t get_nearest_center_index(const common::sfv_t &point) const

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< common::sfv_t > jubatus::core::clustering::gmm_clustering_method::get_k_center ( ) const
virtual

Implements jubatus::core::clustering::clustering_method.

Definition at line 51 of file gmm_clustering_method.cpp.

References kcenters_.

51  {
52  return kcenters_;
53 }
common::sfv_t jubatus::core::clustering::gmm_clustering_method::get_nearest_center ( const common::sfv_t point) const
virtual
int64_t jubatus::core::clustering::gmm_clustering_method::get_nearest_center_index ( const common::sfv_t point) const
virtual

Implements jubatus::core::clustering::clustering_method.

Definition at line 55 of file gmm_clustering_method.cpp.

References jubatus::core::clustering::eigen_feature_mapper::convertc(), jubatus::core::clustering::gmm::get_nearest_center_index(), gmm_, and mapper_.

Referenced by get_clusters().

56  {
58 }
eigen_svec_t convertc(const common::sfv_t &src) const
int64_t get_nearest_center_index(const eigen_svec_t &p) const
Definition: gmm.cpp:95

Here is the call graph for this function:

Here is the caller graph for this function:

void jubatus::core::clustering::gmm_clustering_method::online_update ( wplist  points)
virtual

Implements jubatus::core::clustering::clustering_method.

Definition at line 48 of file gmm_clustering_method.cpp.

48  {
49 }

Member Data Documentation

gmm jubatus::core::clustering::gmm_clustering_method::gmm_
private
size_t jubatus::core::clustering::gmm_clustering_method::k_
private

Definition at line 45 of file gmm_clustering_method.hpp.

Referenced by batch_update(), and get_clusters().

std::vector<common::sfv_t> jubatus::core::clustering::gmm_clustering_method::kcenters_
private

Definition at line 46 of file gmm_clustering_method.hpp.

Referenced by batch_update(), and get_k_center().

eigen_feature_mapper jubatus::core::clustering::gmm_clustering_method::mapper_
private

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