O'Reilly logo

Practical Predictive Analytics by Ralph Winters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Plotting via the Pairs function

To get a larger and more detailed plot, you can also use the pairs function to produce a scatter matrix on your desired variables using color to outline the various clusters.

We can see that the clusters are separated from the rest in some cases, while in other cases there can be minor or major overlap:

pairs(tmp[c("age","mass","pressure","pregnant")], col=tmp$prediction)

To start analyzing the components of the clusters, you can look at how the variables are plotted along each of the axes.

For example, the red cluster shows a relationship between older patients and number of months pregnant. This would seem ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required