Transformers¶
Specialized transformers to address Gordo specific problems.
This function just like Scikit-Learn’s transformers and thus can be
inserted into Pipeline
objects.
Imputers¶
-
class
gordo.machine.model.transformers.imputer.
InfImputer
(inf_fill_value=None, neg_inf_fill_value=None, strategy='minmax', delta: float = 2.0)[source]¶ Bases:
sklearn.base.TransformerMixin
Fill inf/-inf values of a 2d array/dataframe with imputed or provided values By default it will find the min and max of each feature/column and fill -infs/infs with those values +/-
delta
- Parameters
inf_fill_value (numeric) – Value to fill ‘inf’ values
neg_inf_fill_value (numeric) – Value to fill ‘-inf’ values
strategy (str) – How to fill values, irrelevant if fill value is provided. choices: ‘extremes’, ‘minmax’ -‘extremes’ will use the min and max values for the current datatype. such that ‘inf’ in a float32 dataset will have float32’s largest value inserted. - ‘minmax’ will look at the min and max values in the feature where the -inf / inf appears and fill with the max/min found in that feature.
delta (float) – Only applicable if
strategy='minmax'
Will add/subtract the max/min value, by feature, by this delta. If the max value in a feature was 10 anddelta=2
any inf value will be filled with 12. Likewise, if the min feature was -10 any -inf will be filled with -12.