| 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

sparkregressionmetricmetadata.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 gdayf.metrics.regressionmetricmetadata import RegressionMetricMetadata
16 import time
17 from numpy import isnan
18
19
20
23 class SparkRegressionMetricMetadata(RegressionMetricMetadata):
24
25
27 def __init__(self):
28 RegressionMetricMetadata.__init__(self)
29
30
35 def set_metrics(self, evaluator, data, objective_column=None):
36
37 start = time.time()
38 if evaluator is not None and data is not None:
39 self['MSE'] = evaluator.evaluate(data, {evaluator.metricName: "mse"})
40 self['mean_residual_deviance'] = None
41 self['nobs'] = data.count()
42 self['model_category'] = 'Regression'
43 self['predictions'] = None
44 self['rmsle'] = None
45 self['r2'] = evaluator.evaluate(data, {evaluator.metricName: "r2"})
46 self['RMSE'] = evaluator.evaluate(data, {evaluator.metricName: "rmse"})
47 self['MAE'] = evaluator.evaluate(data, {evaluator.metricName: "mae"})
48 self['scoring_time'] = int(time.time() - start)
49 if isnan(self['RMSE']):
50 self['RMSE'] = 1e+16
51 if isnan(self['r2']):
52 self['r2'] = 0
53
54
gdayf.metrics.regressionmetricmetadata.RegressionMetricMetadata
Class Base for Regression metricts as OrderedDict Base Metrics for Regression [No expanded metrics]...
Definition: regressionmetricmetadata.py:23
gdayf.metrics.regressionmetricmetadata
Define Regression Metric object as OrderedDict() of common measures for all frameworks on an unified ...
Definition: regressionmetricmetadata.py:1
gdayf.handler_metrics.sparkregressionmetricmetadata.SparkRegressionMetricMetadata
Class Base for Regression metricts as OrderedDict Base Metrics for Regression [No expanded metrics]...
Definition: sparkregressionmetricmetadata.py:23
gdayf.handler_metrics.sparkregressionmetricmetadata.SparkRegressionMetricMetadata.set_metrics
def set_metrics(self, evaluator, data, objective_column=None)
Method to load Regression metrics from Spark RegressionEvaluator class.
Definition: sparkregressionmetricmetadata.py:35
gdayf.handler_metrics.sparkregressionmetricmetadata.SparkRegressionMetricMetadata.__init__
def __init__(self)
Method constructor.
Definition: sparkregressionmetricmetadata.py:27