Skip to content

Commit

Permalink
Guard LDA in GUIClassifier against missing Eigen.
Browse files Browse the repository at this point in the history
  • Loading branch information
iglesias committed Jul 29, 2014
1 parent 9693295 commit b5a8538
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/shogun/ui/GUIClassifier.cpp
Expand Up @@ -279,13 +279,15 @@ bool CGUIClassifier::new_classifier(char* name, int32_t d, int32_t from_d)
((CLibLinear*) classifier)->set_epsilon(svm_epsilon);
((CLibLinear*) classifier)->set_bias_enabled(svm_use_bias);
}
#endif //HAVE_LAPACK
#ifdef HAVE_EIGEN
else if (strcmp(name,"LDA")==0)
{
SG_UNREF(classifier);
classifier= new CLDA();
SG_INFO("created LDA object\n")
}
#endif //HAVE_LAPACK
#endif //HAVE_EIGEN
#ifdef USE_CPLEX
else if (strcmp(name,"LPM")==0)
{
Expand Down Expand Up @@ -740,15 +742,15 @@ bool CGUIClassifier::train_linear(float64_t gamma)
((CPerceptron*) classifier)->set_max_iter(perceptron_maxiter);
}

#ifdef HAVE_LAPACK
#ifdef HAVE_EIGEN
if (ctype==CT_LDA)
{
if (trainfeatures->get_feature_type()!=F_DREAL ||
trainfeatures->get_feature_class()!=C_DENSE)
SG_ERROR("LDA requires train features of class SIMPLE type REAL.\n")
((CLDA*) classifier)->set_gamma(gamma);
}
#endif
#endif //HAVE_EIGEN

if (ctype==CT_SVMOCAS)
((CSVMOcas*) classifier)->set_C(svm_C1, svm_C2);
Expand Down

0 comments on commit b5a8538

Please sign in to comment.