23 #ifndef __NAIVE_BAYES_PREDICT_H__
24 #define __NAIVE_BAYES_PREDICT_H__
26 #include "algorithms/algorithm.h"
27 #include "data_management/data/numeric_table.h"
28 #include "services/daal_defines.h"
29 #include "multinomial_naive_bayes_predict_types.h"
30 #include "algorithms/classifier/classifier_predict.h"
36 namespace multinomial_naive_bayes
58 template<
typename algorithmFPType, prediction::Method method, CpuType cpu>
59 class DAAL_EXPORT BatchContainer :
public PredictionContainerIface
67 BatchContainer(daal::services::Environment::env *daalEnv);
75 services::Status compute() DAAL_C11_OVERRIDE;
89 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, prediction::Method method = defaultDense>
90 class Batch :
public classifier::prediction::Batch
93 typedef classifier::prediction::Batch super;
95 typedef algorithms::multinomial_naive_bayes::prediction::Input InputType;
96 typedef algorithms::multinomial_naive_bayes::Parameter ParameterType;
97 typedef typename super::ResultType ResultType;
100 ParameterType parameter;
105 Batch(
size_t nClasses) : parameter(nClasses)
116 Batch(
const Batch<algorithmFPType, method> &other) :
117 classifier::prediction::Batch(other), parameter(other.parameter), input(other.input)
128 InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
134 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
141 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
143 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
148 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
150 return new Batch<algorithmFPType, method>(*this);
153 services::Status allocateResult() DAAL_C11_OVERRIDE
155 services::Status s = _result->allocate<algorithmFPType>(&input, ¶meter, (int) method);
156 _res = _result.get();
163 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
169 using interface1::BatchContainer;
170 using interface1::Batch;
daal::algorithms::multinomial_naive_bayes::prediction::interface1::Batch::Batch
Batch(size_t nClasses)
Definition: multinomial_naive_bayes_predict.h:105
daal
Definition: algorithm_base_common.h:31
daal::algorithms::multinomial_naive_bayes::prediction::interface1::Batch::parameter
ParameterType parameter
Definition: multinomial_naive_bayes_predict.h:100
daal::algorithms::PredictionContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the algor...
Definition: prediction.h:40
daal::algorithms::multinomial_naive_bayes::prediction::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: multinomial_naive_bayes_predict.h:141
daal::algorithms::multinomial_naive_bayes::prediction::interface1::Batch
Predicts the results of the multinomial naive Bayes classification.
Definition: multinomial_naive_bayes_predict.h:90
daal::algorithms::multinomial_naive_bayes::prediction::interface1::BatchContainer
Runs the prediction based on the multinomial naive Bayes model.
Definition: multinomial_naive_bayes_predict.h:59
daal::batch
Definition: daal_defines.h:110
daal::algorithms::multinomial_naive_bayes::prediction::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: multinomial_naive_bayes_predict.h:116
daal::algorithms::multinomial_naive_bayes::prediction::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: multinomial_naive_bayes_predict.h:134
daal::algorithms::classifier::prediction::prediction
Definition: classifier_predict_types.h:76
daal::algorithms::multinomial_naive_bayes::prediction::interface1::Batch::input
InputType input
Definition: multinomial_naive_bayes_predict.h:99
daal::algorithms::multinomial_naive_bayes::prediction::interface1::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: multinomial_naive_bayes_predict.h:128