visualization

visualization

Visualizations of dimmer outputs.

Functions

Name Description
construct_histogram Construct histogram of integer values.
construct_scatter_with_labels Construct isomap plot with labels for traces.
plot_annular_neighborhood Plot the annular neighborhood around a point.

construct_histogram

visualization.construct_histogram(
    values,
    color_sequence=None,
    label='Label {value}',
    label_template_dict=dict(),
)

Construct histogram of integer values.

Plot a histogram of the integer values, as given by the output of dimmer.gad.GAD.fit_predict, dimmer.stratifier.Stratifier.fit_predict, or dimmer.intersecter.Intersecter.fit_predict.

Parameters

Name Type Description Default
values np.ndarray A 1-d np.ndarray of values used to construct histogram. required
color_sequence px.colors.qualitative | None Plotly discrete color sequence. None
label str Label for each trace (unique value in values) in histogram. The value can be specified with {value} and any other user variables can be specified as long as they are defined in label_template_dict. 'Label {value}'
label_template_dict dict Dictionary used to define user-specified variables in label parameter. dict()

construct_scatter_with_labels

visualization.construct_scatter_with_labels(
    X,
    values=None,
    color_sequence=None,
    label='Label {value}',
    label_template_dict=dict(),
)

Construct isomap plot with labels for traces.

Parameters

Name Type Description Default
X np.ndarray A (-,3) np.ndarray containing coordinate data, as output by sklearn.manifold.Isomap.fit_transform. required
values np.ndarray | None A 1-dimensional array containing a label for each datapoint, as output by fit_predict. None
color_sequence px.colors.qualitative | None Plotly discrete color sequence. None
label str Label for each trace (unique value in values) in histogram. The value can be specified with {value} and any other user variables can be specified as long as they are defined in label_template_dict. 'Label {value}'
label_template_dict dict Dictionary used to define user-specified variables in label parameter. dict()

plot_annular_neighborhood

visualization.plot_annular_neighborhood(
    gad,
    X,
    idx,
    values=None,
    original_nbhd=True,
    **kwargs,
)

Plot the annular neighborhood around a point.

Parameters

Name Type Description Default
gad GAD Fitted GAD instance. required
X np.ndarray[tuple[int, int], np.dtype[np.float64]] Array containing original data. This should be the same as what was passed into fit. required
idx int Index of the center point of annulus. required
values np.ndarray[tuple[int], np.dtype[np.float64]] | None Array of values used for coloring each trace. None
original_nbhd bool Determines if the original neighborhood is plotted or the neighborhood after iteration. True
kwargs dict Parameters to be passed onto plotly. {}

Returns

Name Type Description
fig go.Figure Plotly figure of the local neighborhood.