24 #ifndef __BROWN_BOOST_TRAINING_BATCH_H__
25 #define __BROWN_BOOST_TRAINING_BATCH_H__
27 #include "algorithms/boosting/boosting_training_batch.h"
28 #include "algorithms/boosting/brownboost_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 = defaultDense>
91 class DAAL_EXPORT Batch :
public boosting::training::Batch
94 typedef boosting::training::Batch super;
96 typedef typename super::InputType InputType;
97 typedef algorithms::brownboost::interface1::Parameter ParameterType;
98 typedef algorithms::brownboost::training::interface1::Result ResultType;
100 ParameterType parameter;
103 DAAL_DEPRECATED Batch()
114 DAAL_DEPRECATED Batch(
const Batch<algorithmFPType, method> &other) : boosting::training::Batch(other),
115 parameter(other.parameter), input(other.input)
120 DAAL_DEPRECATED_VIRTUAL
virtual ~Batch() {}
126 DAAL_DEPRECATED InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
132 DAAL_DEPRECATED_VIRTUAL
virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
138 DAAL_DEPRECATED ResultPtr getResult()
140 return ResultType::cast(_result);
146 DAAL_DEPRECATED services::Status resetResult() DAAL_C11_OVERRIDE
148 _result.reset(
new ResultType());
149 DAAL_CHECK(_result, services::ErrorNullResult);
151 return services::Status();
159 DAAL_DEPRECATED services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
161 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
165 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
167 return new Batch<algorithmFPType, method>(*this);
170 services::Status allocateResult() DAAL_C11_OVERRIDE
172 ResultPtr res = getResult();
173 DAAL_CHECK(_result, services::ErrorNullResult);
174 services::Status s = res->template allocate<algorithmFPType>(&input, _par, method);
175 _res = _result.get();
181 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
184 _result.reset(
new ResultType());
205 template<
typename algorithmFPType, Method method, CpuType cpu>
206 class BatchContainer :
public TrainingContainerIface<batch>
214 BatchContainer(daal::services::Environment::env *daalEnv);
220 services::Status compute() DAAL_C11_OVERRIDE;
239 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
240 class DAAL_EXPORT Batch :
public classifier::training::Batch
243 typedef classifier::training::Batch super;
245 typedef typename super::InputType InputType;
246 typedef algorithms::brownboost::Parameter ParameterType;
247 typedef algorithms::brownboost::training::Result ResultType;
259 Batch(
const Batch<algorithmFPType, method> &other);
270 ParameterType& parameter() {
return *
static_cast<ParameterType*
>(_par); }
276 const ParameterType& parameter()
const {
return *
static_cast<const ParameterType*
>(_par); }
282 InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
288 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
294 ResultPtr getResult()
296 return ResultType::cast(_result);
302 services::Status resetResult() DAAL_C11_OVERRIDE
304 _result.reset(
new ResultType());
305 DAAL_CHECK(_result, services::ErrorNullResult);
307 return services::Status();
315 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
317 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
321 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
323 return new Batch<algorithmFPType, method>(*this);
326 services::Status allocateResult() DAAL_C11_OVERRIDE
328 ResultPtr res = getResult();
329 DAAL_CHECK(_result, services::ErrorNullResult);
330 services::Status s = res->template allocate<algorithmFPType>(&input, _par, method);
331 _res = _result.get();
337 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
339 _result.reset(
new ResultType());
344 using interface2::Batch;
345 using interface2::BatchContainer;
351 #endif // __BROWN_BOOST_TRAINING_BATCH_H__
daal::algorithms::brownboost::training::interface2::Batch::input
InputType input
Definition: brownboost_training_batch.h:249
daal::algorithms::brownboost::training::interface2::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::brownboost::training::interface1::Batch::clone
DAAL_DEPRECATED services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: brownboost_training_batch.h:159
daal::algorithms::brownboost::interface1::Parameter
BrownBoost algorithm parameters.
Definition: brownboost_model.h:60
daal::algorithms::brownboost::training::interface2::BatchContainer
Provides methods to run implementations of BrownBoost model-based training. This class is associated ...
Definition: brownboost_training_batch.h:206
daal::batch
Definition: daal_defines.h:112
daal::algorithms::brownboost::training::interface2::Batch::resetResult
services::Status resetResult() DAAL_C11_OVERRIDE
Definition: brownboost_training_batch.h:302
daal::algorithms::brownboost::training::interface1::Batch::input
InputType input
Definition: brownboost_training_batch.h:101
daal::algorithms::brownboost::training::interface2::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: brownboost_training_batch.h:315
daal::algorithms::brownboost::training::interface1::BatchContainer::~BatchContainer
DAAL_DEPRECATED ~BatchContainer()
daal::algorithms::brownboost::training::interface1::Batch::Batch
DAAL_DEPRECATED Batch(const Batch< algorithmFPType, method > &other)
Definition: brownboost_training_batch.h:114
daal::algorithms::brownboost::training::interface1::Batch::parameter
ParameterType parameter
Definition: brownboost_training_batch.h:100
daal::algorithms::brownboost::training::interface1::Batch
Trains model of the BrownBoost algorithms in the batch processing mode.
Definition: brownboost_training_batch.h:91
daal::algorithms::brownboost::training::interface1::BatchContainer
Provides methods to run implementations of BrownBoost model-based training. This class is associated ...
Definition: brownboost_training_batch.h:56
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::brownboost::training::interface2::Batch
Trains model of the BrownBoost algorithms in the batch processing mode.
Definition: brownboost_training_batch.h:240
daal::algorithms::brownboost::training::interface2::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: brownboost_training_batch.h:288
daal::algorithms::brownboost::training::interface2::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: brownboost_training_batch.h:282
daal::algorithms::brownboost::training::interface1::BatchContainer::BatchContainer
DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::brownboost::training::interface2::Batch::parameter
const ParameterType & parameter() const
Definition: brownboost_training_batch.h:276
daal::algorithms::brownboost::training::interface1::Batch::getInput
DAAL_DEPRECATED InputType * getInput() DAAL_C11_OVERRIDE
Definition: brownboost_training_batch.h:126
daal::algorithms::brownboost::training::interface2::BatchContainer::~BatchContainer
~BatchContainer()
daal::algorithms::brownboost::training::interface2::Batch::parameter
ParameterType & parameter()
Definition: brownboost_training_batch.h:270
daal::algorithms::brownboost::training::interface2::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::brownboost::training::interface2::Batch::getResult
ResultPtr getResult()
Definition: brownboost_training_batch.h:294
daal::algorithms::brownboost::training::interface1::BatchContainer::compute
DAAL_DEPRECATED services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::brownboost::training::interface1::Batch::resetResult
DAAL_DEPRECATED services::Status resetResult() DAAL_C11_OVERRIDE
Definition: brownboost_training_batch.h:146
daal::algorithms::brownboost::training::interface1::Batch::getMethod
virtual DAAL_DEPRECATED_VIRTUAL int getMethod() const DAAL_C11_OVERRIDE
Definition: brownboost_training_batch.h:132
daal::algorithms::brownboost::training::interface1::Batch::getResult
DAAL_DEPRECATED ResultPtr getResult()
Definition: brownboost_training_batch.h:138
daal::algorithms::TrainingContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the model...
Definition: training.h:52
daal::algorithms::brownboost::training::interface1::Result
Provides methods to access final results obtained with the compute() method.
Definition: brownboost_training_types.h:72