C++ API Reference for Intel® Data Analytics Acceleration Library 2018 Update 2

classifier_training_online.h
1 /* file: classifier_training_online.h */
2 /*******************************************************************************
3 * Copyright 2014-2018 Intel Corporation
4 * All Rights Reserved.
5 *
6 * If this software was obtained under the Intel Simplified Software License,
7 * the following terms apply:
8 *
9 * The source code, information and material ("Material") contained herein is
10 * owned by Intel Corporation or its suppliers or licensors, and title to such
11 * Material remains with Intel Corporation or its suppliers or licensors. The
12 * Material contains proprietary information of Intel or its suppliers and
13 * licensors. The Material is protected by worldwide copyright laws and treaty
14 * provisions. No part of the Material may be used, copied, reproduced,
15 * modified, published, uploaded, posted, transmitted, distributed or disclosed
16 * in any way without Intel's prior express written permission. No license under
17 * any patent, copyright or other intellectual property rights in the Material
18 * is granted to or conferred upon you, either expressly, by implication,
19 * inducement, estoppel or otherwise. Any license under such intellectual
20 * property rights must be express and approved by Intel in writing.
21 *
22 * Unless otherwise agreed by Intel in writing, you may not remove or alter this
23 * notice or any other notice embedded in Materials by Intel or Intel's
24 * suppliers or licensors in any way.
25 *
26 *
27 * If this software was obtained under the Apache License, Version 2.0 (the
28 * "License"), the following terms apply:
29 *
30 * You may not use this file except in compliance with the License. You may
31 * obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
32 *
33 *
34 * Unless required by applicable law or agreed to in writing, software
35 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
36 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37 *
38 * See the License for the specific language governing permissions and
39 * limitations under the License.
40 *******************************************************************************/
41 
42 /*
43 //++
44 // Implementation of the interface for the classifier model training algorithm.
45 //--
46 */
47 
48 #ifndef __CLASSIFIER_TRAINING_ONLINE_H__
49 #define __CLASSIFIER_TRAINING_ONLINE_H__
50 
51 #include "services/daal_defines.h"
52 
53 namespace daal
54 {
55 namespace algorithms
56 {
57 namespace classifier
58 {
59 namespace training
60 {
61 
62 namespace interface1
63 {
81 class DAAL_EXPORT Online : public Training<online>
82 {
83 public:
84  typedef algorithms::classifier::training::Input InputType;
85  typedef algorithms::classifier::Parameter ParameterType;
86  typedef algorithms::classifier::training::Result ResultType;
87  typedef algorithms::classifier::training::PartialResult PartialResultType;
88 
89  InputType input;
91  Online()
92  {
93  initialize();
94  }
95 
102  Online(const Online &other) : input(other.input)
103  {
104  initialize();
105  }
106 
107  virtual ~Online() {}
108 
114  services::Status setPartialResult(const PartialResultPtr &partialResult, bool initFlag = false)
115  {
116  DAAL_CHECK(partialResult, services::ErrorNullPartialResult)
117  _partialResult = partialResult;
118  _pres = _partialResult.get();
119  setInitFlag(initFlag);
120  return services::Status();
121  }
122 
127  services::Status setResult(const ResultPtr& res)
128  {
129  DAAL_CHECK(res, services::ErrorNullResult)
130  _result = res;
131  _res = _result.get();
132  return services::Status();
133  }
134 
139  PartialResultPtr getPartialResult() { return _partialResult; }
140 
145  ResultPtr getResult() { return _result; }
146 
152  services::SharedPtr<Online> clone() const
153  {
154  return services::SharedPtr<Online>(cloneImpl());
155  }
156 
157 protected:
158  PartialResultPtr _partialResult;
159  ResultPtr _result;
160 
161  void initialize()
162  {
163  _in = &input;
164  }
165  virtual Online * cloneImpl() const DAAL_C11_OVERRIDE = 0;
166 };
168 } // namespace interface1
169 using interface1::Online;
170 
171 }
172 }
173 }
174 }
175 #endif
daal::algorithms::classifier::training::interface1::Online::clone
services::SharedPtr< Online > clone() const
Definition: classifier_training_online.h:152
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:134
daal::algorithms::classifier::training::interface1::Online::Online
Online(const Online &other)
Definition: classifier_training_online.h:102
daal::algorithms::classifier::training::interface1::Online::input
InputType input
Definition: classifier_training_online.h:89
daal::services::interface1::Status
Class that holds the results of API calls. In case of API routine failure it contains the list of err...
Definition: error_handling.h:491
daal
Definition: algorithm_base_common.h:57
daal::algorithms::classifier::interface1::Parameter
Base class for the parameters of the classification algorithm.
Definition: classifier_model.h:81
daal::algorithms::classifier::training::interface1::Online
Algorithm class for training the classifier model in the online processing mode.
Definition: classifier_training_online.h:81
daal::services::ErrorNullPartialResult
Definition: error_indexes.h:131
daal_defines.h
daal::services::interface1::SharedPtr
Shared pointer that retains shared ownership of an object through a pointer. Several SharedPtr object...
Definition: daal_shared_ptr.h:187
daal::services::interface1::SharedPtr::get
T * get() const
Definition: daal_shared_ptr.h:332
daal::algorithms::classifier::training::interface1::PartialResult
Provides methods to access partial results obtained with the compute() method of the classifier train...
Definition: classifier_training_types.h:175
daal::algorithms::classifier::training::interface1::Online::setResult
services::Status setResult(const ResultPtr &res)
Definition: classifier_training_online.h:127
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:222
daal::algorithms::classifier::training::interface1::Online::getPartialResult
PartialResultPtr getPartialResult()
Definition: classifier_training_online.h:139
daal::algorithms::classifier::training::interface1::Online::setPartialResult
services::Status setPartialResult(const PartialResultPtr &partialResult, bool initFlag=false)
Definition: classifier_training_online.h:114
daal::algorithms::classifier::training::interface1::Online::getResult
ResultPtr getResult()
Definition: classifier_training_online.h:145
daal::services::ErrorNullResult
Definition: error_indexes.h:122
daal::algorithms::Training
Provides methods to train models that depend on the data provided. For example, these methods enable ...
Definition: training.h:86

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