24 #ifndef __ELASTIC_NET_PREDICT_H__
25 #define __ELASTIC_NET_PREDICT_H__
27 #include "algorithms/algorithm.h"
28 #include "services/daal_defines.h"
29 #include "algorithms/elastic_net/elastic_net_predict_types.h"
30 #include "algorithms/linear_model/linear_model_predict.h"
60 template <
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
61 class Batch :
public linear_model::prediction::Batch<algorithmFPType, linear_model::prediction::defaultDense>
64 typedef linear_model::prediction::Batch<algorithmFPType, linear_model::prediction::defaultDense> super;
66 typedef algorithms::elastic_net::prediction::Input InputType;
67 typedef typename super::ParameterType ParameterType;
68 typedef algorithms::elastic_net::prediction::Result ResultType;
73 Batch() { initialize(); }
81 Batch(
const Batch<algorithmFPType, defaultDense> & other) : input(other.input) { initialize(); }
87 virtual int getMethod() const DAAL_C11_OVERRIDE {
return (
int)defaultDense; }
93 ResultPtr getResult() {
return ResultType::cast(this->_result); }
100 services::SharedPtr<Batch<algorithmFPType, defaultDense> > clone()
const
102 return services::SharedPtr<Batch<algorithmFPType, defaultDense> >(cloneImpl());
105 virtual regression::prediction::Input * getInput() DAAL_C11_OVERRIDE {
return &input; }
108 virtual Batch<algorithmFPType, defaultDense> * cloneImpl() const DAAL_C11_OVERRIDE {
return new Batch<algorithmFPType, defaultDense>(*this); }
110 services::Status allocateResult() DAAL_C11_OVERRIDE
112 services::Status s = getResult()->template allocate<algorithmFPType>(this->_in, 0, 0);
113 this->_res = this->_result.get();
119 this->_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, linear_model::prediction::BatchContainer, algorithmFPType,
120 linear_model::prediction::defaultDense)(&(this->_env));
123 this->_result.reset(
new ResultType());
127 Batch& operator=(
const Batch&);
131 using interface1::Batch;
daal::algorithms::elastic_net::prediction::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, defaultDense > > clone() const
Definition: elastic_net_predict.h:100
daal::algorithms::elastic_net::prediction::interface1::Batch::input
InputType input
Definition: elastic_net_predict.h:70
daal::batch
Definition: daal_defines.h:112
daal::algorithms::neural_networks::prediction::prediction
Definition: neural_networks_prediction_result.h:55
daal::algorithms::elastic_net::prediction::interface1::Batch::Batch
Batch()
Definition: elastic_net_predict.h:73
daal::algorithms::elastic_net::prediction::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: elastic_net_predict.h:87
daal::algorithms::linear_model::prediction::defaultDense
Definition: linear_model_predict_types.h:55
daal::algorithms::elastic_net::prediction::interface1::Batch::getResult
ResultPtr getResult()
Definition: elastic_net_predict.h:93
daal::algorithms::elastic_net::prediction::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, defaultDense > &other)
Definition: elastic_net_predict.h:81
daal::algorithms::elastic_net::prediction::interface1::Batch
Provides methods to run implementations of the elastic net model-based prediction.
Definition: elastic_net_predict.h:61