Skip to content

Commit

Permalink
Guarded new L1/L2 logistic regression in for eigen3
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Jul 15, 2012
1 parent 629358d commit 7ecdf44
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/shogun/lib/slep/malsar_joint_feature_learning.cpp
Expand Up @@ -9,6 +9,7 @@
*/

#include <shogun/lib/slep/malsar_joint_feature_learning.h>
#ifdef HAVE_EIGEN3
#include <shogun/mathematics/Math.h>
#include <iostream>

Expand Down Expand Up @@ -213,3 +214,4 @@ slep_result_t malsar_joint_feature_learning(
return slep_result_t(tasks_w, tasks_c);
};
};
#endif
3 changes: 3 additions & 0 deletions src/shogun/lib/slep/malsar_joint_feature_learning.h
Expand Up @@ -10,6 +10,8 @@

#ifndef MALSAR_JOINT_FEATURE_LEARNING_H_
#define MALSAR_JOINT_FEATURE_LEARNING_H_
#include <shogun/lib/config.h>
#ifdef HAVE_EIGEN3
#include <shogun/lib/slep/slep_options.h>
#include <shogun/features/DotFeatures.h>

Expand All @@ -24,5 +26,6 @@ slep_result_t malsar_joint_feature_learning(
const slep_options& options);

};
#endif
#endif /* ----- #ifndef MALSAR_JOINT_FEATURE_LEARNING_H_ ----- */

Expand Up @@ -64,8 +64,10 @@ bool CMultitaskL1L2LogisticRegression::train_machine(CFeatures* data)
options.ind = ind.vector;
options.n_tasks = ind.vlen-1;

#ifdef HAVE_EIGEN3
slep_result_t model = malsar_joint_feature_learning(
features, y.vector, m_rho1, m_rho2, options);
#endif

m_tasks_w = model.w;
m_tasks_c = model.c;
Expand Down

0 comments on commit 7ecdf44

Please sign in to comment.