10000 MAINT Validate parameter for `sklearn.cluster.cluster_optics_xi` (#25… · scikit-learn/scikit-learn@2c555ef · GitHub
[go: up one dir, main page]

Skip to content

Commit 2c555ef

Browse files
Anthony22-devanthonypic22glemaitre
authored
MAINT Validate parameter for sklearn.cluster.cluster_optics_xi (#25385)
Co-authored-by: adossantosalfam <anthony.dos_santos_alfama@insa-rouen.fr> Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
1 parent 8e0f54f commit 2c555ef

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

sklearn/cluster/_optics.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,24 @@ def cluster_optics_dbscan(*, reachability, core_distances, ordering, eps):
711711
return labels
712712

713713

714+
@validate_params(
715+
{
716+
"reachability": [np.ndarray],
717+
"predecessor": [np.ndarray],
718+
"ordering": [np.ndarray],
719+
"min_samples": [
720+
Interval(Integral, 1, None, closed="neither"),
721+
Interval(Real, 0, 1, closed="both"),
722+
],
723+
"min_cluster_size": [
724+
Interval(Integral, 1, None, closed="neither"),
725+
Interval(Real, 0, 1, closed="both"),
726+
None,
727+
],
728+
"xi": [Interval(Real, 0, 1, closed="both")],
729+
"predecessor_correction": ["boolean"],
730+
}
731+
)
714732
def cluster_optics_xi(
715733
*,
716734
reachability,

sklearn/tests/test_public_functions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ def _check_function_param_validation(
9898
"sklearn.cluster.compute_optics_graph",
9999
"sklearn.cluster.estimate_bandwidth",
100100
"sklearn.cluster.kmeans_plusplus",
101+
"sklearn.cluster.cluster_optics_xi",
101102
"sklearn.cluster.ward_tree",
102103
"sklearn.covariance.empirical_covariance",
103104
"sklearn.covariance.shrunk_covariance",

0 commit comments

Comments
 (0)
0