Skip to content

Commit

Permalink
docs: Added example for Table.inverse_transform_table()
Browse files Browse the repository at this point in the history
Co-authored-by: sibre28 <[email protected]>
  • Loading branch information
Marsmaennchen221 and sibre28 committed Apr 21, 2023
1 parent df766bd commit 1a0436f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/safeds/data/tabular/containers/_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,25 @@ def inverse_transform_table(self, transformer: InvertibleTableTransformer) -> Ta
------
TransformerNotFittedError
If the transformer has not been fitted yet.
Examples
--------
>>> from safeds.data.tabular.transformation import OneHotEncoder
>>> from safeds.data.tabular.containers import Table
>>> transformer = OneHotEncoder()
>>> table = Table.from_dict({"col1": [1, 2, 1], "col2": [1, 2, 4]})
>>> transformer = transformer.fit(table, None)
>>> transformed_table = transformer.transform(table)
>>> transformed_table.inverse_transform_table(transformer)
col1 col2
0 1 1
1 2 2
2 1 4
>>> transformer.inverse_transform(transformed_table)
col1 col2
0 1 1
1 2 2
2 1 4
"""
return transformer.inverse_transform(self)

Expand Down

0 comments on commit 1a0436f

Please sign in to comment.