April 2020
Intermediate to advanced
438 pages
12h 2m
English
Go through the following steps to cluster the digits images from the scikit-image dataset:
digits = datasets.load_digits(n_class=10)data = digits.data # matrix where each row is a vector that represent a digit.data = scale(data)num = digits.target # num[i] is the digit represented by data[i]
som = MiniSom(30, 30, 64, sigma=4, learning_rate=0.5, neighborhood_function='triangle')som.pca_weights_init(data)
som.train_random(data, 5000) # random training
Read now
Unlock full access