24 #ifndef __LOGIT_BOOST_TRAINING_BATCH_H__
25 #define __LOGIT_BOOST_TRAINING_BATCH_H__
27 #include "algorithms/boosting/boosting_training_batch.h"
28 #include "algorithms/boosting/logitboost_training_types.h"
29 #include "algorithms/classifier/classifier_training_batch.h"
55 template<
typename algorithmFPType, Method method, CpuType cpu>
56 class BatchContainer :
public TrainingContainerIface<batch>
64 DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv);
66 DAAL_DEPRECATED ~BatchContainer();
70 DAAL_DEPRECATED services::Status compute() DAAL_C11_OVERRIDE;
90 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = friedman>
91 class DAAL_EXPORT Batch :
public boosting::training::Batch
94 typedef boosting::training::Batch super;
96 typedef typename super::InputType InputType;
97 typedef algorithms::logitboost::interface1::Parameter ParameterType;
98 typedef algorithms::logitboost::training::interface1::Result ResultType;
100 ParameterType parameter;
107 DAAL_DEPRECATED Batch(
size_t nClasses)
110 parameter.nClasses = nClasses;
119 DAAL_DEPRECATED Batch(
const Batch<algorithmFPType, method> &other) : boosting::training::Batch(other),
120 parameter(other.parameter), input(other.input)
125 DAAL_DEPRECATED_VIRTUAL
virtual ~Batch() {}
131 DAAL_DEPRECATED InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
137 DAAL_DEPRECATED_VIRTUAL
virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
143 DAAL_DEPRECATED ResultPtr getResult()
145 return ResultType::cast(_result);
151 DAAL_DEPRECATED services::Status resetResult() DAAL_C11_OVERRIDE
153 _result.reset(
new ResultType());
154 DAAL_CHECK(_result, services::ErrorNullResult);
156 return services::Status();
164 DAAL_DEPRECATED services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
166 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
170 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
172 return new Batch<algorithmFPType, method>(*this);
175 services::Status allocateResult() DAAL_C11_OVERRIDE
177 ResultPtr res = getResult();
178 DAAL_CHECK(_result, services::ErrorNullResult);
179 services::Status s = res->template allocate<algorithmFPType>(&input, _par, method);
180 _res = _result.get();
186 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
189 _result.reset(
new ResultType());
210 template<
typename algorithmFPType, Method method, CpuType cpu>
211 class BatchContainer :
public TrainingContainerIface<batch>
219 BatchContainer(daal::services::Environment::env *daalEnv);
225 services::Status compute() DAAL_C11_OVERRIDE;
244 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = friedman>
245 class DAAL_EXPORT Batch :
public classifier::training::Batch
248 typedef classifier::training::Batch super;
250 typedef typename super::InputType InputType;
251 typedef algorithms::logitboost::Parameter ParameterType;
252 typedef algorithms::logitboost::training::Result ResultType;
260 Batch(
size_t nClasses);
268 Batch(
const Batch<algorithmFPType, method> &other);
279 ParameterType& parameter() {
return *
static_cast<ParameterType*
>(_par); }
285 const ParameterType& parameter()
const {
return *
static_cast<const ParameterType*
>(_par); }
291 InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
297 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
303 ResultPtr getResult()
305 return ResultType::cast(_result);
311 services::Status resetResult() DAAL_C11_OVERRIDE
313 _result.reset(
new ResultType());
314 DAAL_CHECK(_result, services::ErrorNullResult);
316 return services::Status();
324 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
326 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
330 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
332 return new Batch<algorithmFPType, method>(*this);
335 services::Status allocateResult() DAAL_C11_OVERRIDE
337 ResultPtr res = getResult();
338 DAAL_CHECK(_result, services::ErrorNullResult);
339 services::Status s = res->template allocate<algorithmFPType>(&input, _par, method);
340 _res = _result.get();
346 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
348 _result.reset(
new ResultType());
353 using interface2::Batch;
354 using interface2::BatchContainer;
360 #endif // __LOGIT_BOOST_TRAINING_BATCH_H__
daal::algorithms::logitboost::training::interface1::Batch::parameter
ParameterType parameter
Definition: logitboost_training_batch.h:100
daal::algorithms::logitboost::training::interface2::Batch::parameter
ParameterType & parameter()
Definition: logitboost_training_batch.h:279
daal::algorithms::logitboost::training::interface1::BatchContainer::~BatchContainer
DAAL_DEPRECATED ~BatchContainer()
daal::batch
Definition: daal_defines.h:112
daal::algorithms::logitboost::training::interface1::Batch::input
InputType input
Definition: logitboost_training_batch.h:101
daal::algorithms::logitboost::training::interface2::Batch::parameter
const ParameterType & parameter() const
Definition: logitboost_training_batch.h:285
daal::algorithms::logitboost::training::interface1::BatchContainer::compute
DAAL_DEPRECATED services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::logitboost::training::interface2::Batch
Trains model of the LogitBoost algorithms in the batch processing mode.
Definition: logitboost_training_batch.h:245
daal::algorithms::logitboost::training::interface2::Batch::input
InputType input
Definition: logitboost_training_batch.h:254
daal::algorithms::logitboost::training::interface2::BatchContainer
Provides methods to run implementations of LogitBoost model-based training. This class is associated ...
Definition: logitboost_training_batch.h:211
daal::algorithms::logitboost::training::interface2::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: logitboost_training_batch.h:324
daal::algorithms::logitboost::training::interface2::Batch::getResult
ResultPtr getResult()
Definition: logitboost_training_batch.h:303
daal::algorithms::logitboost::training::interface1::Batch::Batch
DAAL_DEPRECATED Batch(const Batch< algorithmFPType, method > &other)
Definition: logitboost_training_batch.h:119
daal::algorithms::logitboost::training::interface1::BatchContainer::BatchContainer
DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::logitboost::training::interface1::Batch::getInput
DAAL_DEPRECATED InputType * getInput() DAAL_C11_OVERRIDE
Definition: logitboost_training_batch.h:131
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::logitboost::training::interface1::BatchContainer
Provides methods to run implementations of LogitBoost model-based training. This class is associated ...
Definition: logitboost_training_batch.h:56
daal::algorithms::logitboost::training::interface2::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::logitboost::training::interface1::Batch::getResult
DAAL_DEPRECATED ResultPtr getResult()
Definition: logitboost_training_batch.h:143
daal::algorithms::logitboost::training::interface2::BatchContainer::~BatchContainer
~BatchContainer()
daal::algorithms::logitboost::training::interface1::Batch::Batch
DAAL_DEPRECATED Batch(size_t nClasses)
Definition: logitboost_training_batch.h:107
daal::algorithms::logitboost::training::interface1::Batch::resetResult
DAAL_DEPRECATED services::Status resetResult() DAAL_C11_OVERRIDE
Definition: logitboost_training_batch.h:151
daal::algorithms::logitboost::training::interface2::Batch::resetResult
services::Status resetResult() DAAL_C11_OVERRIDE
Definition: logitboost_training_batch.h:311
daal::algorithms::logitboost::training::interface1::Batch::getMethod
virtual DAAL_DEPRECATED_VIRTUAL int getMethod() const DAAL_C11_OVERRIDE
Definition: logitboost_training_batch.h:137
daal::algorithms::logitboost::training::interface2::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: logitboost_training_batch.h:291
daal::algorithms::logitboost::training::interface1::Batch::clone
DAAL_DEPRECATED services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: logitboost_training_batch.h:164
daal::algorithms::logitboost::training::interface1::Result
Provides methods to access final results obtained with the compute() method of the LogitBoost trainin...
Definition: logitboost_training_types.h:73
daal::algorithms::logitboost::training::interface1::Batch
Trains model of the LogitBoost algorithms in the batch processing mode.
Definition: logitboost_training_batch.h:91
daal::algorithms::logitboost::training::interface2::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::logitboost::interface1::Parameter
LogitBoost algorithm parameters.
Definition: logitboost_model.h:61
daal::algorithms::TrainingContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the model...
Definition: training.h:52
daal::algorithms::logitboost::training::interface2::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: logitboost_training_batch.h:297