| DayF core 1.2.1.2 DayF (Decision at your Fingertips) is an AutoML freeware development framework that let developers works with Machine Learning models without any idea of AI, simply taking a csv dataset and the objective column

h2obinomialmetricmetadata.py
1
4
5 '''
6 Copyright (C) e2its - All Rights Reserved
7 * Unauthorized copying of this file, via any medium is strictly prohibited
8 * Proprietary and confidential
9 *
10 * This file is part of gDayF project.
11 *
12 * Written by Jose L. Sanchez <e2its.es@gmail.com>, 2016-2019
13 '''
14
15 from collections import OrderedDict
16 from gdayf.metrics.binomialmetricmetadata import BinomialMetricMetadata
17 import json
18
19
20
27 class H2OBinomialMetricMetadata(BinomialMetricMetadata):
28
30 def __init__(self):
31 BinomialMetricMetadata.__init__(self)
32
33
35 def set_precision(self, tolerance):
36 pass
37
38
41 def set_metrics(self, perf_metrics):
42 if perf_metrics is not None:
43 for parameter, _ in self.items():
44 if parameter in ['gains_lift_table', 'max_criteria_and_metric_scores']:
45 try:
46 self[parameter] = json.loads(
47 perf_metrics._metric_json[parameter].as_data_frame().to_json(orient='split'),
48 object_pairs_hook=OrderedDict)
49 except KeyError as kexecution_error:
50 pass
51 #print('Trace: ' + repr(kexecution_error))
52 except AttributeError as aexecution_error:
53 print('Trace: ' + repr(aexecution_error))
54 except TypeError as texecution_error:
55 print('Trace: ' + repr(texecution_error))
56 elif parameter in ['cm']:
57 for each_parameter, __ in self['cm'].items():
58 try:
59 self['cm'][each_parameter] = \
60 json.loads(
61 perf_metrics.confusion_matrix(
62 metrics=each_parameter).table.as_data_frame().to_json(orient='split'),
63 object_pairs_hook=OrderedDict)
64 except KeyError as kexecution_error:
65 pass
66 #print('Trace: ' + repr(kexecution_error))
67 except AttributeError as aexecution_error:
68 print('Trace: ' + repr(aexecution_error))
69 except TypeError as texecution_error:
70 print('Trace: ' + repr(texecution_error))
71 except ValueError as vexecution_error:
72 print(repr(vexecution_error))
73 elif parameter in ['thresholds_and_metric_scores']:
74 pass
75 else:
76 try:
77 self[parameter] = perf_metrics._metric_json[parameter]
78 except KeyError as kexecution_error:
79 pass
80 #print('Trace: ' + repr(kexecution_error))
81 except AttributeError as aexecution_error:
82 print('Trace: ' + repr(aexecution_error))
83
84
85
gdayf.handler_metrics.h2obinomialmetricmetadata.H2OBinomialMetricMetadata
Class Base for Binomial metricts as OrderedDict.
Definition: h2obinomialmetricmetadata.py:27
gdayf.handler_metrics.h2obinomialmetricmetadata.H2OBinomialMetricMetadata.set_metrics
def set_metrics(self, perf_metrics)
Method to load Binomial metrics from H2OBinomialModelMetrics class.
Definition: h2obinomialmetricmetadata.py:41
gdayf.metrics.binomialmetricmetadata
Define Binomial Metric object as OrderedDict() of common measures for all frameworks on an unified wa...
Definition: binomialmetricmetadata.py:1
gdayf.metrics.binomialmetricmetadata.BinomialMetricMetadata
Class Base for Binomial metricts as OrderedDict.
Definition: binomialmetricmetadata.py:31
gdayf.handler_metrics.h2obinomialmetricmetadata.H2OBinomialMetricMetadata.set_precision
def set_precision(self, tolerance)
Method to set precision measure Not implemented yet.
Definition: h2obinomialmetricmetadata.py:35
gdayf.handler_metrics.h2obinomialmetricmetadata.H2OBinomialMetricMetadata.__init__
def __init__(self)
Method constructor.
Definition: h2obinomialmetricmetadata.py:30