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

fix: incorrect type hint for number_of_bins parameter #567

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/safeds/data/tabular/transformation/_discretizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Discretizer(TableTransformer):

Parameters
----------
number_of_bins: float
number_of_bins
The number of bins to be created.

Raises
Expand All @@ -28,7 +28,7 @@ class Discretizer(TableTransformer):
If the given number_of_bins is less than 2.
"""

def __init__(self, number_of_bins: float = 5):
def __init__(self, number_of_bins: int = 5):
self._column_names: list[str] | None = None
self._wrapped_transformer: sk_KBinsDiscretizer | None = None

Expand All @@ -44,14 +44,14 @@ def fit(self, table: Table, column_names: list[str] | None) -> Discretizer:

Parameters
----------
table : Table
table
The table used to fit the transformer.
column_names : list[str] | None
column_names
The list of columns from the table used to fit the transformer. If `None`, all columns are used.

Returns
-------
fitted_transformer : TableTransformer
fitted_transformer :
The fitted transformer.

Raises
Expand Down Expand Up @@ -99,12 +99,12 @@ def transform(self, table: Table) -> Table:

Parameters
----------
table : Table
table
The table to which the learned transformation is applied.

Returns
-------
transformed_table : Table
transformed_table :
The transformed table.

Raises
Expand Down Expand Up @@ -150,7 +150,7 @@ def is_fitted(self) -> bool:

Returns
-------
is_fitted : bool
is_fitted :
Whether the transformer is fitted.
"""
return self._wrapped_transformer is not None
Expand All @@ -161,7 +161,7 @@ def get_names_of_added_columns(self) -> list[str]:

Returns
-------
added_columns : list[str]
added_columns :
A list of names of the added columns, ordered as they will appear in the table.

Raises
Expand All @@ -180,7 +180,7 @@ def get_names_of_changed_columns(self) -> list[str]:

Returns
-------
changed_columns : list[str]
changed_columns :
The list of (potentially) changed column names, as passed to fit.

Raises
Expand All @@ -198,7 +198,7 @@ def get_names_of_removed_columns(self) -> list[str]:

Returns
-------
removed_columns : list[str]
removed_columns :
A list of names of the removed columns, ordered as they appear in the table the Discretizer was fitted on.

Raises
Expand Down