SHOGUN
v2.0.0
|
00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Copyright (C) 2012 Sergey Lisitsyn 00008 */ 00009 00010 #ifndef MALSAR_OPTIONS_H_ 00011 #define MALSAR_OPTIONS_H_ 00012 00013 #define IGNORE_IN_CLASSLIST 00014 00015 #include <stdlib.h> 00016 #include <shogun/lib/SGMatrix.h> 00017 #include <shogun/lib/SGVector.h> 00018 00019 namespace shogun 00020 { 00021 00022 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00023 IGNORE_IN_CLASSLIST enum malsar_loss 00024 { 00025 MALSAR_LOGISTIC, 00026 MALSAR_LEAST_SQUARES 00027 }; 00028 00029 IGNORE_IN_CLASSLIST struct malsar_options 00030 { 00031 int termination; 00032 double tolerance; 00033 int max_iter; 00034 int n_tasks; 00035 int n_clusters; 00036 SGVector<int>* tasks_indices; 00037 malsar_loss loss; 00038 00039 static malsar_options default_options() 00040 { 00041 malsar_options opts; 00042 opts.termination = 2; 00043 opts.tolerance = 1e-3; 00044 opts.max_iter = 1000; 00045 opts.tasks_indices = NULL; 00046 opts.n_clusters = 2; 00047 opts.loss = MALSAR_LOGISTIC; 00048 return opts; 00049 } 00050 }; 00051 00052 IGNORE_IN_CLASSLIST struct malsar_result_t 00053 { 00054 SGMatrix<double> w; 00055 SGVector<double> c; 00056 00057 malsar_result_t(SGMatrix<double> w_, SGVector<double> c_) 00058 { 00059 w = w_; 00060 c = c_; 00061 } 00062 }; 00063 #endif 00064 } 00065 #endif /* ----- #ifndef MALSAR_OPTIONS_H_ ----- */