| 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

sparkframeworkmetadata.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.models.frameworkmetadata import FrameworkMetadata
16 from collections import OrderedDict
17 import copy
18
19
20
22 class sparkFrameworkMetadata (object):
23
24 def __init__(self, frameworks):
25 # @var config
26 # @var default_models
27 # @var models
28 self.default_models = frameworks['spark']['models']
29 self.config = frameworks['spark']['conf']
30 self.models = list()
31
32
33
35 def get_default(self):
36 return copy.deepcopy(self.default_models)
37
38
40 def load_default_models(self):
41 self.models = self.get_default()
42
43
47 def append(self, modelmetadata):
48 try:
49 self.models.append(modelmetadata)
50 return 0
51 except Exception:
52 return 1
53
54
56 def get_models(self):
57 return copy.deepcopy(self.models)
58
59
61 def get_config(self):
62 return copy.deepcopy(self.config)
63
64 if __name__ == "__main__":
65 m = sparkFrameworkMetadata(FrameworkMetadata())
66 import json
67
68 m.append(m.get_default()[0])
69 print(json.dumps(m.get_models(), indent=4))
70 '''print(m.get_default())
71 m.load_default_models()
72 print(json.dumps(m.get_models(), indent=4))
73 print(json.dumps(m.get_config(), indent=4))'''
74
gdayf.models.frameworkmetadata
Define Base Framework methods and members on an unified way.
Definition: frameworkmetadata.py:1
gdayf.models.sparkframeworkmetadata.sparkFrameworkMetadata.config
config
Definition: sparkframeworkmetadata.py:29
gdayf.models.sparkframeworkmetadata.sparkFrameworkMetadata.get_default
def get_default(self)
Method used to get a copy default config values for framework.
Definition: sparkframeworkmetadata.py:35
gdayf.models.sparkframeworkmetadata.sparkFrameworkMetadata.get_config
def get_config(self)
Method used get a copy of [h2o] config.
Definition: sparkframeworkmetadata.py:61
gdayf.models.sparkframeworkmetadata.sparkFrameworkMetadata.append
def append(self, modelmetadata)
Method used to append models.
Definition: sparkframeworkmetadata.py:47
gdayf.models.sparkframeworkmetadata.sparkFrameworkMetadata.default_models
default_models
Definition: sparkframeworkmetadata.py:28
gdayf.models.sparkframeworkmetadata.sparkFrameworkMetadata
Generate Framework base Class and base members Initialize [&#39;spark&#39;] to list()
Definition: sparkframeworkmetadata.py:22
gdayf.models.frameworkmetadata.FrameworkMetadata
Generate Framework base Class and base members.
Definition: frameworkmetadata.py:20
gdayf.models.sparkframeworkmetadata.sparkFrameworkMetadata.get_models
def get_models(self)
Method used get a copy of [h2o] models.
Definition: sparkframeworkmetadata.py:56
gdayf.models.sparkframeworkmetadata.sparkFrameworkMetadata.models
models
Definition: sparkframeworkmetadata.py:30
gdayf.models.sparkframeworkmetadata.sparkFrameworkMetadata.load_default_models
def load_default_models(self)
Method used to get default models values from framework.
Definition: sparkframeworkmetadata.py:40
gdayf.models.sparkframeworkmetadata.sparkFrameworkMetadata.__init__
def __init__(self, frameworks)
Constructor.
Definition: sparkframeworkmetadata.py:24