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

stump_model.h
1 /* file: stump_model.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 class defining the decision stump model.
21 //--
22 */
23 
24 #ifndef __STUMP_MODEL_H__
25 #define __STUMP_MODEL_H__
26 
27 #include "algorithms/algorithm.h"
28 #include "data_management/data/homogen_numeric_table.h"
29 #include "data_management/data/matrix.h"
30 #include "algorithms/weak_learner/weak_learner_model.h"
31 
32 namespace daal
33 {
34 namespace algorithms
35 {
42 namespace stump
43 {
44 
48 namespace interface1
49 {
58 class DAAL_EXPORT Model : public weak_learner::Model
59 {
60 public:
61  DECLARE_MODEL(Model, classifier::Model);
62 
70  template<typename modelFPType>
71  DAAL_EXPORT Model(size_t nFeatures, modelFPType dummy);
72 
80  template<typename modelFPType>
81  DAAL_EXPORT static services::SharedPtr<Model> create(size_t nFeatures, services::Status *stat = NULL);
82 
86  Model();
87 
92  size_t getSplitFeature();
93 
98  void setSplitFeature(size_t splitFeature);
99 
104  template<typename modelFPType>
105  DAAL_EXPORT modelFPType getSplitValue();
106 
111  template<typename modelFPType>
112  DAAL_EXPORT void setSplitValue(modelFPType splitValue);
113 
118  template<typename modelFPType>
119  DAAL_EXPORT modelFPType getLeftSubsetAverage();
120 
125  template<typename modelFPType>
126  DAAL_EXPORT void setLeftSubsetAverage(modelFPType leftSubsetAverage);
127 
132  template<typename modelFPType>
133  DAAL_EXPORT modelFPType getRightSubsetAverage();
134 
139  template<typename modelFPType>
140  DAAL_EXPORT void setRightSubsetAverage(modelFPType rightSubsetAverage);
141 
146  size_t getNumberOfFeatures() const DAAL_C11_OVERRIDE { return _nFeatures; }
147 
148 protected:
149  size_t _nFeatures;
151  size_t _splitFeature;
152  services::SharedPtr<data_management::Matrix<double> > _values;
157  template<typename modelFPType>
158  DAAL_EXPORT Model(size_t nFeatures, modelFPType dummy, services::Status &st);
159 
161  template<typename Archive, bool onDeserialize>
162  services::Status serialImpl(Archive *arch)
163  {
164  services::Status st = classifier::Model::serialImpl<Archive, onDeserialize>(arch);
165  if (!st)
166  return st;
167  arch->set(_nFeatures);
168  arch->set(_splitFeature);
169  arch->setSharedPtrObj(_values);
170 
171  return st;
172  }
173 };
174 typedef services::SharedPtr<Model> ModelPtr;
175 } // namespace interface1
176 using interface1::Model;
177 using interface1::ModelPtr;
178 
179 }
181 }
182 } // namespace daal
183 #endif
daal::algorithms::interface1::Model
The base class for the classes that represent the models, such as linear_regression::Model or svm::Mo...
Definition: model.h:54
daal::algorithms::stump::interface1::Model::_nFeatures
size_t _nFeatures
Definition: stump_model.h:149
daal::algorithms::stump::interface1::Model::_splitFeature
size_t _splitFeature
Definition: stump_model.h:151
daal::algorithms::stump::interface1::Model
Model of the classifier trained by the stump::training::Batch algorithm.
Definition: stump_model.h:58
daal::algorithms::stump::interface1::Model::_values
services::SharedPtr< data_management::Matrix< double > > _values
Definition: stump_model.h:152
daal::algorithms::stump::interface1::Model::getNumberOfFeatures
size_t getNumberOfFeatures() const DAAL_C11_OVERRIDE
Definition: stump_model.h:146

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