jubatus_core  0.1.2
Jubatus: Online machine learning framework for distributed environment
clustering_method_factory.cpp
Go to the documentation of this file.
1 // Jubatus: Online machine learning framework for distributed environment
2 // Copyright (C) 2013 Preferred Networks and Nippon Telegraph and Telephone Corporation.
3 //
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License version 2.1 as published by the Free Software Foundation.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 
18 
19 #include <string>
20 #include "../common/exception.hpp"
22 #ifdef JUBATUS_USE_EIGEN
24 #endif
25 #include "clustering_config.hpp"
26 #include "clustering_method.hpp"
27 
28 using jubatus::util::lang::shared_ptr;
29 
30 namespace jubatus {
31 namespace core {
32 namespace clustering {
33 
34 shared_ptr<clustering_method> clustering_method_factory::create(
35  const std::string& method,
36  const clustering_config& config) {
37  if (method == "kmeans") {
38  return shared_ptr<clustering_method>(
39  new kmeans_clustering_method(config.k));
40 #ifdef JUBATUS_USE_EIGEN
41  } else if (method == "gmm") {
42  return shared_ptr<clustering_method>(
43  new gmm_clustering_method(config.k));
44 #endif
45  }
47 }
48 
49 } // namespace clustering
50 } // namespace core
51 } // namespace jubatus
#define JUBATUS_EXCEPTION(e)
Definition: exception.hpp:79
std::string method
static jubatus::util::lang::shared_ptr< clustering_method > create(const std::string &method, const clustering_config &config)