Skip to content

Support missing_policy="mask" on inverse transform #674

Description

@PGijsbers

Transferring TODOs to the issue tracker (#172).

def inverse_transform(
self, vec: str | np.ndarray, **params: Any
) -> str | np.ndarray:
"""
:param vec: must a single value or line vector (array)
:param params:
:return:
"""
if not self.delegate:
return vec
# TODO: handle mask
vec = np.asarray(vec).astype(self.encoded_type, copy=False)
return self.delegate.inverse_transform(vec, **params)

In the encoders mask mode, while encoding missing values are temporarily masked as non-missing ones, and then replaced with missing values. During the reverse decoding, as I understand it, we would need to substitute back in those markers, then decode, and then set them to np.nan or None again. (however, that also seems fairly straight forward so I am not 100% why this is then a TODO).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions