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

logitboost_quality_metric_set_batch.h
1 /* file: logitboost_quality_metric_set_batch.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 // Interface for the LogitBoost quality metric set.
19 //--
20 */
21 
22 #ifndef __LOGITBOOST_QUALITY_METRIC_SET_BATCH_H__
23 #define __LOGITBOOST_QUALITY_METRIC_SET_BATCH_H__
24 
25 #include "algorithms/algorithm_quality_metric_set_batch.h"
26 #include "algorithms/classifier/multiclass_confusion_matrix_batch.h"
27 #include "algorithms/boosting/logitboost_quality_metric_set_types.h"
28 
29 namespace daal
30 {
31 namespace algorithms
32 {
33 namespace logitboost
34 {
38 namespace quality_metric_set
39 {
40 
41 namespace interface1
42 {
58 class Batch : public algorithms::quality_metric_set::Batch
59 {
60 public:
61  Parameter parameter;
67  Batch(size_t nClasses = 2, bool useDefaultMetrics = true) :
68  algorithms::quality_metric_set::Batch(useDefaultMetrics),
69  parameter(nClasses)
70  {
71  _inputData = InputDataCollectionPtr(new InputDataCollection());
72  if (_useDefaultMetrics)
73  {
74  initializeQualityMetrics();
75  }
76  _resultCollection = ResultCollectionPtr(new ResultCollection());
77  }
78 
79  virtual ~Batch() {}
80 
85  ResultCollectionPtr getResultCollection()
86  {
87  return services::staticPointerCast<ResultCollection,
88  algorithms::quality_metric_set::ResultCollection>(_resultCollection);
89  }
90 
95  InputDataCollectionPtr getInputDataCollection()
96  {
97  return services::staticPointerCast<InputDataCollection,
98  algorithms::quality_metric_set::InputDataCollection>(_inputData);
99  }
100 
101 protected:
102  virtual void initializeQualityMetrics()
103  {
104  inputAlgorithms[confusionMatrix] = services::SharedPtr<classifier::quality_metric::multiclass_confusion_matrix::Batch<> >(
105  new classifier::quality_metric::multiclass_confusion_matrix::Batch<>(parameter.nClasses));
106  _inputData->add(confusionMatrix, algorithms::InputPtr(
107  new classifier::quality_metric::multiclass_confusion_matrix::Input));
108  }
109 };
111 } // namespace interface1
112 using interface1::Batch;
113 
114 }
115 }
116 }
117 }
118 #endif
daal
Definition: algorithm_base_common.h:31
daal::algorithms::logitboost::quality_metric_set::interface1::Batch::getResultCollection
ResultCollectionPtr getResultCollection()
Definition: logitboost_quality_metric_set_batch.h:85
daal::algorithms::logitboost::quality_metric_set::interface1::Parameter
Parameters for the LogitBoost compute() method.
Definition: logitboost_quality_metric_set_types.h:65
daal::algorithms::logitboost::quality_metric_set::confusionMatrix
Definition: logitboost_quality_metric_set_types.h:49
daal::algorithms::logitboost::quality_metric_set::interface1::ResultCollection
Class that implements functionality of the collection of result objects of the quality metrics algori...
Definition: logitboost_quality_metric_set_types.h:79
daal::algorithms::logitboost::quality_metric_set::interface1::Batch::getInputDataCollection
InputDataCollectionPtr getInputDataCollection()
Definition: logitboost_quality_metric_set_batch.h:95
daal::algorithms::logitboost::quality_metric_set::interface1::Batch
Class that represents a set of quality metrics to check the model trained with the LogitBoost trainin...
Definition: logitboost_quality_metric_set_batch.h:58
daal::algorithms::logitboost::quality_metric_set::interface1::Batch::Batch
Batch(size_t nClasses=2, bool useDefaultMetrics=true)
Definition: logitboost_quality_metric_set_batch.h:67
daal::algorithms::logitboost::quality_metric_set::interface1::InputDataCollection
Class that implements functionality of the collection of input objects of the quality metrics algorit...
Definition: logitboost_quality_metric_set_types.h:99
daal::services::interface1::staticPointerCast
SharedPtr< T > staticPointerCast(const SharedPtr< U > &r)
Definition: daal_shared_ptr.h:422
daal::algorithms::logitboost::quality_metric_set::interface1::Parameter::nClasses
size_t nClasses
Definition: logitboost_quality_metric_set_types.h:70

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