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

Filter to fill nan values in numeric features #167

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

IvanSergeevPhysics
Copy link
Contributor

A filter has been added to fill nan and inf values in numeric features.
If there are nan values in data a warning is triggered.

features = rec[0] if type(rec) is tuple else rec
for feature in self._cols:
if np.isnan(features[feature]).any():
warnings.warn(f"Warning: There is nan values in column '{feature}'. It will be replaced by {self._fill_by}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Перенести в trxencoder

for feature in self._cols:
if np.isnan(features[feature]).any():
warnings.warn(f"Warning: There is nan values in column '{feature}'. It will be replaced by {self._fill_by}")
features[feature] = np.nan_to_num(np.array(features[feature]).astype('float32').view('float32'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ожидается что это features[feature] тензор

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants