milia.plot.lets.represent#
Represent figures drawn with lets-plot (see milia.plot.figures.represent).
- milia.plot.lets.represent.ablation(table, axis, metric, facet=None, title=None)#
A metric per setting of the ablated step.
- Parameters:
draw – Drawing backend; bound for you in
milia.plot.letsandmilia.plot.mpl.table (
DataFrame) – Output ofmilia.cluster.ablation.ablate().axis (
str) – Column with the setting.metric (
str) – Metric drawn.facet (
str|None) – Column splitting panels, e.g. a dataset.
- Returns:
The figure – a lets-plot
PlotSpecor a matplotlibFigure, 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.lets.represent.components(table, metric, by='reducer', n='components', title=None)#
A metric against the retained number of components, one line per reducer.
- Parameters:
draw – Drawing backend; bound for you in
milia.plot.letsandmilia.plot.mpl.table (
DataFrame) – One row per reducer and component count.metric (
str) – Metric drawn.by (
str) – Column naming the reducer.n (
str) – Column with the component count.
- Returns:
The figure – a lets-plot
PlotSpecor a matplotlibFigure, 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.lets.represent.daytypes(sets, names=None, title=None)#
Each meter’s CROCS representative days, one panel per meter, labelled by frequency.
- Parameters:
draw – Drawing backend; bound for you in
milia.plot.letsandmilia.plot.mpl.sets (
Sequence) – Load sets, e.g.CROCS().fit(cube).sets_.names (
Sequence[str] |None) – Panel names;meter <i>by default.
- Returns:
The figure – a lets-plot
PlotSpecor a matplotlibFigure, 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.lets.represent.recovery(table, axis, title=None)#
Known-group recovery per setting, with the 0.5 line.
- Parameters:
draw – Drawing backend; bound for you in
milia.plot.letsandmilia.plot.mpl.table (
DataFrame) – Ablation table with arecoverycolumn.axis (
str) – Column with the setting.
- Returns:
The figure – a lets-plot
PlotSpecor a matplotlibFigure, 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'
- milia.plot.lets.represent.spectrum(eigenvalues, title=None)#
Eigenvalue spectra per embedding: where is the gap?
- Parameters:
draw – Drawing backend; bound for you in
milia.plot.letsandmilia.plot.mpl.eigenvalues (
Mapping[str,ArrayLike]) – Embedding name to its eigenvalues.
- Returns:
The figure – a lets-plot
PlotSpecor a matplotlibFigure, 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'