22 #ifndef __LOGISTIC_REGRESSION_PREDICT_H__
23 #define __LOGISTIC_REGRESSION_PREDICT_H__
25 #include "algorithms/algorithm.h"
26 #include "algorithms/classifier/classifier_predict.h"
27 #include "algorithms/logistic_regression/logistic_regression_model.h"
28 #include "algorithms/logistic_regression/logistic_regression_predict_types.h"
34 namespace logistic_regression
61 template<
typename algorithmFPType, Method method, CpuType cpu>
62 class DAAL_EXPORT BatchContainer :
public PredictionContainerIface
69 BatchContainer(daal::services::Environment::env *daalEnv);
76 services::Status compute() DAAL_C11_OVERRIDE;
99 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
100 class DAAL_EXPORT Batch :
public classifier::prediction::Batch
103 typedef classifier::prediction::Batch super;
105 typedef algorithms::logistic_regression::prediction::Input InputType;
106 typedef algorithms::logistic_regression::prediction::Parameter ParameterType;
107 typedef algorithms::logistic_regression::prediction::Result ResultType;
113 Batch(
size_t nClasses);
121 Batch(
const Batch<algorithmFPType, method> &other);
133 ParameterType& parameter() {
return *
static_cast<ParameterType*
>(_par); }
139 const ParameterType& parameter()
const {
return *
static_cast<const ParameterType*
>(_par); }
145 InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
151 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
158 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
160 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
167 ResultPtr getResult() {
return ResultType::cast(_result); }
173 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
175 return new Batch<algorithmFPType, method>(*this);
178 services::Status allocateResult() DAAL_C11_OVERRIDE
180 services::Status s =
static_cast<ResultType*
>(_result.get())->allocate<algorithmFPType>(&input, _par, 0);
181 _res = _result.get();
188 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
189 _result.reset(
new ResultType());
194 using interface1::BatchContainer;
195 using interface1::Batch;
daal::algorithms::logistic_regression::prediction::interface1::Batch::parameter
ParameterType & parameter()
Definition: logistic_regression_predict.h:133
daal::algorithms::logistic_regression::prediction::interface1::BatchContainer
Provides methods to run implementations of the logistic regression algorithm. This class is associate...
Definition: logistic_regression_predict.h:62
daal
Definition: algorithm_base_common.h:31
daal::algorithms::logistic_regression::prediction::interface1::Batch::input
InputType input
Definition: logistic_regression_predict.h:170
daal::algorithms::logistic_regression::prediction::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: logistic_regression_predict.h:151
daal::algorithms::PredictionContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the algor...
Definition: prediction.h:40
daal::algorithms::logistic_regression::prediction::interface1::Batch
Predicts logistic regression results.
Definition: logistic_regression_predict.h:100
daal::algorithms::logistic_regression::prediction::interface1::Batch::getResult
ResultPtr getResult()
Definition: logistic_regression_predict.h:167
daal::batch
Definition: daal_defines.h:106
daal::algorithms::logistic_regression::prediction::interface1::Batch::parameter
const ParameterType & parameter() const
Definition: logistic_regression_predict.h:139
daal::algorithms::logistic_regression::prediction::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: logistic_regression_predict.h:158
daal::algorithms::logistic_regression::prediction::interface1::Batch::~Batch
~Batch()
Definition: logistic_regression_predict.h:124
daal::algorithms::classifier::prediction::prediction
Definition: classifier_predict_types.h:76
daal::algorithms::logistic_regression::prediction::interface1::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: logistic_regression_predict.h:145