Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support missing_policy="mask" on inverse transform #674

Open
PGijsbers opened this issue Dec 14, 2024 · 0 comments
Open

Support missing_policy="mask" on inverse transform #674

PGijsbers opened this issue Dec 14, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@PGijsbers
Copy link
Collaborator

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).

@PGijsbers PGijsbers added the enhancement New feature or request label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant