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

stump_model.h
1 /* file: stump_model.h */
2 /*******************************************************************************
3 * Copyright 2014-2017 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 class defining the decision stump model.
45 //--
46 */
47 
48 #ifndef __STUMP_MODEL_H__
49 #define __STUMP_MODEL_H__
50 
51 #include "algorithms/algorithm.h"
52 #include "data_management/data/homogen_numeric_table.h"
53 #include "data_management/data/matrix.h"
54 #include "algorithms/weak_learner/weak_learner_model.h"
55 
56 namespace daal
57 {
58 namespace algorithms
59 {
66 namespace stump
67 {
68 
72 namespace interface1
73 {
82 class DAAL_EXPORT Model : public weak_learner::Model
83 {
84 public:
85  DECLARE_MODEL(Model, classifier::Model);
86 
94  template<typename modelFPType>
95  DAAL_EXPORT Model(size_t nFeatures, modelFPType dummy);
96 
104  template<typename modelFPType>
105  DAAL_EXPORT static services::SharedPtr<Model> create(size_t nFeatures, services::Status *stat = NULL);
106 
110  Model();
111 
116  size_t getSplitFeature();
117 
122  void setSplitFeature(size_t splitFeature);
123 
128  template<typename modelFPType>
129  DAAL_EXPORT modelFPType getSplitValue();
130 
135  template<typename modelFPType>
136  DAAL_EXPORT void setSplitValue(modelFPType splitValue);
137 
142  template<typename modelFPType>
143  DAAL_EXPORT modelFPType getLeftSubsetAverage();
144 
149  template<typename modelFPType>
150  DAAL_EXPORT void setLeftSubsetAverage(modelFPType leftSubsetAverage);
151 
156  template<typename modelFPType>
157  DAAL_EXPORT modelFPType getRightSubsetAverage();
158 
163  template<typename modelFPType>
164  DAAL_EXPORT void setRightSubsetAverage(modelFPType rightSubsetAverage);
165 
170  size_t getNumberOfFeatures() const DAAL_C11_OVERRIDE { return _nFeatures; }
171 
172 protected:
173  size_t _nFeatures;
175  size_t _splitFeature;
176  services::SharedPtr<data_management::Matrix<double> > _values;
181  template<typename modelFPType>
182  DAAL_EXPORT Model(size_t nFeatures, modelFPType dummy, services::Status &st);
183 
185  template<typename Archive, bool onDeserialize>
186  services::Status serialImpl(Archive *arch)
187  {
188  services::Status st = classifier::Model::serialImpl<Archive, onDeserialize>(arch);
189  if (!st)
190  return st;
191  arch->set(_nFeatures);
192  arch->set(_splitFeature);
193  arch->setSharedPtrObj(_values);
194 
195  return st;
196  }
197 };
198 typedef services::SharedPtr<Model> ModelPtr;
199 } // namespace interface1
200 using interface1::Model;
201 using interface1::ModelPtr;
202 
203 }
205 }
206 } // namespace daal
207 #endif
daal
Definition: algorithm_base_common.h:57
daal::algorithms::stump::interface1::Model
Model of the classifier trained by the stump::training::Batch algorithm.
Definition: stump_model.h:82
daal::algorithms::stump::interface1::Model::_splitFeature
size_t _splitFeature
Definition: stump_model.h:175
daal::algorithms::stump::interface1::Model::getNumberOfFeatures
size_t getNumberOfFeatures() const DAAL_C11_OVERRIDE
Definition: stump_model.h:170
daal::algorithms::stump::interface1::Model::_nFeatures
size_t _nFeatures
Definition: stump_model.h:173
daal::algorithms::stump::interface1::Model::_values
services::SharedPtr< data_management::Matrix< double > > _values
Definition: stump_model.h:176
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:78

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