25 #ifndef __NAIVE_BAYES_PREDICT_H__
26 #define __NAIVE_BAYES_PREDICT_H__
28 #include "algorithms/algorithm.h"
29 #include "data_management/data/numeric_table.h"
30 #include "services/daal_defines.h"
31 #include "multinomial_naive_bayes_predict_types.h"
32 #include "algorithms/classifier/classifier_predict.h"
38 namespace multinomial_naive_bayes
60 template<
typename algorithmFPType, prediction::Method method, CpuType cpu>
61 class BatchContainer :
public PredictionContainerIface
69 DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv);
71 DAAL_DEPRECATED ~BatchContainer();
77 DAAL_DEPRECATED services::Status compute() DAAL_C11_OVERRIDE;
91 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, prediction::Method method = defaultDense>
92 class Batch :
public classifier::prediction::interface1::Batch
95 typedef classifier::prediction::interface1::Batch super;
97 typedef algorithms::multinomial_naive_bayes::prediction::Input InputType;
98 typedef algorithms::multinomial_naive_bayes::interface1::Parameter ParameterType;
99 typedef typename super::ResultType ResultType;
102 ParameterType parameter;
107 DAAL_DEPRECATED Batch(
size_t nClasses) : parameter(nClasses)
118 DAAL_DEPRECATED Batch(
const Batch<algorithmFPType, method> &other) :
119 classifier::prediction::interface1::Batch(other), parameter(other.parameter), input(other.input)
124 DAAL_DEPRECATED_VIRTUAL
virtual ~Batch() {}
130 DAAL_DEPRECATED InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
136 DAAL_DEPRECATED_VIRTUAL
virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
143 DAAL_DEPRECATED services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
145 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
150 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
152 return new Batch<algorithmFPType, method>(*this);
155 services::Status allocateResult() DAAL_C11_OVERRIDE
157 services::Status s = _result->allocate<algorithmFPType>(&input, ¶meter, (int) method);
158 _res = _result.get();
165 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, interface1::BatchContainer, algorithmFPType, method)(&_env);
189 template<
typename algorithmFPType, prediction::Method method, CpuType cpu>
190 class BatchContainer :
public PredictionContainerIface
198 BatchContainer(daal::services::Environment::env *daalEnv);
206 services::Status compute() DAAL_C11_OVERRIDE;
220 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, prediction::Method method = defaultDense>
221 class Batch :
public classifier::prediction::Batch
224 typedef classifier::prediction::Batch super;
226 typedef algorithms::multinomial_naive_bayes::prediction::Input InputType;
227 typedef algorithms::multinomial_naive_bayes::Parameter ParameterType;
228 typedef typename super::ResultType ResultType;
231 ParameterType parameter;
236 Batch(
size_t nClasses) : parameter(nClasses)
247 Batch(
const Batch<algorithmFPType, method> &other) :
248 classifier::prediction::Batch(other), parameter(other.parameter), input(other.input)
259 InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
265 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
272 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
274 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
279 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
281 return new Batch<algorithmFPType, method>(*this);
284 services::Status allocateResult() DAAL_C11_OVERRIDE
286 services::Status s = _result->allocate<algorithmFPType>(&input, ¶meter, (int) method);
287 _res = _result.get();
294 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
300 using interface2::BatchContainer;
301 using interface2::Batch;
daal::algorithms::multinomial_naive_bayes::prediction::interface2::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: multinomial_naive_bayes_predict.h:265
daal::algorithms::multinomial_naive_bayes::prediction::interface2::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::multinomial_naive_bayes::prediction::interface2::Batch::Batch
Batch(size_t nClasses)
Definition: multinomial_naive_bayes_predict.h:236
daal::algorithms::multinomial_naive_bayes::prediction::interface2::Batch::input
InputType input
Definition: multinomial_naive_bayes_predict.h:230
daal::batch
Definition: daal_defines.h:112
daal::algorithms::multinomial_naive_bayes::prediction::interface1::BatchContainer::BatchContainer
DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::multinomial_naive_bayes::prediction::interface1::BatchContainer::compute
DAAL_DEPRECATED services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::multinomial_naive_bayes::prediction::interface2::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: multinomial_naive_bayes_predict.h:272
daal::algorithms::multinomial_naive_bayes::prediction::interface2::Batch::parameter
ParameterType parameter
Definition: multinomial_naive_bayes_predict.h:231
daal::algorithms::neural_networks::prediction::prediction
Definition: neural_networks_prediction_result.h:55
daal::algorithms::multinomial_naive_bayes::prediction::interface1::Batch::Batch
DAAL_DEPRECATED Batch(const Batch< algorithmFPType, method > &other)
Definition: multinomial_naive_bayes_predict.h:118
daal::algorithms::multinomial_naive_bayes::prediction::interface2::BatchContainer::~BatchContainer
~BatchContainer()
daal::algorithms::multinomial_naive_bayes::prediction::interface2::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: multinomial_naive_bayes_predict.h:259
daal::algorithms::multinomial_naive_bayes::interface1::Parameter
Naive Bayes algorithm parameters.
Definition: multinomial_naive_bayes_model.h:60
daal::algorithms::classifier::prediction::interface1::Input
Input objects in the prediction stage of the classification algorithm.
Definition: classifier_predict_types.h:111
daal::algorithms::multinomial_naive_bayes::prediction::interface1::Batch
Predicts the results of the multinomial naive Bayes classification.
Definition: multinomial_naive_bayes_predict.h:92
daal::algorithms::multinomial_naive_bayes::prediction::interface1::Batch::clone
DAAL_DEPRECATED services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: multinomial_naive_bayes_predict.h:143
daal::algorithms::PredictionContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the algor...
Definition: prediction.h:42
daal::algorithms::multinomial_naive_bayes::prediction::interface1::BatchContainer::~BatchContainer
DAAL_DEPRECATED ~BatchContainer()
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::multinomial_naive_bayes::prediction::interface1::Batch::getMethod
virtual DAAL_DEPRECATED_VIRTUAL int getMethod() const DAAL_C11_OVERRIDE
Definition: multinomial_naive_bayes_predict.h:136
daal::algorithms::multinomial_naive_bayes::prediction::interface1::Batch::parameter
ParameterType parameter
Definition: multinomial_naive_bayes_predict.h:102
daal::algorithms::multinomial_naive_bayes::prediction::interface1::Batch::Batch
DAAL_DEPRECATED Batch(size_t nClasses)
Definition: multinomial_naive_bayes_predict.h:107
daal::algorithms::classifier::interface1::Parameter
Base class for the parameters of the classification algorithm.
Definition: classifier_model.h:69
daal::algorithms::multinomial_naive_bayes::prediction::interface2::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::multinomial_naive_bayes::prediction::interface2::Batch
Predicts the results of the multinomial naive Bayes classification.
Definition: multinomial_naive_bayes_predict.h:221
daal::algorithms::multinomial_naive_bayes::prediction::interface1::Batch::getInput
DAAL_DEPRECATED InputType * getInput() DAAL_C11_OVERRIDE
Definition: multinomial_naive_bayes_predict.h:130
daal::algorithms::multinomial_naive_bayes::prediction::interface2::BatchContainer
Runs the prediction based on the multinomial naive Bayes model.
Definition: multinomial_naive_bayes_predict.h:190
daal::algorithms::multinomial_naive_bayes::prediction::interface1::Batch::input
InputType input
Definition: multinomial_naive_bayes_predict.h:101
daal::algorithms::multinomial_naive_bayes::prediction::interface1::BatchContainer
Runs the prediction based on the multinomial naive Bayes model.
Definition: multinomial_naive_bayes_predict.h:61
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::multinomial_naive_bayes::prediction::interface2::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: multinomial_naive_bayes_predict.h:247