Andrewscurves#

import hvplot.pandas  # noqa

Andrews curves provides a mechanism for visualising clusters of multivariate data.

Andrews curves have the functional form:

f(t) = x_1/sqrt(2) + x_2 sin(t) + x_3 cos(t) + x_4 sin(2t) + x_5 cos(2t) + ...

Where x coefficients correspond to the values of each dimension and t is linearly spaced between -pi and +pi. Each row of frame then corresponds to a single curve.

from bokeh.sampledata import iris

iris = iris.flowers
iris.head()
sepal_length sepal_width petal_length petal_width species
0 5.1 3.5 1.4 0.2 setosa
1 4.9 3.0 1.4 0.2 setosa
2 4.7 3.2 1.3 0.2 setosa
3 4.6 3.1 1.5 0.2 setosa
4 5.0 3.6 1.4 0.2 setosa
hvplot.plotting.andrews_curves(
    iris,
    class_column='species',
    samples=20,
)
This web page was generated from a Jupyter notebook and not all interactivity will work on this website.