Skip to content

Commit

Permalink
+ return problem type in more classifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
iglesias committed May 22, 2012
1 parent 09e6617 commit 13377dd
Show file tree
Hide file tree
Showing 27 changed files with 56 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/shogun/classifier/AveragedPerceptron.h
Expand Up @@ -30,6 +30,8 @@ namespace shogun
class CAveragedPerceptron : public CLinearMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_BINARY);

/** default constructor */
CAveragedPerceptron();

Expand Down
2 changes: 2 additions & 0 deletions src/shogun/classifier/LDA.h
Expand Up @@ -52,6 +52,8 @@ namespace shogun
class CLDA : public CLinearMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_BINARY);

/** constructor
*
* @param gamma gamma
Expand Down
2 changes: 2 additions & 0 deletions src/shogun/classifier/LPBoost.h
Expand Up @@ -48,6 +48,8 @@ namespace shogun
class CLPBoost : public CLinearMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_BINARY);

CLPBoost();
virtual ~CLPBoost();

Expand Down
2 changes: 2 additions & 0 deletions src/shogun/classifier/LPM.h
Expand Up @@ -43,6 +43,8 @@ namespace shogun
class CLPM : public CLinearMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_BINARY);

CLPM();
virtual ~CLPM();

Expand Down
2 changes: 2 additions & 0 deletions src/shogun/classifier/NearestCentroid.h
Expand Up @@ -33,6 +33,8 @@ class CDistanceMachine;
class CNearestCentroid : public CDistanceMachine{

public:
MACHINE_PROBLEM_TYPE(PT_MULTICLASS);

/**
* Default constructor
*/
Expand Down
2 changes: 2 additions & 0 deletions src/shogun/classifier/Perceptron.h
Expand Up @@ -30,6 +30,8 @@ namespace shogun
class CPerceptron : public CLinearMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_BINARY);

/** default constructor */
CPerceptron();

Expand Down
2 changes: 2 additions & 0 deletions src/shogun/classifier/PluginEstimate.h
Expand Up @@ -34,6 +34,8 @@ namespace shogun
class CPluginEstimate: public CMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_BINARY);

/** default constructor
* @param pos_pseudo pseudo for positive model
* @param neg_pseudo pseudo for negative model
Expand Down
2 changes: 2 additions & 0 deletions src/shogun/classifier/SubGradientLPM.h
Expand Up @@ -48,6 +48,8 @@ namespace shogun
class CSubGradientLPM : public CLinearMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_BINARY);

CSubGradientLPM();
CSubGradientLPM(
float64_t C, CDotFeatures* traindat,
Expand Down
2 changes: 2 additions & 0 deletions src/shogun/classifier/svm/LibLinear.h
Expand Up @@ -45,6 +45,8 @@ namespace shogun
class CLibLinear : public CLinearMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_BINARY);

/** default constructor */
CLibLinear();

Expand Down
2 changes: 2 additions & 0 deletions src/shogun/classifier/svm/NewtonSVM.h
Expand Up @@ -27,6 +27,8 @@ namespace shogun
class CNewtonSVM : public CLinearMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_BINARY);

/** default constructor */
CNewtonSVM();

Expand Down
2 changes: 2 additions & 0 deletions src/shogun/classifier/svm/OnlineLibLinear.h
Expand Up @@ -26,6 +26,8 @@ namespace shogun
class COnlineLibLinear : public COnlineLinearMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_BINARY);

/** Default constructor */
COnlineLibLinear();

Expand Down
2 changes: 2 additions & 0 deletions src/shogun/classifier/svm/OnlineSVMSGD.h
Expand Up @@ -33,6 +33,8 @@ namespace shogun
class COnlineSVMSGD : public COnlineLinearMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_BINARY);

/** default constructor */
COnlineSVMSGD();

Expand Down
2 changes: 2 additions & 0 deletions src/shogun/classifier/svm/SGDQN.h
Expand Up @@ -34,6 +34,8 @@ namespace shogun
class CSGDQN : public CLinearMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_BINARY);

/** default constructor */
CSGDQN();

Expand Down
2 changes: 2 additions & 0 deletions src/shogun/classifier/svm/SVM.h
Expand Up @@ -47,6 +47,8 @@ class CMulticlassSVM;
class CSVM : public CKernelMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_BINARY);

/** Create an empty Support Vector Machine Object
* @param num_sv with num_sv support vectors
*/
Expand Down
2 changes: 2 additions & 0 deletions src/shogun/classifier/svm/SVMLin.h
Expand Up @@ -22,6 +22,8 @@ namespace shogun
class CSVMLin : public CLinearMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_BINARY);

