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

stump_classification_model.h
1 /* file: stump_classification_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_CLASSIFICATION_MODEL_H__
25 #define __STUMP_CLASSIFICATION_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/classifier/classifier_model.h"
31 #include "algorithms/decision_tree/decision_tree_classification_model.h"
32 
33 namespace daal
34 {
35 namespace algorithms
36 {
43 namespace stump
44 {
45 namespace classification
46 {
51 enum VariableImportanceMode
52 {
53  none /* Do not compute */
54 };
55 
59 namespace interface1
60 {
61 
62 // CLARIFICATION:: Added parameter class to support different split criterions for stump.
69 /* [Parameter source code] */
70 struct DAAL_EXPORT Parameter : public daal::algorithms::classifier::Parameter
71 {
76  Parameter(size_t nClasses = 2) : daal::algorithms::classifier::Parameter(nClasses),
77  splitCriterion(decision_tree::classification::gini),
78  varImportance(none) {}
79  decision_tree::classification::SplitCriterion splitCriterion;
80  VariableImportanceMode varImportance;
85  services::Status check() const DAAL_C11_OVERRIDE;
86 };
87 /* [Parameter source code] */
88 
97 class DAAL_EXPORT Model : public daal::algorithms::decision_tree::classification::Model
98 {
99 public:
100  DECLARE_MODEL_IFACE(Model, decision_tree::classification::Model);
101 
110  static services::SharedPtr<Model> create(size_t nFeatures = 0, size_t nClasses = 2, services::Status *stat = NULL);
111 
115  Model();
116 
117  virtual ~Model();
118 
123  size_t getSplitFeature() const;
124 
129  template<typename modelFPType>
130  DAAL_EXPORT modelFPType getSplitValue();
131 
136  template<typename modelFPType>
137  DAAL_EXPORT modelFPType getLeftValue();
138 
143  template<typename modelFPType>
144  DAAL_EXPORT modelFPType getRightValue();
145 
146 protected:
147  Model(size_t nFeatures, size_t nClasses, services::Status &st);
148 
149  services::Status serializeImpl(data_management::InputDataArchive * arch) DAAL_C11_OVERRIDE;
150 
151  services::Status deserializeImpl(const data_management::OutputDataArchive * arch) DAAL_C11_OVERRIDE;
152 
153 private:
154  size_t _nClasses;
155 
156 };
157 
158 typedef services::SharedPtr<Model> ModelPtr;
159 typedef services::SharedPtr<const Model> ModelConstPtr;
160 
161 }
162 
163 using interface1::Parameter;
164 using interface1::Model;
165 using interface1::ModelPtr;
166 using interface1::ModelConstPtr;
167 
168 }
170 }
171 }
172 } // namespace daal
173 #endif
daal::algorithms::decision_forest::training::VariableImportanceMode
VariableImportanceMode
Variable importance computation mode.
Definition: decision_forest_training_parameter.h:60
daal::algorithms::decision_tree::classification::SplitCriterion
SplitCriterion
Split criterion for Decision tree classification algorithm.
Definition: decision_tree_classification_model.h:62
daal::algorithms::stump::classification::interface1::Parameter::Parameter
Parameter(size_t nClasses=2)
Definition: stump_classification_model.h:76
daal::algorithms::stump::classification::interface1::Parameter::splitCriterion
decision_tree::classification::SplitCriterion splitCriterion
Definition: stump_classification_model.h:79
daal::algorithms::stump::classification::interface1::Parameter::varImportance
VariableImportanceMode varImportance
Definition: stump_classification_model.h:80
daal::algorithms::stump::classification::interface1::Parameter
Stump algorithm parameters.
Definition: stump_classification_model.h:70
daal::algorithms::stump::classification::interface1::Model
Model of the classifier trained by the stump::classification::training::Batch algorithm.
Definition: stump_classification_model.h:97

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