| 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

normalizationset.py
1
2
3 '''
4 Copyright (C) e2its - All Rights Reserved
5 * Unauthorized copying of this file, via any medium is strictly prohibited
6 * Proprietary and confidential
7 *
8 * This file is part of gDayF project.
9 *
10 * Written by Jose L. Sanchez <e2its.es@gmail.com>, 2016-2019
11 '''
12
13 from collections import OrderedDict
14
15
16
17 class NormalizationSet (OrderedDict):
18
19
21 def __init__(self):
22 OrderedDict.__init__(self)
23 self.reset()
24
25
27 def reset(self):
28 self['type'] = None
29 self['class'] = None
30 self['objective'] = OrderedDict()
31
32
34 def set_base(self, datetime=True):
35 self.reset()
36 self['type'] = "normalization"
37 self['class'] = "base"
38 self['datetime'] = datetime
39 self['objective']['value'] = OrderedDict()
40
41
43 def set_ignore_column(self):
44 self.reset()
45 self['type'] = "drop"
46 self['class'] = "ignore_column"
47 self['objective']['value'] = OrderedDict()
48
49
53 def set_stdmean(self, mean=0, std=1):
54 self.reset()
55 self['type'] = "normalization"
56 self['class'] = "stdmean"
57 self['objective']['value'] = OrderedDict()
58 self['objective']['mean'] = mean
59 self['objective']['std'] = std
60
61
63 def set_drop_missing(self):
64 self.reset()
65 self['type'] = "drop"
66 self['class'] = "drop_missing"
67 self['objective']['value'] = OrderedDict()
68
69
73 def set_discretize(self, buckets_number=10, fixed_size=True):
74 self.reset()
75 self['type'] = "bucketing"
76 self['class'] = "discretize"
77 self['objective']['buckets_number'] = buckets_number
78 self['objective']['fixed_size'] = fixed_size
79
80
86 def set_working_range(self, minval=-1.0, maxval=1.0, minrange = -1.0, maxrange = 1.0):
87 self.reset()
88 self['type'] = "normalization"
89 self['class'] = "working_range"
90 self['objective']['minval'] = minval
91 self['objective']['maxval'] = maxval
92 self['objective']['minval'] = minrange
93 self['objective']['maxval'] = maxrange
94
95
98 def set_offset(self, offset=0):
99 self.reset()
100 self['type'] = "normalization"
101 self['class'] = "offset"
102 self['objective']['offset'] = offset
103
104
108 def set_aggregation(self, bucket_ratio=0.25):
109 self.reset()
110 self['type'] = "bucketing"
111 self['class'] = "working_range"
112 self['objective']['bucket_ratio'] = bucket_ratio
113
114
117 def set_fixed_missing_values(self, value=0.0):
118 self.reset()
119 self['type'] = "imputation"
120 self['class'] = "fixed_missing_values"
121 self['objective']['value'] = value
122
123
128 def set_mean_missing_values(self, objective_column, full=False):
129 self.reset()
130 self['type'] = "imputation"
131 self['class'] = "mean_missing_values"
132 self['objective']['objective_column'] = objective_column
133 self['objective']['full'] = full
134
135
139 def set_progressive_missing_values(self, objective_column):
140 self.reset()
141 self['type'] = "imputation"
142 self['class'] = "progressive_missing_values"
143 self['objective']['objective_column'] = objective_column
144
gdayf.common.normalizationset.NormalizationSet.set_stdmean
def set_stdmean(self, mean=0, std=1)
Method oriented to establish stdmean Normalization [Metadata].
Definition: normalizationset.py:53
gdayf.common.normalizationset.NormalizationSet.set_discretize
def set_discretize(self, buckets_number=10, fixed_size=True)
Method oriented to establish bucketing actions [Metadata].
Definition: normalizationset.py:73
gdayf.common.normalizationset.NormalizationSet.set_offset
def set_offset(self, offset=0)
Method oriented to establish offset (+ or -) data actions [Metadata].
Definition: normalizationset.py:98
gdayf.common.normalizationset.NormalizationSet.reset
def reset(self)
Method oriented to reset a NormalizationSet instance.
Definition: normalizationset.py:27
gdayf.common.normalizationset.NormalizationSet.set_base
def set_base(self, datetime=True)
Method oriented to establish base Normalization [Metadata].
Definition: normalizationset.py:34
gdayf.common.normalizationset.NormalizationSet.set_ignore_column
def set_ignore_column(self)
Method oriented to establish ignore_column Normalization [Metadata].
Definition: normalizationset.py:43
gdayf.common.normalizationset.NormalizationSet.set_fixed_missing_values
def set_fixed_missing_values(self, value=0.0)
Method oriented to establish fixed value imputation data actions into missing values [Metadata]...
Definition: normalizationset.py:117
gdayf.common.normalizationset.NormalizationSet.set_drop_missing
def set_drop_missing(self)
Method oriented to establish drop_missing Normalization [Metadata].
Definition: normalizationset.py:63
gdayf.common.normalizationset.NormalizationSet
Class NormalizationSet manage the Normalizations metadata as OrderedDict supporting Normalizer Class ...
Definition: normalizationset.py:17
gdayf.common.normalizationset.NormalizationSet.set_working_range
def set_working_range(self, minval=-1.0, maxval=1.0, minrange=-1.0, maxrange=1.0)
Method oriented to establish re-scaling data actions [Metadata].
Definition: normalizationset.py:86
gdayf.common.normalizationset.NormalizationSet.__init__
def __init__(self)
The constructor Generate an empty NormalizationSet class with all elements initialized to correct typ...
Definition: normalizationset.py:21
gdayf.common.normalizationset.NormalizationSet.set_aggregation
def set_aggregation(self, bucket_ratio=0.25)
Method oriented to aggregate minimal and maximal non-frequent values on aggregated intervals [Metadat...
Definition: normalizationset.py:108
gdayf.common.normalizationset.NormalizationSet.set_mean_missing_values
def set_mean_missing_values(self, objective_column, full=False)
Method oriented to establish variable value imputation data actions into missing values based on obje...
Definition: normalizationset.py:128
gdayf.common.normalizationset.NormalizationSet.set_progressive_missing_values
def set_progressive_missing_values(self, objective_column)
Method oriented to establish variable extrapolated value imputation data actions into missing values ...
Definition: normalizationset.py:139