49 #ifndef __IMPLICIT_ALS_PREDICT_RATINGS_BATCH_H__
50 #define __IMPLICIT_ALS_PREDICT_RATINGS_BATCH_H__
52 #include "algorithms/algorithm.h"
53 #include "algorithms/implicit_als/implicit_als_predict_ratings_types.h"
59 namespace implicit_als
79 template<
typename algorithmFPType, Method method, CpuType cpu>
80 class DAAL_EXPORT BatchContainer :
public PredictionContainerIface
88 BatchContainer(daal::services::Environment::env *daalEnv);
95 services::Status compute() DAAL_C11_OVERRIDE;
109 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
110 class Batch :
public daal::algorithms::Prediction
130 Batch(
const Batch<algorithmFPType, method> &other) : input(other.input), parameter(other.parameter)
141 ResultPtr getResult()
150 services::Status setResult(
const ResultPtr &result)
152 DAAL_CHECK(result, services::ErrorNullResult)
154 _res = _result.get();
155 return services::Status();
162 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
169 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
171 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
177 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
179 return new Batch<algorithmFPType, method>(*this);
182 services::Status allocateResult() DAAL_C11_OVERRIDE
184 services::Status s = _result->allocate<algorithmFPType>(&input, ¶meter, (int)method);
185 _res = _result.get();
191 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
194 _result.reset(
new Result());
200 using interface1::BatchContainer;
201 using interface1::Batch;
daal::algorithms::implicit_als::prediction::ratings::interface1::Batch::parameter
Parameter parameter
Definition: implicit_als_predict_ratings_batch.h:114
daal
Definition: algorithm_base_common.h:57
daal::algorithms::implicit_als::prediction::ratings::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: implicit_als_predict_ratings_batch.h:162
daal::algorithms::Prediction
Provides prediction methods depending on the model such as linear_regression::Model. The methods of the class support different computation modes: batch, distributed, and online(see ComputeMode). Classes that implement specific algorithms of the model based data prediction are derived classes of the Prediction class. The class additionally provides virtual methods for validation of input and output parameters of the algorithms.
Definition: prediction.h:76
daal::algorithms::PredictionContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the algor...
Definition: prediction.h:66
daal::algorithms::implicit_als::prediction::ratings::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: implicit_als_predict_ratings_batch.h:150
daal::algorithms::implicit_als::prediction::ratings::interface1::Batch::input
Input input
Definition: implicit_als_predict_ratings_batch.h:113
daal::algorithms::implicit_als::prediction::ratings::interface1::BatchContainer
Provides methods to run implementations of the implicit ALS ratings prediction algorithm in the batch...
Definition: implicit_als_predict_ratings_batch.h:80
daal::batch
Definition: daal_defines.h:131
daal::algorithms::implicit_als::prediction::ratings::interface1::Batch::getResult
ResultPtr getResult()
Definition: implicit_als_predict_ratings_batch.h:141
daal::algorithms::classifier::prediction::prediction
Definition: classifier_predict_types.h:102
daal::algorithms::implicit_als::prediction::ratings::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: implicit_als_predict_ratings_batch.h:130
daal::algorithms::implicit_als::prediction::ratings::interface1::Batch::Batch
Batch()
Definition: implicit_als_predict_ratings_batch.h:119
daal::algorithms::implicit_als::prediction::ratings::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: implicit_als_predict_ratings_batch.h:169
daal::services::ErrorNullResult
Definition: error_indexes.h:122
daal::algorithms::implicit_als::prediction::ratings::interface1::Batch
Predicts the results of the implicit ALS algorithm.
Definition: implicit_als_predict_ratings_batch.h:110