plot_interactive_mapper_graph(pipeline, data, color_data=None, color_features=None, node_color_statistic=None, layout='kamada_kawai', layout_dim=2, clone_pipeline=True, n_sig_figs=3, node_scale=12, plotly_params=None)¶
As of version 0.5.0, we recommend using the object-oriented interface provided by :class:`MapperInteractivePlotter` instead of this function.
Plot Mapper graphs in a Jupyter session, with interactivity on pipeline parameters.
plot_static_mapper_graphby providing functionality to interactively update parameters from the cover, clustering and graph construction steps defined in pipeline.
MapperPipelineobject) – Mapper pipeline to act on to data.
data (array-like of shape (n_samples, n_features)) – Data used to generate the Mapper graph. Can be a pandas dataframe.
color_data (array-like of length n_samples, or None, optional, default:
None) – Data to be used to construct node colors in the Mapper graph (according to color_features and node_color_statistic). Must have the same length as data.
Noneis the same as passing
color_features (object or None, optional, default:
Specifies one or more feature of interest from color_data to be used, together with node_color_statistic, to determine node colors.
Noneis equivalent to passing color_data.
If an object implementing
fit_transform, or a callable, it is applied to color_data to generate the features of interest.
If an index or string, or list of indices/strings, it is equivalent to selecting a column or subset of columns from color_data.
node_color_statistic (None or callable, optional, default:
None) – If a callable, node colors will be computed as summary statistics from the feature array
ydetermined by color_data and color_features. Let
ncolumns (note: 1d feature arrays are converted to column vectors). Then, for a node representing a list
Iof row indices, there will be
ncolors, each computed as
Noneis equivalent to passing
layout (None, str or callable, optional, default:
"kamada-kawai") – Layout algorithm for the graph. Can be any accepted value for the
layoutparameter in the
layout_dim (int, default:
2) – The number of dimensions for the layout. Can be 2 or 3.
clone_pipeline (bool, optional, default:
True) – If
True, the input pipeline is cloned before computing the Mapper graph to prevent unexpected side effects from in-place parameter updates.
n_sig_figs (int or None, optional, default:
3) – If not
None, number of significant figures to which to round node summary statistics. If
None, no rounding is performed.
node_scale (int or float, optional, default:
12) – Sets the scale factor used to determine the rendered size of the nodes. Increase for larger nodes. Implements a formula in the Plotly documentation.
plotly_params (dict or None, optional, default:
None) – Custom parameters to configure the plotly figure. Allowed keys are
"layout", and the corresponding values should be dictionaries containing keyword arguments as would be fed to the
box – A box containing the following widgets: parameters of the clustering algorithm, parameters for the covering scheme, a Mapper graph arising from those parameters, a validation box, and logs.
- Return type