Skip to content

Commit eb432ce

Browse files
committed
[JTH] add flag max iterations to predict
1 parent a97f3d4 commit eb432ce

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bluemath_tk/datamining/kma.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ def fit_predict(
324324
directional_variables: List[str] = [],
325325
custom_scale_factor: dict = {},
326326
min_number_of_points: int = None,
327+
max_number_of_iterations: int = 10,
327328
normalize_data: bool = True,
328329
) -> Tuple[pd.DataFrame, pd.DataFrame]:
329330
"""
@@ -343,6 +344,10 @@ def fit_predict(
343344
min_number_of_points : int, optional
344345
The minimum number of points to consider a cluster.
345346
Default is None.
347+
max_number_of_iterations : int, optional
348+
The maximum number of iterations for the K-Means algorithm.
349+
This is used when min_number_of_points is not None.
350+
Default is 10.
346351
normalize_data : bool, optional
347352
A flag to normalize the data. Default is True.
348353
@@ -358,6 +363,7 @@ def fit_predict(
358363
directional_variables=directional_variables,
359364
custom_scale_factor=custom_scale_factor,
360365
min_number_of_points=min_number_of_points,
366+
max_number_of_iterations=max_number_of_iterations,
361367
normalize_data=normalize_data,
362368
)
363369

0 commit comments

Comments
 (0)