08.06.2015 Views

Building Machine Learning Systems with Python - Richert, Coelho

Building Machine Learning Systems with Python - Richert, Coelho

Building Machine Learning Systems with Python - Richert, Coelho

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 11<br />

Let us have a look at a slightly more complex Iris dataset. We will use it later to<br />

contrast LDA <strong>with</strong> PCA. The Iris dataset contains four attributes per flower. With<br />

the previous code, we would project it into a three-dimensional space while keeping<br />

the relative distances between the individual flowers as much as possible. In the<br />

previous example, we did not specify any metric, so MDS will default to Euclidean.<br />

This means that flowers that were different according to their four attributes should<br />

also be far away in the MDS-scaled three-dimensional space, and flowers that were<br />

similar should be near together now, as shown in the following screenshot:<br />

Doing the dimensional reduction to three and two dimensions <strong>with</strong> PCA instead, we<br />

see the expected bigger spread of the flowers belonging to the same class, as shown<br />

in the following screenshot:<br />

[ 239 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!