Modules.FunctionalBoxplot package

Submodules

Modules.FunctionalBoxplot.functional_boxplot module

Modules.FunctionalBoxplot.functional_boxplot.functional_boxplot(curves, method='functional_bd', curves_depths=None, percentil=100, scale=1.0, ax=None, show_median=True, band_alpha=0.5)[source]

Plot the functional band depth area between the top and bottom curves along with the median curve.

Parameters:

curvesnp.ndarray

2D array of shape (N, D) where N is the number of samples and D is the number of features

methodstr, optional

The method to use for plotting. Options are ‘functional_bd’ and ‘modified_bd’. Default is ‘functional_bd’.

curves_depthsnp.ndarray, optional

1D array of band depths of shape (N,). If None, it will be computed.

percentilfloat, optional

Percentile for the band depth calculation. Default is 100.

scalefloat, optional

Scale factor for the depth area. Default is 1.0.

axmatplotlib.axes.Axes, optional

Matplotlib Axes object to plot on. If None, a new figure and axes will be created.

show_medianbool, optional

Whether to plot the median curve. Default is True.

band_alphafloat, optional

Alpha value for the band depth area. Default is 0.5.

Returns:

axmatplotlib.axes.Axes

The Axes object with the plot.

Usage Example:

>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> from uvisbox.Modules.FunctionalBoxplot.plot import plot
>>> # Generate synthetic functional data
>>> np.random.seed(0)
>>> x = np.linspace(0, 10, 100)
>>> curves = np.array([np.sin(x) + np.random.normal(0, 0.1, size=x.shape) for _ in range(50)])
>>> # Create a figure and plot the functional boxplot
>>> fig, ax = plt.subplots(figsize=(10, 6))
>>> plot(curves, method='functional_bd', percentil=50, scale=1.0, ax=ax)
>>> plt.title("Functional Boxplot using Functional Band Depth")
>>> plt.xlabel("X-axis")
>>> plt.ylabel("Y-axis")
>>> plt.show()

Modules.FunctionalBoxplot.functional_boxplot_mesh module

Modules.FunctionalBoxplot.functional_boxplot_mesh.functional_depth_mesh(top_curve, bottom_curve, scale=1.0)[source]

Create a 2D triangular mesh representing the functional depth area between the top and bottom curves.

Parameters:

top_curvenp.ndarray

1D array representing the top curve.

bottom_curvenp.ndarray

1D array representing the bottom curve.

scalefloat, optional

Scale factor for the depth area. Default is 1.0.

Returns:

verticesnp.ndarray

2D array of shape (n_vertices, 2) representing the vertices of the mesh.

Modules.FunctionalBoxplot.functional_boxplot_stats module

Modules.FunctionalBoxplot.functional_boxplot_vis module

Modules.FunctionalBoxplot.functional_boxplot_vis.vis(top_curve, bottom_curve, curves, ax=None, show_median=True, band_alpha=0.5, color='skyblue')[source]

Module contents

FunctionalBoxplot Module

This module provides functional boxplot functionality for uncertainty visualization.