24 #ifndef __DECISION_FOREST_CLASSIFICATION_PREDICT_H__
25 #define __DECISION_FOREST_CLASSIFICATION_PREDICT_H__
27 #include "algorithms/algorithm.h"
28 #include "algorithms/classifier/classifier_predict.h"
29 #include "algorithms/decision_forest/decision_forest_classification_model.h"
30 #include "algorithms/decision_forest/decision_forest_classification_predict_types.h"
36 namespace decision_forest
38 namespace classification
73 template<
typename algorithmFPType, Method method, CpuType cpu>
74 class BatchContainer :
public PredictionContainerIface
81 DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv);
83 DAAL_DEPRECATED ~BatchContainer();
88 DAAL_DEPRECATED services::Status compute() DAAL_C11_OVERRIDE;
111 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
112 class Batch :
public classifier::prediction::interface1::Batch
115 typedef classifier::prediction::interface1::Batch super;
117 typedef algorithms::decision_forest::classification::prediction::Input InputType;
118 typedef typename super::ParameterType ParameterType;
119 typedef typename super::ResultType ResultType;
122 ParameterType parameter;
128 DAAL_DEPRECATED Batch(
size_t nClasses): parameter(nClasses)
139 DAAL_DEPRECATED Batch(
const Batch<algorithmFPType, method> &other) : classifier::prediction::interface1::Batch(other),
140 input(other.input), parameter(other.parameter)
145 DAAL_DEPRECATED ~Batch() {}
151 DAAL_DEPRECATED InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
157 DAAL_DEPRECATED_VIRTUAL
virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
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 services::Status s = _result->allocate<algorithmFPType>(&input, 0, 0);
178 _res = _result.get();
185 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
206 template<
typename algorithmFPType, Method method, CpuType cpu>
207 class BatchContainer :
public PredictionContainerIface
214 BatchContainer(daal::services::Environment::env *daalEnv);
221 services::Status compute() DAAL_C11_OVERRIDE;
244 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
245 class Batch :
public classifier::prediction::Batch
248 typedef classifier::prediction::Batch super;
250 typedef algorithms::decision_forest::classification::prediction::Input InputType;
251 typedef typename super::ParameterType ParameterType;
252 typedef typename super::ResultType ResultType;
255 ParameterType parameter;
261 Batch(
size_t nClasses): parameter(nClasses)
272 Batch(
const Batch<algorithmFPType, method> &other) : classifier::prediction::Batch(other),
273 input(other.input), parameter(other.parameter)
284 InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
290 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
297 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
299 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
303 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
305 return new Batch<algorithmFPType, method>(*this);
308 services::Status allocateResult() DAAL_C11_OVERRIDE
310 services::Status s = _result->allocate<algorithmFPType>(&input, ¶meter, 0);
311 _res = _result.get();
318 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
340 template <
typename algorithmFPType, Method method, CpuType cpu>
341 class BatchContainer :
public PredictionContainerIface
348 BatchContainer(daal::services::Environment::env * daalEnv);
355 services::Status compute() DAAL_C11_OVERRIDE;
378 template <
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
379 class DAAL_EXPORT Batch :
public classifier::prediction::Batch
382 typedef classifier::prediction::Batch super;
384 typedef algorithms::decision_forest::classification::prediction::Input InputType;
385 typedef algorithms::decision_forest::classification::prediction::Parameter ParameterType;
386 typedef typename super::ResultType ResultType;
394 Batch(
size_t nClasses);
402 Batch(
const Batch<algorithmFPType, method> & other);
404 ~Batch() {
delete _par; }
410 InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
416 ParameterType & parameter() {
return *
static_cast<ParameterType *
>(_par); }
422 const ParameterType & parameter()
const {
return *
static_cast<const ParameterType *
>(_par); }
428 virtual int getMethod() const DAAL_C11_OVERRIDE {
return (
int)method; }
435 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const {
return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl()); }
438 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE {
return new Batch<algorithmFPType, method>(*this); }
440 services::Status allocateResult() DAAL_C11_OVERRIDE
442 services::Status s = _result->allocate<algorithmFPType>(&input, _par, 0);
443 _res = _result.get();
450 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
451 _result.reset(
new ResultType());
457 using interface3::BatchContainer;
458 using interface3::Batch;
daal::algorithms::decision_forest::classification::prediction::interface1::Batch::parameter
ParameterType parameter
Definition: decision_forest_classification_predict.h:122
daal::algorithms::decision_forest::classification::prediction::interface1::BatchContainer::BatchContainer
DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::decision_forest::classification::prediction::interface2::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: decision_forest_classification_predict.h:284
daal::algorithms::decision_forest::classification::prediction::interface2::Batch
Predicts decision_forest classification results.
Definition: decision_forest_classification_predict.h:245
daal::batch
Definition: daal_defines.h:112
daal::algorithms::decision_forest::classification::prediction::interface1::Batch::Batch
DAAL_DEPRECATED Batch(const Batch< algorithmFPType, method > &other)
Definition: decision_forest_classification_predict.h:139
daal::algorithms::decision_forest::classification::prediction::interface1::BatchContainer::compute
DAAL_DEPRECATED services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::decision_forest::classification::prediction::interface3::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::neural_networks::prediction::prediction
Definition: neural_networks_prediction_result.h:55
daal::algorithms::decision_forest::classification::prediction::interface2::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::decision_forest::classification::prediction::interface2::BatchContainer
Provides methods to run implementations of the decision_forest algorithm. This class is associated wi...
Definition: decision_forest_classification_predict.h:207
daal::algorithms::decision_forest::classification::prediction::interface1::BatchContainer
Provides methods to run implementations of the decision_forest algorithm.
Definition: decision_forest_classification_predict.h:74
daal::algorithms::decision_forest::classification::prediction::interface3::Batch
Predicts decision_forest classification results.
Definition: decision_forest_classification_predict.h:379
daal::algorithms::decision_forest::classification::prediction::defaultDense
Definition: decision_forest_classification_predict.h:56
daal::algorithms::classifier::prediction::interface1::Input
Input objects in the prediction stage of the classification algorithm.
Definition: classifier_predict_types.h:111
daal::algorithms::decision_forest::classification::prediction::interface3::BatchContainer
Provides methods to run implementations of the decision_forest algorithm. This class is associated wi...
Definition: decision_forest_classification_predict.h:341
daal::algorithms::decision_forest::classification::prediction::interface2::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: decision_forest_classification_predict.h:272
daal::algorithms::decision_forest::classification::prediction::interface1::Batch
Predicts decision_forest classification results.
Definition: decision_forest_classification_predict.h:112
daal::algorithms::decision_forest::classification::prediction::interface1::Batch::input
InputType input
Definition: decision_forest_classification_predict.h:121
daal::algorithms::decision_forest::classification::prediction::interface2::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: decision_forest_classification_predict.h:290
daal::algorithms::decision_forest::classification::prediction::interface1::Batch::clone
DAAL_DEPRECATED services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: decision_forest_classification_predict.h:164
daal::algorithms::PredictionContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the algor...
Definition: prediction.h:42
daal::algorithms::decision_forest::classification::prediction::interface1::Batch::Batch
DAAL_DEPRECATED Batch(size_t nClasses)
Definition: decision_forest_classification_predict.h:128
daal::algorithms::decision_forest::classification::prediction::interface2::Batch::input
InputType input
Definition: decision_forest_classification_predict.h:254
daal::algorithms::classifier::prediction::interface1::Result
Provides methods to access prediction results obtained with the compute() method of the classifier pr...
Definition: classifier_predict_types.h:168
daal::algorithms::decision_forest::classification::prediction::interface3::BatchContainer::~BatchContainer
~BatchContainer()
daal::algorithms::decision_forest::classification::prediction::interface2::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: decision_forest_classification_predict.h:297
daal::algorithms::decision_forest::classification::prediction::interface1::BatchContainer::~BatchContainer
DAAL_DEPRECATED ~BatchContainer()
daal::algorithms::decision_forest::classification::prediction::interface2::Batch::parameter
ParameterType parameter
Definition: decision_forest_classification_predict.h:255
daal::algorithms::classifier::interface1::Parameter
Base class for the parameters of the classification algorithm.
Definition: classifier_model.h:69
daal::algorithms::decision_forest::classification::prediction::interface1::Batch::getMethod
virtual DAAL_DEPRECATED_VIRTUAL int getMethod() const DAAL_C11_OVERRIDE
Definition: decision_forest_classification_predict.h:157
daal::algorithms::decision_forest::classification::prediction::interface3::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: decision_forest_classification_predict.h:435
daal::algorithms::decision_forest::classification::prediction::interface3::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::decision_forest::classification::prediction::interface3::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: decision_forest_classification_predict.h:410
daal::algorithms::decision_forest::classification::prediction::interface3::Batch::input
InputType input
Definition: decision_forest_classification_predict.h:388
daal::algorithms::decision_forest::classification::prediction::interface3::Batch::parameter
const ParameterType & parameter() const
Definition: decision_forest_classification_predict.h:422
daal::algorithms::decision_forest::classification::prediction::interface2::Batch::Batch
Batch(size_t nClasses)
Definition: decision_forest_classification_predict.h:261
daal::algorithms::decision_forest::classification::prediction::interface2::BatchContainer::~BatchContainer
~BatchContainer()
daal::algorithms::decision_forest::classification::prediction::Method
Method
Definition: decision_forest_classification_predict.h:54
daal::algorithms::decision_forest::classification::prediction::interface2::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::decision_forest::classification::prediction::interface3::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: decision_forest_classification_predict.h:428
daal::algorithms::classifier::prediction::interface1::Batch
Base class for making predictions based on the model of the classification algorithms.
Definition: classifier_predict.h:61
daal::algorithms::decision_forest::classification::prediction::interface1::Batch::getInput
DAAL_DEPRECATED InputType * getInput() DAAL_C11_OVERRIDE
Definition: decision_forest_classification_predict.h:151
daal::algorithms::decision_forest::classification::prediction::interface3::Batch::parameter
ParameterType & parameter()
Definition: decision_forest_classification_predict.h:416