| 1 | diff -x .svn -urN trunk-orig/src/libshogun/classifier/boosting/WeakLearners/BaseLearner.h trunk/src/libshogun/classifier/boosting/WeakLearners/BaseLearner.h
|
|---|
| 2 | --- trunk-orig/src/libshogun/classifier/boosting/WeakLearners/BaseLearner.h 2011-01-27 15:48:40.000000000 +0100
|
|---|
| 3 | +++ trunk/src/libshogun/classifier/boosting/WeakLearners/BaseLearner.h 2011-01-26 15:14:54.000000000 +0100
|
|---|
| 4 | @@ -45,6 +45,7 @@
|
|---|
| 5 | #include <vector>
|
|---|
| 6 |
|
|---|
| 7 | #include "base/SGObject.h"
|
|---|
| 8 | +#include "base/class_list.h"
|
|---|
| 9 | #include "classifier/boosting/Utils/Args.h"
|
|---|
| 10 | #include "classifier/boosting/Utils/StreamTokenizer.h"
|
|---|
| 11 |
|
|---|
| 12 | @@ -87,7 +88,10 @@
|
|---|
| 13 | * \date 21/11/2005
|
|---|
| 14 | */
|
|---|
| 15 | bool hasLearner(const string& learnerName)
|
|---|
| 16 | - { return ( _learners.find(learnerName) != _learners.end() ); }
|
|---|
| 17 | + {
|
|---|
| 18 | + return new_sgserializable(learnerName.c_str(), PT_NOT_GENERIC) != NULL;
|
|---|
| 19 | + // return ( _learners.find(learnerName) != _learners.end() );
|
|---|
| 20 | + }
|
|---|
| 21 |
|
|---|
| 22 | /**
|
|---|
| 23 | * Return the allocated learner object.
|
|---|
| 24 | @@ -95,7 +99,10 @@
|
|---|
| 25 | * \date 21/11/2005
|
|---|
| 26 | */
|
|---|
| 27 | BaseLearner* getLearner(const string& learnerName)
|
|---|
| 28 | - { return _learners[learnerName]; }
|
|---|
| 29 | + {
|
|---|
| 30 | + return (BaseLearner*) (new_sgserializable(learnerName.c_str(), PT_NOT_GENERIC));
|
|---|
| 31 | + // return _learners[learnerName];
|
|---|
| 32 | + }
|
|---|
| 33 |
|
|---|
| 34 | /**
|
|---|
| 35 | * Return the list of the learners currently registered.
|
|---|
| 36 | diff -x .svn -urN trunk-orig/src/libshogun/classifier/boosting/WeakLearners/SingleStumpLearner.h trunk/src/libshogun/classifier/boosting/WeakLearners/SingleStumpLearner.h
|
|---|
| 37 | --- trunk-orig/src/libshogun/classifier/boosting/WeakLearners/SingleStumpLearner.h 2011-01-27 15:48:40.000000000 +0100
|
|---|
| 38 | +++ trunk/src/libshogun/classifier/boosting/WeakLearners/SingleStumpLearner.h 2011-01-27 10:02:18.000000000 +0100
|
|---|
| 39 | @@ -191,6 +191,12 @@
|
|---|
| 40 | float _threshold; //!< the single threshold of the decision stump
|
|---|
| 41 | };
|
|---|
| 42 |
|
|---|
| 43 | + class CSingleStumpLearner : public SingleStumpLearner {
|
|---|
| 44 | +
|
|---|
| 45 | + virtual BaseLearner* subCreate() { return new CSingleStumpLearner(); }
|
|---|
| 46 | +
|
|---|
| 47 | +};
|
|---|
| 48 | +
|
|---|
| 49 | //////////////////////////////////////////////////////////////////////////
|
|---|
| 50 |
|
|---|
| 51 | } // end of namespace shogun
|
|---|