C++ API Reference for Intel® Data Analytics Acceleration Library 2020 Update 1

classifier_training_batch.h
1 /* file: classifier_training_batch.h */
2 /*******************************************************************************
3 * Copyright 2014-2020 Intel Corporation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *******************************************************************************/
17 
18 /*
19 //++
20 // Implementation of the interface for the classifier model training algorithm.
21 //--
22 */
23 
24 #ifndef __CLASSIFIER_TRAINING_BATCH_H__
25 #define __CLASSIFIER_TRAINING_BATCH_H__
26 
27 #include "algorithms/algorithm.h"
28 #include "algorithms/classifier/classifier_training_types.h"
29 
30 namespace daal
31 {
32 namespace algorithms
33 {
34 namespace classifier
35 {
36 namespace training
37 {
38 
39 namespace interface1
40 {
58 class Batch : public Training<batch>
59 {
60 public:
61  typedef algorithms::classifier::training::interface1::Input InputType;
62  typedef algorithms::classifier::interface1::Parameter ParameterType;
63  typedef algorithms::classifier::training::interface1::Result ResultType;
64 
65  virtual ~Batch()
66  {}
67 
72  DAAL_DEPRECATED_VIRTUAL virtual InputType * getInput() = 0;
73 
78  DAAL_DEPRECATED services::Status setResult(const ResultPtr& res)
79  {
80  DAAL_CHECK(res, services::ErrorNullResult)
81  _result = res;
82  _res = _result.get();
83  return services::Status();
84  }
85 
90  DAAL_DEPRECATED ResultPtr getResult() { return _result; }
91 
96  DAAL_DEPRECATED_VIRTUAL virtual services::Status resetResult() = 0;
97 
103  DAAL_DEPRECATED services::SharedPtr<Batch> clone() const
104  {
105  return services::SharedPtr<Batch>(cloneImpl());
106  }
107 
108 protected:
109 
110  virtual Batch * cloneImpl() const DAAL_C11_OVERRIDE = 0;
111  ResultPtr _result;
112 };
114 } // namespace interface1
115 
116 namespace interface2
117 {
135 class Batch : public Training<batch>
136 {
137 public:
138  typedef algorithms::classifier::training::Input InputType;
139  typedef algorithms::classifier::Parameter ParameterType;
140  typedef algorithms::classifier::training::Result ResultType;
141 
142  virtual ~Batch()
143  {}
144 
149  virtual InputType * getInput() = 0;
150 
155  ParameterType& parameter() { return *static_cast<ParameterType*>(this->getBaseParameter()); }
156 
161  // const ParameterType& parameter() const { return *static_cast<const ParameterType*>(this->getBaseParameter()); }
162 
163 
168  services::Status setResult(const ResultPtr& res)
169  {
170  DAAL_CHECK(res, services::ErrorNullResult)
171  _result = res;
172  _res = _result.get();
173  return services::Status();
174  }
175 
180  ResultPtr getResult() { return _result; }
181 
186  virtual services::Status resetResult() = 0;
187 
193  services::SharedPtr<Batch> clone() const
194  {
195  return services::SharedPtr<Batch>(cloneImpl());
196  }
197 
198 protected:
199 
200  virtual Batch * cloneImpl() const DAAL_C11_OVERRIDE = 0;
201  ResultPtr _result;
202 };
204 } // namespace interface2
205 using interface2::Batch;
206 
207 }
208 }
209 }
210 }
211 #endif
daal::algorithms::classifier::training::interface1::Result
Provides methods to access final results obtained with the compute() method in the batch processing m...
Definition: classifier_training_types.h:198
daal::algorithms::classifier::training::interface1::Batch
Algorithm class for training the classifier model.
Definition: classifier_training_batch.h:58
daal::algorithms::classifier::training::interface1::Batch::setResult
DAAL_DEPRECATED services::Status setResult(const ResultPtr &res)
Definition: classifier_training_batch.h:78
daal::algorithms::classifier::training::interface2::Batch::getResult
ResultPtr getResult()
Definition: classifier_training_batch.h:180
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::classifier::training::interface1::Batch::resetResult
virtual DAAL_DEPRECATED_VIRTUAL services::Status resetResult()=0
daal::algorithms::classifier::training::interface1::Batch::clone
DAAL_DEPRECATED services::SharedPtr< Batch > clone() const
Definition: classifier_training_batch.h:103
daal::algorithms::classifier::training::interface2::Batch
Algorithm class for training the classifier model.
Definition: classifier_training_batch.h:135
daal::algorithms::classifier::training::interface1::Batch::getInput
virtual DAAL_DEPRECATED_VIRTUAL InputType * getInput()=0
daal::algorithms::classifier::training::interface2::Batch::clone
services::SharedPtr< Batch > clone() const
Definition: classifier_training_batch.h:193
daal::algorithms::Training
Provides methods to train models that depend on the data provided. For example, these methods enable ...
Definition: training.h:62
daal::algorithms::classifier::interface1::Parameter
Base class for the parameters of the classification algorithm.
Definition: classifier_model.h:69
daal::algorithms::classifier::training::interface1::Input
Base class for the input objects in the training stage of the classification algorithms.
Definition: classifier_training_types.h:110
daal::algorithms::classifier::training::interface1::Batch::getResult
DAAL_DEPRECATED ResultPtr getResult()
Definition: classifier_training_batch.h:90
daal::algorithms::classifier::training::interface2::Batch::setResult
services::Status setResult(const ResultPtr &res)
Definition: classifier_training_batch.h:168
daal::algorithms::classifier::training::interface2::Batch::parameter
ParameterType & parameter()
Definition: classifier_training_batch.h:155

For more complete information about compiler optimizations, see our Optimization Notice.