24 #ifndef __BROWN_BOOST_MODEL_H__
25 #define __BROWN_BOOST_MODEL_H__
27 #include "algorithms/algorithm.h"
28 #include "data_management/data/homogen_numeric_table.h"
29 #include "algorithms/boosting/boosting_model.h"
30 #include "algorithms/classifier/classifier_model.h"
31 #include "algorithms/classifier/classifier_training_batch.h"
32 #include "algorithms/classifier/classifier_predict.h"
60 struct DAAL_EXPORT Parameter :
public boosting::Parameter
63 DAAL_DEPRECATED Parameter();
75 DAAL_DEPRECATED Parameter(services::SharedPtr<weak_learner::training::Batch> wlTrainForParameter,
76 services::SharedPtr<weak_learner::prediction::Batch> wlPredictForParameter,
77 double acc = 0.3,
size_t maxIter = 10,
double nrAcc = 1.0e-3,
size_t nrMaxIter = 100,
double dcThreshold = 1.0e-2);
79 double accuracyThreshold;
81 double newtonRaphsonAccuracyThreshold;
82 size_t newtonRaphsonMaxIterations;
83 double degenerateCasesThreshold;
85 DAAL_DEPRECATED services::Status check() const DAAL_C11_OVERRIDE;
97 class DAAL_EXPORT Model : public boosting::Model
100 DECLARE_MODEL(Model, classifier::Model)
109 template <
typename modelFPType>
110 DAAL_EXPORT DAAL_DEPRECATED Model(
size_t nFeatures, modelFPType dummy);
116 DAAL_DEPRECATED Model() : boosting::Model(), _alpha() { }
125 template<
typename modelFPType>
126 DAAL_EXPORT DAAL_DEPRECATED
static services::SharedPtr<Model> create(
size_t nFeatures, services::Status *stat = NULL);
128 DAAL_DEPRECATED_VIRTUAL
virtual ~Model() { }
136 DAAL_DEPRECATED data_management::NumericTablePtr getAlpha();
139 data_management::NumericTablePtr _alpha;
141 template<
typename Archive,
bool onDeserialize>
142 services::Status serialImpl(Archive *arch)
144 services::Status st = boosting::Model::serialImpl<Archive, onDeserialize>(arch);
147 arch->setSharedPtrObj(_alpha);
152 template <
typename modelFPType>
153 DAAL_EXPORT Model(
size_t nFeatures, modelFPType dummy, services::Status &st);
156 typedef services::SharedPtr<Model> ModelPtr;
176 struct DAAL_EXPORT Parameter :
public classifier::Parameter
191 Parameter(services::SharedPtr<classifier::training::Batch> wlTrainForParameter,
192 services::SharedPtr<classifier::prediction::Batch> wlPredictForParameter,
193 double acc = 0.3,
size_t maxIter = 10,
double nrAcc = 1.0e-3,
size_t nrMaxIter = 100,
double dcThreshold = 1.0e-2);
195 services::SharedPtr<classifier::training::Batch> weakLearnerTraining;
196 services::SharedPtr<classifier::prediction::Batch> weakLearnerPrediction;
197 double accuracyThreshold;
198 size_t maxIterations;
199 double newtonRaphsonAccuracyThreshold;
200 size_t newtonRaphsonMaxIterations;
201 double degenerateCasesThreshold;
202 services::Status check() const DAAL_C11_OVERRIDE;
214 class DAAL_EXPORT Model : public classifier::Model
217 DECLARE_MODEL(Model, classifier::Model)
226 template <
typename modelFPType>
227 DAAL_EXPORT Model(
size_t nFeatures, modelFPType dummy);
233 Model(
size_t nFeatures = 0) : _models(new data_management::DataCollection()), _nFeatures(nFeatures), _alpha() { }
242 template<
typename modelFPType>
243 DAAL_EXPORT
static services::SharedPtr<Model> create(
size_t nFeatures, services::Status *stat = NULL);
251 size_t getNumberOfWeakLearners()
const;
258 classifier::ModelPtr getWeakLearnerModel(
size_t idx)
const;
264 void addWeakLearnerModel(classifier::ModelPtr model);
269 void clearWeakLearnerModels();
275 size_t getNumberOfFeatures() const DAAL_C11_OVERRIDE {
return _nFeatures; }
283 data_management::NumericTablePtr getAlpha();
287 data_management::DataCollectionPtr _models;
288 data_management::NumericTablePtr _alpha;
290 template<
typename Archive,
bool onDeserialize>
291 services::Status serialImpl(Archive *arch)
294 DAAL_CHECK_STATUS(st, (classifier::Model::serialImpl<Archive, onDeserialize>(arch)));
295 arch->set(_nFeatures);
296 arch->setSharedPtrObj(_models);
297 arch->setSharedPtrObj(_alpha);
302 template <
typename modelFPType>
303 DAAL_EXPORT Model(
size_t nFeatures, modelFPType dummy, services::Status &st);
306 typedef services::SharedPtr<Model> ModelPtr;
309 using interface2::Parameter;
310 using interface2::Model;
311 using interface2::ModelPtr;
daal::algorithms::brownboost::interface1::Parameter::newtonRaphsonAccuracyThreshold
double newtonRaphsonAccuracyThreshold
Definition: brownboost_model.h:81
daal::algorithms::brownboost::interface2::Parameter::newtonRaphsonMaxIterations
size_t newtonRaphsonMaxIterations
Definition: brownboost_model.h:200
daal::algorithms::brownboost::interface1::Parameter
BrownBoost algorithm parameters.
Definition: brownboost_model.h:60
daal::algorithms::brownboost::interface2::Model::getNumberOfFeatures
size_t getNumberOfFeatures() const DAAL_C11_OVERRIDE
Definition: brownboost_model.h:275
daal::algorithms::brownboost::interface1::Parameter::newtonRaphsonMaxIterations
size_t newtonRaphsonMaxIterations
Definition: brownboost_model.h:82
daal::algorithms::brownboost::interface1::Parameter::degenerateCasesThreshold
double degenerateCasesThreshold
Definition: brownboost_model.h:83
daal::algorithms::brownboost::interface1::Parameter::maxIterations
size_t maxIterations
Definition: brownboost_model.h:80
daal::algorithms::brownboost::interface2::Parameter::weakLearnerTraining
services::SharedPtr< classifier::training::Batch > weakLearnerTraining
Definition: brownboost_model.h:195
daal::algorithms::brownboost::interface2::Parameter::degenerateCasesThreshold
double degenerateCasesThreshold
Definition: brownboost_model.h:201
daal::algorithms::brownboost::interface2::Model::Model
Model(size_t nFeatures=0)
Definition: brownboost_model.h:233
daal::algorithms::elastic_net::training::model
Definition: elastic_net_training_types.h:109
daal::algorithms::brownboost::interface2::Parameter::weakLearnerPrediction
services::SharedPtr< classifier::prediction::Batch > weakLearnerPrediction
Definition: brownboost_model.h:196
daal::algorithms::brownboost::interface2::Parameter::accuracyThreshold
double accuracyThreshold
Definition: brownboost_model.h:197
daal::algorithms::brownboost::interface2::Parameter::maxIterations
size_t maxIterations
Definition: brownboost_model.h:198
daal::algorithms::brownboost::interface1::Model
Model of the classifier trained by the brownboost::training::Batch algorithm.
Definition: brownboost_model.h:97
daal::algorithms::brownboost::interface1::Parameter::accuracyThreshold
double accuracyThreshold
Definition: brownboost_model.h:79
daal::algorithms::brownboost::interface2::Parameter::newtonRaphsonAccuracyThreshold
double newtonRaphsonAccuracyThreshold
Definition: brownboost_model.h:199
daal::algorithms::brownboost::interface1::Model::Model
DAAL_DEPRECATED Model()
Definition: brownboost_model.h:116