dashi.unsupervised_characterization.variability_metrics package

Submodules

dashi.unsupervised_characterization.variability_metrics.estimate_msv_metrics module

Multi Source Variability (MSV) metrics estimation module

class MSVMetrics(GPD=None, SPO=None, vertices=None, sources=None, nBySource=None)[source]

Bases: object

GPD: float = None
SPO: array = None
nBySource: array = None
sources: array = None
vertices: array = None
estimate_MSV_metrics(data_source_map)[source]

Estimate Multi Source Variability (MSV) metrics from a data source map. It can be either a single DataSourceMap, a MultiVariateDataSourceMap, or a dictionary with the following structure {label: MultiVariateDataSourceMap}.

Parameters:

data_source_map (Union[DataSourceMap, MultiVariateDataSourceMap, Dict[str, MultiVariateDataSourceMap]]) – The data source map to project. This can either be a DataSourceMap object (result of estimate_univariate_data_source_map), a MultiVariateDataSourceMap object (result of estimate_multivariate_data_source_map), or a dictionary of MultiVariateDataSourceMap objects where the keys are the selected labels (result of estimate_conditional_data_source_map).

Returns:

An instance of MSVMetrics containing the GPD, SPO, vertices, sources, and counts by source.

Return type:

MSVMetrics

dashi.unsupervised_characterization.variability_metrics.igt_plotting module

Information Geometric Temporal (IGT) plotting main functions and classes

plot_IGT_projection(igt_projection, dimensions=2, start_date=None, end_date=None, color_palette='Spectral', trajectory=False)[source]

Plots an interactive Information Geometric Temporal (IGT) plot from an code{IGTProjection} object. An IGT plot visualizes the variability among time batches in a data repository in a 2D or 3D plot. Time batches are positioned as points where the distance between them represents the probabilistic distance between their distributions (currently Jensen-Shannon distance). To track the temporal evolution, temporal batches are labeled to show their date and colored according to their season or period, according to the analysis period, as follows. If period==”year” the label is “yy” (2 digit year) and the color is according to year. If period==”month” the label is “yym” (yy + abbreviated month*) and the color is according to the season (yearly). If period==”week” the label is “yymmw” (yym + ISO week number in 1-2 digit) and the color is according to the season (yearly). An estimated smoothed trajectory of the information evolution over time can be shown using the optional “trajectory” parameter.

Note that since the projection is based on multidimensional scaling, a 2 dimensional projection entails a loss of information compared to a 3 dimensional projection. E.g., periodic variability components such as seasonal effect can be hindered by an abrupt change or a general trend.

Parameters:
  • igt_projection (IGTProjection) – The IGTProjection object containing the data for the temporal plot.

  • dimensions (int, optional) – The number of dimensions to be used for plotting the IGT projection (2D or 3D). Default is 2.

  • start_date (Optional[datetime], optional) – The starting date for the temporal plot. If None, it is not constrained. Default is None.

  • end_date (Optional[datetime], optional) – The ending date for the temporal plot. If None, it is not constrained. Default is None.

  • color_palette (PlotColorPalette, optional) – The color palette to be used for coloring the points. Default is Spectral.

  • trajectory (bool, optional) – If True, a smoothed trajectory showing the evolution of the information across time is plotted. Default is False.

Returns:

The Plotly figure object containing the IGT projection plot.

Return type:

Figure

dashi.unsupervised_characterization.variability_metrics.igt_projection module

Information Geometric Temporal class creation

class IGTProjection(data_temporal_map=None, projection=None, embedding_type=None, stress=None)[source]

Bases: object

Class IGTProjection object contains the estimated Information Geometric Temporal projection of a DataTemporalMap or MultiVariateDataTemporalMap objects

data_temporal_map

A DataTemporalMap or ‘MultiVariateDataTemporalMap’ object containing the temporal data map that was used for generating the projection.

Type:

Union[DataTemporalMap, MultiVariateDataTemporalMap, None]

projection

A 2D matrix matrix of floats representing the lower-dimensional projection of the temporal data. Each row corresponds to a data timestamp, with each column representing a dimension of the projection.

Type:

Union[List[List[float]], None]

embedding_type

A string representing the type of embedding used for the projection (e.g., “classicalmds”, “nonmetricmds”, “pca”).

Type:

Union[str, None]

stress

A float value representing the stress (or error) of the projection if it is available (used in MDS or similar techniques). The lower the stress value, the better the projection reflects the original data. This attribute is None if stress is not computed or available.

Type:

Union[float, None]

data_temporal_map: Union[DataTemporalMap, MultiVariateDataTemporalMap, None] = None
embedding_type: Optional[str] = None
projection: Optional[List[List[float]]] = None
stress: Optional[float] = None

dashi.unsupervised_characterization.variability_metrics.igt_projection_estimator module

Functions for Information Geometric Temporal creation

estimate_igt_projection(data_temporal_map, dimensions=2, start_date=None, end_date=None, embedding_type='classicalmds')[source]

Estimates the Information Geometric Temporal (IGT) projection of a temporal data map, either a DataTemporalMap, MultiVariateDataTemporalMap, or a dictionary containing {label: MultiVariateDataTemporalMap}.

The IGT projection is a technique to visualize the temporal relationships between data batches by projecting the data into a lower-dimensional space (e.g., 2D or 3D), with time batches represented as points. The distance between points reflects the probabilistic distance between the data distributions of those time batches.

Parameters:
  • data_temporal_map (Union[DataTemporalMap, MultiVariateDataTemporalMap, Dict[str, MultiVariateDataTemporalMap]]) – The data temporal map to project. This can either be a DataTemporalMap object (result of estimate_univariate_data_temporal_map), a MultiVariateDataTemporalMap object (result of estimate_multivariate_data_temporal_map), or a dictionary of MultiVariateDataTemporalMap objects where the keys are the selected labels (result of estimate_conditional_data_temporal_map).

  • dimensions (int, optional) – The number of dimensions to use for the projection (2 or 3). Defaults to 2.

  • start_date (Optional[datetime], optional) – The starting date for the temporal plot. If None, it is not constrained. Default is None.

  • end_date (Optional[datetime], optional) – The ending date for the temporal plot. If None, it is not constrained. Default is None.

  • embedding_type (str, optional) – The type of embedding technique to use for dimensionality reduction. Choices are ‘classicalmds’ (Classical Multidimensional Scaling), ‘pca’ (Principal Component Analysis) and ‘nonmetricmds’ (Non Metric Multidimensional Scaling). Defaults to ‘classicalmds’.

Returns:

The estimated IGT projection.

Return type:

IGTProjection

dashi.unsupervised_characterization.variability_metrics.igt_trajectory_estimator module

dashi.unsupervised_characterization.variability_metrics.plot_msv module

Main module for plotting Multi Source Variability (MSV) metrics.

plot_MSV(msv_metrics, dimensions=1, color_palette='Spectral')[source]

Plots a Multi Source Variability (MSV) metrics visualization from a code{MSVMetrics} object.

Parameters:
  • msv_metrics (MSVMetrics) – An instance of the MSVMetrics class containing the metrics to be plotted.

  • dimensions (int, optional) – The number of dimensions for the plot. Must be 1, 2, or 3. Default is 1.

  • color_palette (str, optional) – The color palette to use for the plot. Must be one of the valid color palettes defined in VALID_COLOR_PALETTES. Default is ‘Spectral’.

Returns:

A Plotly figure object containing the MSV metrics visualization.

Return type:

go.Figure

Module contents