Skip to content

Commit b434e53

Browse files
authored
fix: incorrect type hint for number_of_bins parameter (#567)
### Summary of Changes Change the type of the `number_of_bins` parameter of `Discretizer.__init__` from `float` to `int`.
1 parent b1e308d commit b434e53

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/safeds/data/tabular/transformation/_discretizer.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Discretizer(TableTransformer):
1919
2020
Parameters
2121
----------
22-
number_of_bins: float
22+
number_of_bins
2323
The number of bins to be created.
2424
2525
Raises
@@ -28,7 +28,7 @@ class Discretizer(TableTransformer):
2828
If the given number_of_bins is less than 2.
2929
"""
3030

31-
def __init__(self, number_of_bins: float = 5):
31+
def __init__(self, number_of_bins: int = 5):
3232
self._column_names: list[str] | None = None
3333
self._wrapped_transformer: sk_KBinsDiscretizer | None = None
3434

@@ -44,14 +44,14 @@ def fit(self, table: Table, column_names: list[str] | None) -> Discretizer:
4444
4545
Parameters
4646
----------
47-
table : Table
47+
table
4848
The table used to fit the transformer.
49-
column_names : list[str] | None
49+
column_names
5050
The list of columns from the table used to fit the transformer. If `None`, all columns are used.
5151
5252
Returns
5353
-------
54-
fitted_transformer : TableTransformer
54+
fitted_transformer :
5555
The fitted transformer.
5656
5757
Raises
@@ -99,12 +99,12 @@ def transform(self, table: Table) -> Table:
9999
100100
Parameters
101101
----------
102-
table : Table
102+
table
103103
The table to which the learned transformation is applied.
104104
105105
Returns
106106
-------
107-
transformed_table : Table
107+
transformed_table :
108108
The transformed table.
109109
110110
Raises
@@ -150,7 +150,7 @@ def is_fitted(self) -> bool:
150150
151151
Returns
152152
-------
153-
is_fitted : bool
153+
is_fitted :
154154
Whether the transformer is fitted.
155155
"""
156156
return self._wrapped_transformer is not None
@@ -161,7 +161,7 @@ def get_names_of_added_columns(self) -> list[str]:
161161
162162
Returns
163163
-------
164-
added_columns : list[str]
164+
added_columns :
165165
A list of names of the added columns, ordered as they will appear in the table.
166166
167167
Raises
@@ -180,7 +180,7 @@ def get_names_of_changed_columns(self) -> list[str]:
180180
181181
Returns
182182
-------
183-
changed_columns : list[str]
183+
changed_columns :
184184
The list of (potentially) changed column names, as passed to fit.
185185
186186
Raises
@@ -198,7 +198,7 @@ def get_names_of_removed_columns(self) -> list[str]:
198198
199199
Returns
200200
-------
201-
removed_columns : list[str]
201+
removed_columns :
202202
A list of names of the removed columns, ordered as they appear in the table the Discretizer was fitted on.
203203
204204
Raises

0 commit comments

Comments
 (0)