metrics_as_scores.webapp package

Submodules

metrics_as_scores.webapp.app_hooks module

This module is called prior to the web application’s initialization.

metrics_as_scores.webapp.app_hooks.on_server_loaded(server_context)[source]

Called by bokeh when the application loads. This is the entry point. Here, we will read the requested dataset from the system’s arg-vector. It is expected there exists an argument in the shape dataset=<str>. If there exists another argument (without value) called preload, then all the dataset’s densities will be loaded into memory before the web application starts. Only recommended for large datasets and when you have enough memory available.

metrics_as_scores.webapp.data module

The purpose of this module is to exchange data only once, similar to a singleton pattern. When the application loads, the app-hooks are called first. Those will load the correct dataset and set values to the below properties only once during application lifecycle. Then, the web application can read these values.

metrics_as_scores.webapp.data.cdfs: dict[str, metrics_as_scores.tools.lazy.SelfResetLazy[dict[str, Union[metrics_as_scores.distribution.distribution.Empirical, metrics_as_scores.distribution.distribution.KDE_approx, metrics_as_scores.distribution.distribution.Parametric]]]]

A dictionary of the dataset’s densities.

metrics_as_scores.webapp.data.ds: Dataset

The dataset itself, including its manifest.

metrics_as_scores.webapp.data.dataset_dir: Path

The absolute path to the dataset. Needed primarily to load its HTML-fragments.

metrics_as_scores.webapp.exception module

exception metrics_as_scores.webapp.exception.PlotException(msg: str, *args: object)[source]

Bases: Exception

This exception is used only in the web application in order to differentiate ordinary exceptions from those thrown “by design” in the web application (e.g., when selecting a discrete random variable for a continuous quantity).

__init__(msg: str, *args: object) None[source]

metrics_as_scores.webapp.main module

This is the Web Application of Metrics As Scores. It should be run by using the command line interface and selecting a dataset. It is an interactive explorer for the selected dataset.

During development, this may also be run using the following commands:

bokeh serve src/metrics_as_scores/webapp/ --port 5678 --allow-websocket-origin * --args dataset=qcc

This command should be run from the project’s root. It will start a web server on port 5678 using the dataset qcc (use the ID of the dataset, it is shown by listing all locally available datasets in the CLI).

Module contents

This package holds the interactive web application, a principal features of Metrics As Scores. It allows the user to inspect and explore a dataset w.r.t. the distributions and scores of all features across all groups.