From e21d74611b7002404f3a82a7851c3075a5c3f384 Mon Sep 17 00:00:00 2001 From: Phil Date: Sun, 23 Apr 2023 13:29:54 +0200 Subject: [PATCH] Update plot_nearest_centroid.py Remove unused variable and fix comment --- examples/neighbors/plot_nearest_centroid.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/neighbors/plot_nearest_centroid.py b/examples/neighbors/plot_nearest_centroid.py index 0ea3c0c6b1209..4eb0e0388a30b 100644 --- a/examples/neighbors/plot_nearest_centroid.py +++ b/examples/neighbors/plot_nearest_centroid.py @@ -15,7 +15,6 @@ from sklearn.neighbors import NearestCentroid from sklearn.inspection import DecisionBoundaryDisplay -n_neighbors = 15 # import some data to play with iris = datasets.load_iris() @@ -29,7 +28,7 @@ cmap_bold = ListedColormap(["darkorange", "c", "darkblue"]) for shrinkage in [None, 0.2]: - # we create an instance of Neighbours Classifier and fit the data. + # we create an instance of Nearest Centroid Classifier and fit the data. clf = NearestCentroid(shrink_threshold=shrinkage) clf.fit(X, y) y_pred = clf.predict(X)