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

Simplify the structure of val_set #271

Closed
WenjieDu opened this issue Dec 18, 2023 · 0 comments
Closed

Simplify the structure of val_set #271

WenjieDu opened this issue Dec 18, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@WenjieDu
Copy link
Owner

WenjieDu commented Dec 18, 2023

# check if X_intact contains missing values
if np.isnan(val_set["X_intact"]).any():
val_set["X_intact"] = np.nan_to_num(val_set["X_intact"], nan=0)
logger.warning(
"X_intact shouldn't contain missing data but has NaN values. "
"PyPOTS has imputed them with zeros by default to start the training for now. "
"Please double-check your data if you have concerns over this operation."
)

For imputation models, we expect X to contain missing values, while for X_intact, we need it with missing data filled with 0. We also need the additional indicating_mask recording positions for error calculation, but this is not necessary. Because indicating_mask can easily be calculated like torch.isnan(X)^torch.isnan(X_intact) if missing values are left as NaN in X and X_intact.

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