jubatus_core
0.1.2
Jubatus: Online machine learning framework for distributed environment
Main Page
Namespaces
Classes
Files
File List
File Members
jubatus
core
clustering
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
17
#include "
clustering_method_factory.hpp
"
18
19
#include <string>
20
#include "../common/exception.hpp"
21
#include "
kmeans_clustering_method.hpp
"
22
#ifdef JUBATUS_USE_EIGEN
23
#include "
gmm_clustering_method.hpp
"
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
}
46
throw
JUBATUS_EXCEPTION
(
core::common::unsupported_method
(method));
47
}
48
49
}
// namespace clustering
50
}
// namespace core
51
}
// namespace jubatus
clustering_method.hpp
jubatus
Definition:
anomaly_base.cpp:29
jubatus::core::clustering::gmm_clustering_method
Definition:
gmm_clustering_method.hpp:31
kmeans_clustering_method.hpp
JUBATUS_EXCEPTION
#define JUBATUS_EXCEPTION(e)
Definition:
exception.hpp:79
method
std::string method
Definition:
anomaly_factory.cpp:44
jubatus::core::clustering::clustering_config::k
int k
Definition:
clustering_config.hpp:41
jubatus::core::clustering::clustering_config
Definition:
clustering_config.hpp:29
clustering_config.hpp
jubatus::core::clustering::kmeans_clustering_method
Definition:
kmeans_clustering_method.hpp:27
gmm_clustering_method.hpp
clustering_method_factory.hpp
jubatus::core::common::unsupported_method
Definition:
exception.hpp:313
jubatus::core::clustering::clustering_method_factory::create
static jubatus::util::lang::shared_ptr< clustering_method > create(const std::string &method, const clustering_config &config)
Definition:
clustering_method_factory.cpp:34
Generated on Tue Apr 28 2015 13:23:02 for jubatus_core by
1.8.9.1