Plot

This module provides functions to plot the results of ICS.

icspylab.plot.plot_ics(scores, components='first_last', y=None, col_names=None, **kwargs)[source]

Plots a scatterplot matrix of the component scores of an invariant coordinate system obtained via an ICS transformation.

It plots the full scatterplot matrix of the components only if there are less than seven components. Otherwise, the three first and three last components will be plotted by default. This is because the components with extreme kurtosis are the most interesting ones.

Parameters:
  • scores (ndarray) – Results from an ICS transformation.

  • ({"first_last" (components) – “first_last”): If p>6, plot either the 3 first and 3 last components (default) or the first 6 components (“first”).

  • "first"} – “first_last”): If p>6, plot either the 3 first and 3 last components (default) or the first 6 components (“first”).

  • default – “first_last”): If p>6, plot either the 3 first and 3 last components (default) or the first 6 components (“first”).

  • y (array-like, optional) – Labels used to color the points.

  • col_names (list, optional) – Names of columns to plot.

  • **kwargs – Additional keyword arguments passed to sns.pairplot.

Example

>>> from sklearn.datasets import load_iris
>>> from icspylab import ICS
>>> iris = load_iris()
>>> X = iris.data
>>> ics = ICS()
>>> X_new = ics.fit_transform(X)
>>> plot_ics(X_new)