24 #ifndef __LOGISTIC_REGRESSION_PREDICT_H__
25 #define __LOGISTIC_REGRESSION_PREDICT_H__
27 #include "algorithms/algorithm.h"
28 #include "algorithms/classifier/classifier_predict.h"
29 #include "algorithms/logistic_regression/logistic_regression_model.h"
30 #include "algorithms/logistic_regression/logistic_regression_predict_types.h"
36 namespace logistic_regression
63 template<
typename algorithmFPType, Method method, CpuType cpu>
64 class BatchContainer :
public PredictionContainerIface
71 DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv);
73 DAAL_DEPRECATED ~BatchContainer();
78 DAAL_DEPRECATED services::Status compute() DAAL_C11_OVERRIDE;
101 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
102 class DAAL_EXPORT Batch :
public classifier::prediction::interface1::Batch
105 typedef classifier::prediction::interface1::Batch super;
107 typedef algorithms::logistic_regression::prediction::Input InputType;
108 typedef algorithms::logistic_regression::prediction::interface1::Parameter ParameterType;
109 typedef algorithms::logistic_regression::prediction::interface1::Result ResultType;
115 DAAL_DEPRECATED Batch(
size_t nClasses);
123 DAAL_DEPRECATED Batch(
const Batch<algorithmFPType, method> &other);
126 DAAL_DEPRECATED ~Batch()
135 DAAL_DEPRECATED ParameterType& parameter() {
return *
static_cast<ParameterType*
>(_par); }
141 DAAL_DEPRECATED
const ParameterType& parameter()
const {
return *
static_cast<const ParameterType*
>(_par); }
147 DAAL_DEPRECATED InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
153 DAAL_DEPRECATED_VIRTUAL
virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
160 DAAL_DEPRECATED services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
162 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
169 DAAL_DEPRECATED interface1::ResultPtr getResult() {
return ResultType::cast(_result); }
175 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
177 return new Batch<algorithmFPType, method>(*this);
180 services::Status allocateResult() DAAL_C11_OVERRIDE
182 services::Status s =
static_cast<ResultType*
>(_result.get())->allocate<algorithmFPType>(&input, _par, 0);
183 _res = _result.get();
190 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
191 _result.reset(
new ResultType());
211 template<
typename algorithmFPType, Method method, CpuType cpu>
212 class BatchContainer :
public PredictionContainerIface
219 BatchContainer(daal::services::Environment::env *daalEnv);
226 services::Status compute() DAAL_C11_OVERRIDE;
249 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
250 class DAAL_EXPORT Batch :
public classifier::prediction::Batch
253 typedef classifier::prediction::Batch super;
255 typedef algorithms::logistic_regression::prediction::Input InputType;
256 typedef algorithms::classifier::Parameter ParameterType;
257 typedef algorithms::classifier::prediction::Result ResultType;
263 Batch(
size_t nClasses);
271 Batch(
const Batch<algorithmFPType, method> &other);
283 ParameterType& parameter() {
return *
static_cast<ParameterType*
>(_par); }
289 const ParameterType& parameter()
const {
return *
static_cast<const ParameterType*
>(_par); }
295 InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
301 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
308 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
310 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
317 classifier::prediction::ResultPtr getResult() {
return ResultType::cast(_result); }
323 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
325 return new Batch<algorithmFPType, method>(*this);
328 services::Status allocateResult() DAAL_C11_OVERRIDE
330 services::Status s =
static_cast<ResultType*
>(_result.get())->allocate<algorithmFPType>(&input, _par, 0);
331 _res = _result.get();
338 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, interface2::BatchContainer, algorithmFPType, method)(&_env);
339 _result.reset(
new ResultType());
344 using interface2::BatchContainer;
345 using interface2::Batch;
daal::algorithms::logistic_regression::prediction::interface1::Batch::parameter
DAAL_DEPRECATED ParameterType & parameter()
Definition: logistic_regression_predict.h:135
daal::algorithms::logistic_regression::prediction::interface1::Parameter
Parameters of the prediction algorithm.
Definition: logistic_regression_predict_types.h:99
daal::algorithms::logistic_regression::prediction::interface2::Batch::getResult
classifier::prediction::ResultPtr getResult()
Definition: logistic_regression_predict.h:317
daal::algorithms::logistic_regression::prediction::interface2::Batch::parameter
const ParameterType & parameter() const
Definition: logistic_regression_predict.h:289
daal::batch
Definition: daal_defines.h:112
daal::algorithms::logistic_regression::prediction::interface1::Batch::getResult
DAAL_DEPRECATED interface1::ResultPtr getResult()
Definition: logistic_regression_predict.h:169
daal::algorithms::logistic_regression::prediction::interface2::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: logistic_regression_predict.h:301
daal::algorithms::logistic_regression::prediction::interface1::Batch::getInput
DAAL_DEPRECATED InputType * getInput() DAAL_C11_OVERRIDE
Definition: logistic_regression_predict.h:147
daal::algorithms::neural_networks::prediction::prediction
Definition: neural_networks_prediction_result.h:55
daal::algorithms::logistic_regression::prediction::interface2::Batch::input
InputType input
Definition: logistic_regression_predict.h:320
daal::algorithms::logistic_regression::prediction::interface2::Batch
Predicts logistic regression results.
Definition: logistic_regression_predict.h:250
daal::algorithms::logistic_regression::prediction::interface2::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: logistic_regression_predict.h:295
daal::algorithms::logistic_regression::prediction::interface2::Batch::parameter
ParameterType & parameter()
Definition: logistic_regression_predict.h:283
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:64
daal::algorithms::logistic_regression::prediction::interface1::Batch
Predicts logistic regression results.
Definition: logistic_regression_predict.h:102
daal::algorithms::logistic_regression::prediction::interface1::Batch::clone
DAAL_DEPRECATED services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: logistic_regression_predict.h:160
daal::algorithms::classifier::prediction::interface1::Input
Input objects in the prediction stage of the classification algorithm.
Definition: classifier_predict_types.h:111
daal::algorithms::logistic_regression::prediction::interface2::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: logistic_regression_predict.h:308
daal::algorithms::logistic_regression::prediction::interface1::Batch::~Batch
DAAL_DEPRECATED ~Batch()
Definition: logistic_regression_predict.h:126
daal::algorithms::logistic_regression::prediction::interface1::Batch::input
InputType input
Definition: logistic_regression_predict.h:172
daal::algorithms::logistic_regression::prediction::interface2::BatchContainer
Provides methods to run implementations of the logistic regression algorithm. This class is associate...
Definition: logistic_regression_predict.h:212
daal::algorithms::PredictionContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the algor...
Definition: prediction.h:42
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::logistic_regression::prediction::interface1::Batch::parameter
DAAL_DEPRECATED const ParameterType & parameter() const
Definition: logistic_regression_predict.h:141
daal::algorithms::logistic_regression::prediction::interface1::BatchContainer::~BatchContainer
DAAL_DEPRECATED ~BatchContainer()
daal::algorithms::logistic_regression::prediction::interface2::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::classifier::interface1::Parameter
Base class for the parameters of the classification algorithm.
Definition: classifier_model.h:69
daal::algorithms::logistic_regression::prediction::interface1::Result
Provides interface for the result of model-based prediction.
Definition: logistic_regression_predict_types.h:163
daal::algorithms::logistic_regression::prediction::interface2::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::logistic_regression::prediction::interface1::BatchContainer::compute
DAAL_DEPRECATED services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::logistic_regression::prediction::interface1::BatchContainer::BatchContainer
DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::logistic_regression::prediction::interface2::BatchContainer::~BatchContainer
~BatchContainer()
daal::algorithms::logistic_regression::prediction::interface1::Batch::getMethod
virtual DAAL_DEPRECATED_VIRTUAL int getMethod() const DAAL_C11_OVERRIDE
Definition: logistic_regression_predict.h:153
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::logistic_regression::prediction::interface2::Batch::~Batch
~Batch()
Definition: logistic_regression_predict.h:274