Skip to content

Commit

Permalink
remove get_strategy_type since we hope there would be no use of it.
Browse files Browse the repository at this point in the history
  • Loading branch information
pluskid committed Apr 28, 2012
1 parent 4574712 commit b4fbbdb
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 36 deletions.
8 changes: 1 addition & 7 deletions src/shogun/multiclass/MulticlassOneVsOneStrategy.h
Expand Up @@ -12,7 +12,7 @@

namespace shogun
{

class CMulticlassOneVsOneStrategy: public CMulticlassStrategy
{
public:
Expand Down Expand Up @@ -47,12 +47,6 @@ class CMulticlassOneVsOneStrategy: public CMulticlassStrategy
return num_classes*(num_classes-1)/2;
}

/** get strategy type */
virtual EMulticlassStrategy get_strategy_type()
{
return ONE_VS_ONE_STRATEGY;
}

/** get name */
virtual const char* get_name() const
{
Expand Down
8 changes: 1 addition & 7 deletions src/shogun/multiclass/MulticlassOneVsRestStrategy.h
Expand Up @@ -58,7 +58,7 @@ class CMulticlassOneVsRestStrategy: public CMulticlassStrategy

/** prepare for the next training phase.
* @return NULL, since no subset is needed in one-vs-rest strategy
*/
*/
virtual SGVector<int32_t> train_prepare_next();

/** decide the final label.
Expand All @@ -75,12 +75,6 @@ class CMulticlassOneVsRestStrategy: public CMulticlassStrategy
return num_classes;
}

/** get strategy type */
virtual EMulticlassStrategy get_strategy_type()
{
return ONE_VS_REST_STRATEGY;
}

/** get name */
virtual const char* get_name() const
{
Expand Down
11 changes: 0 additions & 11 deletions src/shogun/multiclass/MulticlassSVM.cpp
Expand Up @@ -127,16 +127,6 @@ bool CMulticlassSVM::load(FILE* modelfl)
line_number++;
}

int_buffer=0;
if (fscanf(modelfl," multiclass_strategy=%d; \n", &int_buffer) != 1)
SG_ERROR( "error in svm file, line nr:%d\n", line_number);

if (!feof(modelfl))
line_number++;

if (int_buffer != m_multiclass_strategy->get_strategy_type())
SG_ERROR("multiclass strategy does not match %ld vs. %ld\n", int_buffer, m_multiclass_strategy->get_strategy_type());

int_buffer=0;
if (fscanf(modelfl," num_classes=%d; \n", &int_buffer) != 1)
SG_ERROR( "error in svm file, line nr:%d\n", line_number);
Expand Down Expand Up @@ -275,7 +265,6 @@ bool CMulticlassSVM::save(FILE* modelfl)

SG_INFO( "Writing model file...");
fprintf(modelfl,"%%MultiClassSVM\n");
fprintf(modelfl,"multiclass_strategy=%d;\n", m_multiclass_strategy->get_strategy_type());
fprintf(modelfl,"num_classes=%d;\n", m_labels->get_num_classes());
fprintf(modelfl,"num_svms=%d;\n", m_machines->get_num_elements());
fprintf(modelfl,"kernel='%s';\n", m_kernel->get_name());
Expand Down
11 changes: 0 additions & 11 deletions src/shogun/multiclass/MulticlassStrategy.h
Expand Up @@ -18,14 +18,6 @@
namespace shogun
{

#ifndef DOXYGEN_SHOULD_SKIP_THIS
enum EMulticlassStrategy
{
ONE_VS_REST_STRATEGY,
ONE_VS_ONE_STRATEGY,
};
#endif

class CMulticlassStrategy: public CSGObject
{
public:
Expand All @@ -41,9 +33,6 @@ class CMulticlassStrategy: public CSGObject
return "MulticlassStrategy";
};

/** get strategy type */
virtual EMulticlassStrategy get_strategy_type()=0;

/** start training */
virtual void train_start(CLabels *orig_labels, CLabels *train_labels);

Expand Down

0 comments on commit b4fbbdb

Please sign in to comment.