SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
malsar_options.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Copyright (C) 2012 Sergey Lisitsyn
8  */
9 
10 #ifndef MALSAR_OPTIONS_H_
11 #define MALSAR_OPTIONS_H_
12 
13 #include <shogun/lib/config.h>
14 #ifdef USE_GPL_SHOGUN
15 
16 #define IGNORE_IN_CLASSLIST
17 
18 #include <stdlib.h>
19 #include <shogun/lib/SGMatrix.h>
20 #include <shogun/lib/SGVector.h>
21 
22 namespace shogun
23 {
24 
25 #ifndef DOXYGEN_SHOULD_SKIP_THIS
26 IGNORE_IN_CLASSLIST enum malsar_loss
27 {
28  MALSAR_LOGISTIC,
29  MALSAR_LEAST_SQUARES
30 };
31 
32 IGNORE_IN_CLASSLIST struct malsar_options
33 {
34  int termination;
35  double tolerance;
36  int max_iter;
37  int n_tasks;
38  int n_clusters;
39  SGVector<int>* tasks_indices;
40  malsar_loss loss;
41 
42  static malsar_options default_options()
43  {
44  malsar_options opts;
45  opts.termination = 2;
46  opts.tolerance = 1e-3;
47  opts.max_iter = 1000;
48  opts.tasks_indices = NULL;
49  opts.n_clusters = 2;
50  opts.loss = MALSAR_LOGISTIC;
51  return opts;
52  }
53 };
54 
55 IGNORE_IN_CLASSLIST struct malsar_result_t
56 {
57  SGMatrix<double> w;
58  SGVector<double> c;
59 
60  malsar_result_t(SGMatrix<double> w_, SGVector<double> c_)
61  {
62  w = w_;
63  c = c_;
64  }
65 };
66 #endif
67 }
68 #endif //USE_GPL_SHOGUN
69 #endif /* ----- #ifndef MALSAR_OPTIONS_H_ ----- */
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
#define IGNORE_IN_CLASSLIST
Definition: CPLEXSVM.h:24

SHOGUN Machine Learning Toolbox - Documentation