6 Copyright (C) e2its - All Rights Reserved 7 * Unauthorized copying of this file, via any medium is strictly prohibited 8 * Proprietary and confidential 10 * This file is part of gDayF project. 12 * Written by Jose L. Sanchez <e2its.es@gmail.com>, 2016-2019 17 from collections
import OrderedDict
25 ModelMetadata.__init__(self, e_c)
38 if atype[0][
'type'] ==
'binomial':
39 distribution =
'binomial' 40 elif atype[0][
'type'] ==
'multinomial':
41 distribution =
'multinomial' 43 distribution =
'default' 46 if each_model[
'model'] == model_type:
47 for key, value
in each_model.items():
48 if key ==
'parameters':
49 self.
model[key] = OrderedDict()
50 for subkey, subvalue
in value.items():
51 if subkey
not in [
'stopping',
'distribution',
'effort']:
52 for parm, parm_value
in subvalue.items():
53 if parm_value[
'seleccionable']:
54 self.
model[key][parm] = parm_value
55 elif subkey ==
'stopping':
56 if amode
in [POC, FAST, FAST_PARANOIAC]:
57 for parm, parm_value
in subvalue.items():
58 if parm_value[
'seleccionable']:
59 self.
model[key][parm] = parm_value
60 elif subkey ==
'effort':
61 for parm, parm_value
in subvalue.items():
62 if parm_value[
'seleccionable']:
63 self.
model[key][parm] = parm_value
64 if isinstance(self.
model[key][parm][
'value'], list)\
66 for counter
in range(0, len(self.
model[key][parm][
'value'])):
67 if model_type !=
'H2OAutoEncoderEstimator':
68 self.
model[key][parm][
'value'][counter] = \
69 int(self.
model[key][parm][
'value'][counter] * increment)
70 elif self.
model[key][parm][
'type']
in DTYPES \
72 if self.
model[key][parm][
'type']
in ITYPES:
73 self.
model[key][parm][
'value'] = \
74 int(self.
model[key][parm][
'value'] * increment)
76 self.
model[key][parm][
'value'] *= increment
77 elif subkey ==
'distribution':
78 for parm, parm_value
in subvalue.items():
79 if parm_value[
'seleccionable']:
80 self.
model[key][parm] = parm_value
82 if distribution
in [
'binomial',
'multinomial']:
83 self.
model[key][parm][
'value'] = distribution
84 self.
model[key][parm][
'type'] = list()
86 elif parm ==
'distribution':
87 if distribution ==
'binomial':
88 distribution =
'bernoulli' 89 if distribution
in [
'bernoulli',
'multinomial']:
90 self.
model[key][parm][
'value'] = distribution
91 self.
model[key][parm][
'type'] = list()
93 self.
model[key] = atype
95 self.
model[key] = value
97 self.
model[
'parameters'][
'seed'][
'value'] = int(ts)