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

multi_class_classifier_quality_metric_set_batch.h
1 /* file: multi_class_classifier_quality_metric_set_batch.h */
2 /*******************************************************************************
3 * Copyright 2014-2018 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 // Interface for the multi-class classifier quality metric set.
45 //--
46 */
47 
48 #ifndef __MULTI_CLASS_CLASSIFIER_QUALITY_METRIC_SET_BATCH_H__
49 #define __MULTI_CLASS_CLASSIFIER_QUALITY_METRIC_SET_BATCH_H__
50 
51 #include "algorithms/algorithm_quality_metric_set_batch.h"
52 #include "algorithms/classifier/multiclass_confusion_matrix_batch.h"
53 #include "algorithms/multi_class_classifier/multi_class_classifier_quality_metric_set_types.h"
54 
55 namespace daal
56 {
57 namespace algorithms
58 {
59 namespace multi_class_classifier
60 {
64 namespace quality_metric_set
65 {
66 
67 namespace interface1
68 {
84 class Batch : public algorithms::quality_metric_set::Batch
85 {
86 public:
87  Parameter parameter;
93  Batch(size_t nClasses = 2, bool useDefaultMetrics = true) :
94  algorithms::quality_metric_set::Batch(useDefaultMetrics),
95  parameter(nClasses)
96  {
97  _inputData = InputDataCollectionPtr(new InputDataCollection());
98  if (_useDefaultMetrics)
99  {
100  initializeQualityMetrics();
101  }
102  _resultCollection = ResultCollectionPtr(new ResultCollection());
103  }
104 
105  virtual ~Batch() {}
106 
111  ResultCollectionPtr getResultCollection()
112  {
113  return services::staticPointerCast<ResultCollection,
114  algorithms::quality_metric_set::ResultCollection>(_resultCollection);
115  }
116 
121  InputDataCollectionPtr getInputDataCollection()
122  {
123  return services::staticPointerCast<InputDataCollection,
124  algorithms::quality_metric_set::InputDataCollection>(_inputData);
125  }
126 
127 protected:
128  virtual void initializeQualityMetrics()
129  {
130  inputAlgorithms[confusionMatrix] = services::SharedPtr<classifier::quality_metric::multiclass_confusion_matrix::Batch<> >(
131  new classifier::quality_metric::multiclass_confusion_matrix::Batch<>(parameter.nClasses));
132  _inputData->add(confusionMatrix, algorithms::InputPtr(
133  new classifier::quality_metric::multiclass_confusion_matrix::Input));
134  }
135 };
137 } // namespace interface1
138 using interface1::Batch;
139 
140 }
141 }
142 }
143 }
144 #endif
daal::algorithms::classifier::quality_metric::multiclass_confusion_matrix::interface1::Batch
Computes the confusion matrix for a multi-class classifier in the batch processing mode...
Definition: multiclass_confusion_matrix_batch.h:111
daal
Definition: algorithm_base_common.h:57
daal::algorithms::multi_class_classifier::quality_metric_set::interface1::Batch::Batch
Batch(size_t nClasses=2, bool useDefaultMetrics=true)
Definition: multi_class_classifier_quality_metric_set_batch.h:93
daal::algorithms::quality_metric_set::interface1::Batch
Provides methods to compute a quality metric set of an algorithm in the batch processing mode...
Definition: algorithm_quality_metric_set_batch.h:76
daal::algorithms::quality_metric_set::interface1::Batch::_inputData
InputDataCollectionPtr _inputData
Definition: algorithm_quality_metric_set_batch.h:141
daal::algorithms::quality_metric_set::interface1::Batch::inputAlgorithms
InputAlgorithmsCollection inputAlgorithms
Definition: algorithm_quality_metric_set_batch.h:79
daal::algorithms::multi_class_classifier::quality_metric_set::interface1::Parameter::nClasses
size_t nClasses
Definition: multi_class_classifier_quality_metric_set_types.h:99
daal::algorithms::multi_class_classifier::quality_metric_set::interface1::InputDataCollection
Class that implements functionality of the collection of input objects of the quality metrics algorit...
Definition: multi_class_classifier_quality_metric_set_types.h:128
daal::services::interface1::SharedPtr
Shared pointer that retains shared ownership of an object through a pointer. Several SharedPtr object...
Definition: daal_shared_ptr.h:187
daal::algorithms::multi_class_classifier::quality_metric_set::interface1::Parameter
Parameters for the multi-class classifier compute() method.
Definition: multi_class_classifier_quality_metric_set_types.h:94
daal::algorithms::multi_class_classifier::quality_metric_set::interface1::Batch::getResultCollection
ResultCollectionPtr getResultCollection()
Definition: multi_class_classifier_quality_metric_set_batch.h:111
daal::algorithms::classifier::quality_metric::multiclass_confusion_matrix::interface1::Input
Base class for the input objects of the confusion matrix algorithm in the training stage of the class...
Definition: multiclass_confusion_matrix_types.h:151
daal::algorithms::quality_metric_set::interface1::InputDataCollection
Class that implements functionality of the collection of input objects of the quality metrics algorit...
Definition: algorithm_quality_metric_set_types.h:128
daal::algorithms::multi_class_classifier::quality_metric_set::interface1::Batch::getInputDataCollection
InputDataCollectionPtr getInputDataCollection()
Definition: multi_class_classifier_quality_metric_set_batch.h:121
daal::algorithms::quality_metric_set::interface1::ResultCollection
Class that implements functionality of the collection of result objects of the quality metrics algori...
Definition: algorithm_quality_metric_set_types.h:155
daal::algorithms::multi_class_classifier::quality_metric_set::interface1::Batch
Class containing a set of quality metrics to check the model trained with the multi-class classifier ...
Definition: multi_class_classifier_quality_metric_set_batch.h:84
daal::algorithms::multi_class_classifier::quality_metric_set::interface1::Batch::parameter
Parameter parameter
Definition: multi_class_classifier_quality_metric_set_batch.h:87
daal::algorithms::multi_class_classifier::quality_metric_set::interface1::ResultCollection
Class that implements functionality of the collection of result objects of the quality metrics algori...
Definition: multi_class_classifier_quality_metric_set_types.h:108
daal::algorithms::multi_class_classifier::quality_metric_set::confusionMatrix
Definition: multi_class_classifier_quality_metric_set_types.h:78
daal::services::interface1::staticPointerCast
SharedPtr< T > staticPointerCast(const SharedPtr< U > &r)
Definition: daal_shared_ptr.h:448

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