| 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

sparkclusteringmetricmetadata.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.clusteringmetricmetadata import ClusteringMetricMetadata
16 from pandas import DataFrame
17 from collections import OrderedDict
18 import json
19 import time
20
21
22
25 class SparkClusteringMetricMetadata(ClusteringMetricMetadata):
26
27
29 def __init__(self):
30 ClusteringMetricMetadata.__init__(self)
31
32
37 def set_metrics(self, model, data):
38
39 start = time.time()
40 if model is not None and data is not None:
41 self['clusterCenters'] = DataFrame(model.clusterCenters())
42 self['k'] = self['clusterCenters'].shape[0]
43 self['clusterCenters'] = json.loads(DataFrame(model.clusterCenters()).to_json(orient='split'),
44 object_pairs_hook=OrderedDict)
45 self['bettweenss'] = 1e15 # Need to be implemented
46 self['totss'] = 1e15 # Need to be implemented
47 self['tot_withinss'] = model.computeCost(data)
48 self['nobs'] = data.count()
49 self['model_category'] = 'Clustering'
50 self['predictions'] = None
51 self['RMSE'] = 10e+308
52 self['scoring_time'] = int(time.time() - start)
53
gdayf.handler_metrics.sparkclusteringmetricmetadata.SparkClusteringMetricMetadata
Class Base for Clustering metricts as OrderedDict Base Metrics for Regression [No expanded metrics]...
Definition: sparkclusteringmetricmetadata.py:25
gdayf.metrics.clusteringmetricmetadata
Define Clustering Metric object as OrderedDict() of common measures for all frameworks on an unified ...
Definition: clusteringmetricmetadata.py:1
gdayf.metrics.clusteringmetricmetadata.ClusteringMetricMetadata
Definition: clusteringmetricmetadata.py:41
gdayf.handler_metrics.sparkclusteringmetricmetadata.SparkClusteringMetricMetadata.set_metrics
def set_metrics(self, model, data)
Method to load Regression metrics from Spark RegressionEvaluator class.
Definition: sparkclusteringmetricmetadata.py:37
gdayf.handler_metrics.sparkclusteringmetricmetadata.SparkClusteringMetricMetadata.__init__
def __init__(self)
Method constructor.
Definition: sparkclusteringmetricmetadata.py:29