We'd like to be able to get a transformer into a fitted state using known parameters instead of existing data. This would allow us to set up a transformer to be able to reverse transform without first having to fit it on real data.
Expected behavior
Add the method _set_fitted_parameters to the UnixTimestampEncoder. When called, the provided arguments should be set on the transformer to get it into a 'fitted' state so that it can be used to reverse transform. After being called, a user should be able to call reverse_transform and have it work as expected.
column_names [str]: The names of the column. Should be used to set self.columns and self.output_columns.
min_max_values [tuple or None]: None or a tuple containing the (min, max) values for the transformer. Should be used to set self._min_value and self._max_value and must be provided if self.enforce_min_max_values is True.
null_transformer [a NullTransformer instance]: A fitted null transformer instance that can be used to generate null values for the column.
dtype [str]: The pandas dtype the reversed data should be converted to. Should be used to set self._dtype.
This method should not return anything. It should validate the parameters that are passed in, especially that the null transformer is compatible.
Problem Description
We'd like to be able to get a transformer into a fitted state using known parameters instead of existing data. This would allow us to set up a transformer to be able to reverse transform without first having to fit it on real data.
Expected behavior
Add the method
_set_fitted_parameters
to theUnixTimestampEncoder
. When called, the provided arguments should be set on the transformer to get it into a 'fitted' state so that it can be used to reverse transform. After being called, a user should be able to callreverse_transform
and have it work as expected.def _set_fitted_parameters(self, column_names, min_max_values, null_transformer, dtype='object')- Args:
self.columns
andself.output_columns
.None
or a tuple containing the (min, max) values for the transformer. Should be used to setself._min_value
andself._max_value
and must be provided ifself.enforce_min_max_values
isTrue
.NullTransformer
instance]: A fitted null transformer instance that can be used to generate null values for the column.self._dtype
.This method should not return anything. It should validate the parameters that are passed in, especially that the null transformer is compatible.