Created
December 19, 2018 17:59
-
-
Save RyotaBannai/93b028938706553e661c07dfb3594767 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pca = PCA(2) | |
PC = pca.fit_transform(digits.data) | |
inversed = pca.inverse_transform(PC) | |
_, axes = plt.subplots(4, 10, figsize=(10, 4), | |
subplot_kw={'xticks':[], 'yticks':[]}, | |
gridspec_kw=dict(hspace=0.1, wspace=0.1)) | |
for i, ax in enumerate(axes.flat): | |
ax.imshow(inversed[i].reshape(8, 8), | |
cmap='binary', interpolation='nearest', clim=(0, 16)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment