milia.plot.figures.represent#

Representation figures: spectra, CROCS day types, component sweeps and ablations.

Functions

ablation(draw, table, axis, metric[, facet, ...])

A metric per setting of the ablated step.

components(draw, table, metric[, by, n, title])

A metric against the retained number of components, one line per reducer.

daytypes(draw, sets[, names, title])

Each meter's CROCS representative days, one panel per meter, labelled by frequency.

recovery(draw, table, axis[, title])

Known-group recovery per setting, with the 0.5 line.

spectrum(draw, eigenvalues[, title])

Eigenvalue spectra per embedding: where is the gap?

milia.plot.figures.represent.spectrum(draw, eigenvalues, title=None)#

Eigenvalue spectra per embedding: where is the gap?

Parameters:
Returns:

The figure – a lets-plot PlotSpec or a matplotlib Figure, depending on the backend.

Examples

>>> import numpy as np, pandas as pd
>>> from milia.plot.mpl import represent
>>> type(represent.spectrum({"tucker": [0.9, 0.5, 0.1]})).__name__
'Figure'
milia.plot.figures.represent.daytypes(draw, sets, names=None, title=None)#

Each meter’s CROCS representative days, one panel per meter, labelled by frequency.

Parameters:
Returns:

The figure – a lets-plot PlotSpec or a matplotlib Figure, depending on the backend.

Examples

>>> import numpy as np, pandas as pd
>>> from milia.plot.mpl import represent
>>> from milia.represent.crocs import RLS
>>> sets = [RLS(np.ones((2, 24)), np.array([0.5, 0.5]))]
>>> len(represent.daytypes(sets).axes)
1
milia.plot.figures.represent.components(draw, table, metric, by='reducer', n='components', title=None)#

A metric against the retained number of components, one line per reducer.

Parameters:
Returns:

The figure – a lets-plot PlotSpec or a matplotlib Figure, depending on the backend.

Examples

>>> import numpy as np, pandas as pd
>>> from milia.plot.mpl import represent
>>> table = pd.DataFrame({"components": [2, 5], "ari": [0.5, 0.6], "reducer": ["pca", "pca"]})
>>> type(represent.components(table, "ari")).__name__
'Figure'
milia.plot.figures.represent.ablation(draw, table, axis, metric, facet=None, title=None)#

A metric per setting of the ablated step.

Parameters:
Returns:

The figure – a lets-plot PlotSpec or a matplotlib Figure, depending on the backend.

Examples

>>> import numpy as np, pandas as pd
>>> from milia.plot.mpl import represent
>>> table = pd.DataFrame({"scaler": ["std", "robust"], "silhouette": [0.3, 0.4]})
>>> type(represent.ablation(table, "scaler", "silhouette")).__name__
'Figure'
milia.plot.figures.represent.recovery(draw, table, axis, title=None)#

Known-group recovery per setting, with the 0.5 line.

Parameters:
Returns:

The figure – a lets-plot PlotSpec or a matplotlib Figure, depending on the backend.

Examples

>>> import numpy as np, pandas as pd
>>> from milia.plot.mpl import represent
>>> table = pd.DataFrame({"scaler": ["std", "robust"], "recovery": [0.3, 0.8]})
>>> type(represent.recovery(table, "scaler")).__name__
'Figure'