Skip to content

Commit

Permalink
style: apply automated linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
megalinter-bot committed May 6, 2024
1 parent 0397251 commit 701091b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/safeds/data/labeled/containers/_image_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,11 @@ def __init__(self, column: Column) -> None:
self._column_name = column.name
column_as_table = Table.from_columns([column])
with warnings.catch_warnings():
warnings.filterwarnings("ignore", message=rf"The columns \['{self._column_name}'\] contain numerical data. The OneHotEncoder is designed to encode non-numerical values into numerical values", category=UserWarning)
warnings.filterwarnings(
"ignore",
message=rf"The columns \['{self._column_name}'\] contain numerical data. The OneHotEncoder is designed to encode non-numerical values into numerical values",
category=UserWarning,
)
self._one_hot_encoder = OneHotEncoder().fit(column_as_table, [self._column_name])
self._tensor = torch.Tensor(self._one_hot_encoder.transform(column_as_table)._data.to_numpy(copy=True)).to(
torch.get_default_device(),
Expand Down

0 comments on commit 701091b

Please sign in to comment.