C++ API Reference for Intel® Data Analytics Acceleration Library 2019 Update 5

stump_model.h
1 /* file: stump_model.h */
2 /*******************************************************************************
3 * Copyright 2014-2019 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 class defining the decision stump model.
19 //--
20 */
21 
22 #ifndef __STUMP_MODEL_H__
23 #define __STUMP_MODEL_H__
24 
25 #include "algorithms/algorithm.h"
26 #include "data_management/data/homogen_numeric_table.h"
27 #include "data_management/data/matrix.h"
28 #include "algorithms/weak_learner/weak_learner_model.h"
29 
30 namespace daal
31 {
32 namespace algorithms
33 {
40 namespace stump
41 {
42 
46 namespace interface1
47 {
56 class DAAL_EXPORT Model : public weak_learner::Model
57 {
58 public:
59  DECLARE_MODEL(Model, classifier::Model);
60 
68  template<typename modelFPType>
69  DAAL_EXPORT Model(size_t nFeatures, modelFPType dummy);
70 
78  template<typename modelFPType>
79  DAAL_EXPORT static services::SharedPtr<Model> create(size_t nFeatures, services::Status *stat = NULL);
80 
84  Model();
85 
90  size_t getSplitFeature();
91 
96  void setSplitFeature(size_t splitFeature);
97 
102  template<typename modelFPType>
103  DAAL_EXPORT modelFPType getSplitValue();
104 
109  template<typename modelFPType>
110  DAAL_EXPORT void setSplitValue(modelFPType splitValue);
111 
116  template<typename modelFPType>
117  DAAL_EXPORT modelFPType getLeftSubsetAverage();
118 
123  template<typename modelFPType>
124  DAAL_EXPORT void setLeftSubsetAverage(modelFPType leftSubsetAverage);
125 
130  template<typename modelFPType>
131  DAAL_EXPORT modelFPType getRightSubsetAverage();
132 
137  template<typename modelFPType>
138  DAAL_EXPORT void setRightSubsetAverage(modelFPType rightSubsetAverage);
139 
144  size_t getNumberOfFeatures() const DAAL_C11_OVERRIDE { return _nFeatures; }
145 
146 protected:
147  size_t _nFeatures;
149  size_t _splitFeature;
150  services::SharedPtr<data_management::Matrix<double> > _values;
155  template<typename modelFPType>
156  DAAL_EXPORT Model(size_t nFeatures, modelFPType dummy, services::Status &st);
157 
159  template<typename Archive, bool onDeserialize>
160  services::Status serialImpl(Archive *arch)
161  {
162  services::Status st = classifier::Model::serialImpl<Archive, onDeserialize>(arch);
163  if (!st)
164  return st;
165  arch->set(_nFeatures);
166  arch->set(_splitFeature);
167  arch->setSharedPtrObj(_values);
168 
169  return st;
170  }
171 };
172 typedef services::SharedPtr<Model> ModelPtr;
173 } // namespace interface1
174 using interface1::Model;
175 using interface1::ModelPtr;
176 
177 }
179 }
180 } // namespace daal
181 #endif
daal
Definition: algorithm_base_common.h:31
daal::algorithms::stump::interface1::Model
Model of the classifier trained by the stump::training::Batch algorithm.
Definition: stump_model.h:56
daal::algorithms::stump::interface1::Model::_splitFeature
size_t _splitFeature
Definition: stump_model.h:149
daal::algorithms::stump::interface1::Model::getNumberOfFeatures
size_t getNumberOfFeatures() const DAAL_C11_OVERRIDE
Definition: stump_model.h:144
daal::algorithms::stump::interface1::Model::_nFeatures
size_t _nFeatures
Definition: stump_model.h:147
daal::algorithms::stump::interface1::Model::_values
services::SharedPtr< data_management::Matrix< double > > _values
Definition: stump_model.h:150
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:52

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