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

classifier_training_online.h
1 /* file: classifier_training_online.h */
2 /*******************************************************************************
3 * Copyright 2014-2018 Intel Corporation.
4 *
5 * This software and the related documents are Intel copyrighted materials, and
6 * your use of them is governed by the express license under which they were
7 * provided to you (License). Unless the License provides otherwise, you may not
8 * use, modify, copy, publish, distribute, disclose or transmit this software or
9 * the related documents without Intel's prior written permission.
10 *
11 * This software and the related documents are provided as is, with no express
12 * or implied warranties, other than those that are expressly stated in the
13 * License.
14 *******************************************************************************/
15 
16 /*
17 //++
18 // Implementation of the interface for the classifier model training algorithm.
19 //--
20 */
21 
22 #ifndef __CLASSIFIER_TRAINING_ONLINE_H__
23 #define __CLASSIFIER_TRAINING_ONLINE_H__
24 
25 #include "services/daal_defines.h"
26 
27 namespace daal
28 {
29 namespace algorithms
30 {
31 namespace classifier
32 {
33 namespace training
34 {
35 
36 namespace interface1
37 {
55 class DAAL_EXPORT Online : public Training<online>
56 {
57 public:
58  typedef algorithms::classifier::training::Input InputType;
59  typedef algorithms::classifier::Parameter ParameterType;
60  typedef algorithms::classifier::training::Result ResultType;
61  typedef algorithms::classifier::training::PartialResult PartialResultType;
62 
63  InputType input;
65  Online()
66  {
67  initialize();
68  }
69 
76  Online(const Online &other) : input(other.input)
77  {
78  initialize();
79  }
80 
81  virtual ~Online() {}
82 
88  services::Status setPartialResult(const PartialResultPtr &partialResult, bool initFlag = false)
89  {
90  DAAL_CHECK(partialResult, services::ErrorNullPartialResult)
91  _partialResult = partialResult;
92  _pres = _partialResult.get();
93  setInitFlag(initFlag);
94  return services::Status();
95  }
96 
101  services::Status setResult(const ResultPtr& res)
102  {
103  DAAL_CHECK(res, services::ErrorNullResult)
104  _result = res;
105  _res = _result.get();
106  return services::Status();
107  }
108 
113  PartialResultPtr getPartialResult() { return _partialResult; }
114 
119  ResultPtr getResult() { return _result; }
120 
126  services::SharedPtr<Online> clone() const
127  {
128  return services::SharedPtr<Online>(cloneImpl());
129  }
130 
131 protected:
132  PartialResultPtr _partialResult;
133  ResultPtr _result;
134 
135  void initialize()
136  {
137  _in = &input;
138  }
139  virtual Online * cloneImpl() const DAAL_C11_OVERRIDE = 0;
140 };
142 } // namespace interface1
143 using interface1::Online;
144 
145 }
146 }
147 }
148 }
149 #endif
daal::algorithms::classifier::training::interface1::Online::Online
Online(const Online &other)
Definition: classifier_training_online.h:76
daal::algorithms::classifier::training::interface1::Online::input
InputType input
Definition: classifier_training_online.h:63
daal
Definition: algorithm_base_common.h:31
daal::algorithms::classifier::training::interface1::Online::clone
services::SharedPtr< Online > clone() const
Definition: classifier_training_online.h:126
daal::algorithms::classifier::training::interface1::Online
Algorithm class for training the classifier model in the online processing mode.
Definition: classifier_training_online.h:55
daal::services::ErrorNullPartialResult
Definition: error_indexes.h:105
daal_defines.h
daal::algorithms::classifier::training::interface1::Online::setResult
services::Status setResult(const ResultPtr &res)
Definition: classifier_training_online.h:101
daal::algorithms::classifier::training::interface1::Online::getPartialResult
PartialResultPtr getPartialResult()
Definition: classifier_training_online.h:113
daal::algorithms::classifier::training::interface1::Online::setPartialResult
services::Status setPartialResult(const PartialResultPtr &partialResult, bool initFlag=false)
Definition: classifier_training_online.h:88
daal::algorithms::classifier::training::interface1::Online::getResult
ResultPtr getResult()
Definition: classifier_training_online.h:119
daal::services::ErrorNullResult
Definition: error_indexes.h:96
daal::algorithms::Training
Provides methods to train models that depend on the data provided. For example, these methods enable ...
Definition: training.h:60

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