-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Tutorial example code lacking context #13566
Copy link
Copy link
Closed
Labels
DocumentationEasyWell-defined and straightforward way to resolveWell-defined and straightforward way to resolvegood first issueEasy with clear instructions to resolveEasy with clear instructions to resolve
Description
on:
https://scikit-learn.org/stable/tutorial/statistical_inference/unsupervised_learning.html
the code
import matplotlib.pyplot as plt
from skimage.data import coins
from skimage.transform import rescale
from sklearn.feature_extraction.image import grid_to_graph
from sklearn.cluster import AgglomerativeClustering
# #############################################################################
# Generate data
orig_coins = coins()
# Resize it to 20% of the original size to speed up the processing
# Applying a Gaussian filter for smoothing prior to down-scaling
# reduces aliasing artifacts.
smoothened_coins = gaussian_filter(orig_coins, sigma=2)
rescaled_coins = rescale(smoothened_coins, 0.2, mode="reflect")
X = np.reshape(rescaled_coins, (-1, 1))
# #############################################################################
# Define the structure A of the data. Pixels connected to their neighbors.
connectivity = grid_to_graph(*rescaled_coins.shape)Is not completely connected to the example it is trying to illustrate. Looks like it was planning to
plot the image but this is never done(same with AgglomerativeClustering), also the gaussian_filter is not imported. This code snippet should be completed, and its relationship with agglomerative clustering fleshed out.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
DocumentationEasyWell-defined and straightforward way to resolveWell-defined and straightforward way to resolvegood first issueEasy with clear instructions to resolveEasy with clear instructions to resolve