amueller / introduction_to_ml_with_python

Notebooks and code for the book "Introduction to Machine Learning with Python"
7.36k stars 4.54k forks source link

Different results when using unsupervised learning and faces dataset #169

Open karayaneva opened 1 year ago

karayaneva commented 1 year ago

I am trying to use the unsupervised learning tutorial, which uses the faces dataset from scikit-learn. I have downloaded the files and run them using the Jupyter Notebook. This is the link: https://github.com/amueller/introduction_to_ml_with_python/blob/master/03-unsupervised-learning.ipynb

However, I get different results when I try to visualize the noisy images, please see below:

unsupervised

This is what the expected result should look like:

unsupervised2

I assume that different versions of Python and packages could be the problem. I am using Python 3.10 and the newest versions of all packages. Any suggestions why this is happening will be appreciated.

amueller commented 1 year ago

What are the minimum and maximum values of image for you? On page 151 I'm dividing the entries by 255. Did you do that?