SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 #define IGNORE_IN_CLASSLIST
14 
15 #include <stdlib.h>
16 #include <shogun/lib/SGMatrix.h>
17 #include <shogun/lib/SGVector.h>
18 
19 namespace shogun
20 {
21 
22 #ifndef DOXYGEN_SHOULD_SKIP_THIS
23 IGNORE_IN_CLASSLIST enum malsar_loss
24 {
25  MALSAR_LOGISTIC,
26  MALSAR_LEAST_SQUARES
27 };
28 
29 IGNORE_IN_CLASSLIST struct malsar_options
30 {
31  int termination;
32  double tolerance;
33  int max_iter;
34  int n_tasks;
35  int n_clusters;
36  SGVector<int>* tasks_indices;
37  malsar_loss loss;
38 
39  static malsar_options default_options()
40  {
41  malsar_options opts;
42  opts.termination = 2;
43  opts.tolerance = 1e-3;
44  opts.max_iter = 1000;
45  opts.tasks_indices = NULL;
46  opts.n_clusters = 2;
47  opts.loss = MALSAR_LOGISTIC;
48  return opts;
49  }
50 };
51 
52 IGNORE_IN_CLASSLIST struct malsar_result_t
53 {
54  SGMatrix<double> w;
55  SGVector<double> c;
56 
57  malsar_result_t(SGMatrix<double> w_, SGVector<double> c_)
58  {
59  w = w_;
60  c = c_;
61  }
62 };
63 #endif
64 }
65 #endif /* ----- #ifndef MALSAR_OPTIONS_H_ ----- */

SHOGUN Machine Learning Toolbox - Documentation