/** default constructor */
CSVMLin();

Expand Down
2 changes: 2 additions & 0 deletions src/shogun/classifier/svm/SVMOcas.h
Expand Up @@ -32,6 +32,8 @@ enum E_SVM_TYPE
class CSVMOcas : public CLinearMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_BINARY);

/** default constructor */
CSVMOcas();

Expand Down
2 changes: 2 additions & 0 deletions src/shogun/classifier/svm/SVMSGD.h
Expand Up @@ -34,6 +34,8 @@ namespace shogun
class CSVMSGD : public CLinearMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_BINARY);

/** default constructor */
CSVMSGD();

Expand Down
2 changes: 2 additions & 0 deletions src/shogun/classifier/svm/SubGradientSVM.h
Expand Up @@ -23,6 +23,8 @@ namespace shogun
class CSubGradientSVM : public CLinearMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_BINARY);

/** default constructor */
CSubGradientSVM();

Expand Down
2 changes: 2 additions & 0 deletions src/shogun/classifier/svm/WDSVMOcas.h
Expand Up @@ -26,6 +26,8 @@ template <class ST> class CStringFeatures;
class CWDSVMOcas : public CMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_BINARY);

/** default constructor */
CWDSVMOcas();

Expand Down
2 changes: 2 additions & 0 deletions src/shogun/classifier/vw/VowpalWabbit.h
Expand Up @@ -38,6 +38,8 @@ namespace shogun
class CVowpalWabbit: public COnlineLinearMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_BINARY);

/**
* Default constructor
*/
Expand Down
6 changes: 4 additions & 2 deletions src/shogun/machine/Machine.h
Expand Up @@ -99,7 +99,7 @@ enum EProblemType
PT_MULTICLASS = 2
};

#define MACHINE_PROBLEM_TYPE(PT) virtual EProblemType get_machine_problem_type() const { return PT; }
#define MACHINE_PROBLEM_TYPE(PT) inline virtual EProblemType get_machine_problem_type() const { return PT; }

/** @brief A generic learning machine interface.
*
Expand Down Expand Up @@ -246,8 +246,10 @@ class CMachine : public CSGObject
/** @return whether this machine is locked */
bool is_data_locked() const { return m_data_locked; }

virtual EProblemType get_machine_problem_type() const
//TODO change to pure virtual
inline virtual EProblemType get_machine_problem_type() const
{
SG_NOTIMPLEMENTED;
return PT_BINARY;
}

Expand Down
2 changes: 2 additions & 0 deletions src/shogun/multiclass/ConjugateIndex.h
Expand Up @@ -35,6 +35,8 @@ class CConjugateIndex : public CMachine
{

public:
MACHINE_PROBLEM_TYPE(PT_MULTICLASS)

/** default constructor
*
*/
Expand Down
2 changes: 2 additions & 0 deletions src/shogun/multiclass/GaussianNaiveBayes.h
Expand Up @@ -36,6 +36,8 @@ class CGaussianNaiveBayes : public CNativeMulticlassMachine
{

public:
MACHINE_PROBLEM_TYPE(PT_MULTICLASS)

/** default constructor
*
*/
Expand Down
2 changes: 2 additions & 0 deletions src/shogun/multiclass/KNN.h
Expand Up @@ -55,6 +55,8 @@ class CDistanceMachine;
class CKNN : public CDistanceMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_MULTICLASS)

/** default constructor */
CKNN();

Expand Down
2 changes: 2 additions & 0 deletions src/shogun/multiclass/MulticlassLibLinear.h
Expand Up @@ -37,6 +37,8 @@ namespace shogun
class CMulticlassLibLinear : public CLinearMulticlassMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_MULTICLASS)

/** default constructor */
CMulticlassLibLinear();

Expand Down
2 changes: 2 additions & 0 deletions src/shogun/multiclass/MulticlassOCAS.h
Expand Up @@ -23,6 +23,8 @@ namespace shogun
class CMulticlassOCAS : public CLinearMulticlassMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_MULTICLASS)

/** default constructor */
CMulticlassOCAS();

Expand Down
2 changes: 2 additions & 0 deletions src/shogun/multiclass/MulticlassSVM.h
Expand Up @@ -26,6 +26,8 @@ class CSVM;
class CMulticlassSVM : public CKernelMulticlassMachine
{
public:
MACHINE_PROBLEM_TYPE(PT_MULTICLASS);

/** default constructor */
CMulticlassSVM();

Expand Down

0 comments on commit 13377dd

Please sign in to comment.