Skip to content

Visualization

The fourth (and last) step in the EDS-TeVa usage workflow is setting the thresholds associated with the coefficients and the metrics of the Model fitted on the Probes.

Definition

The EDS-TeVa library provides dashboards and plots to visualize the temporal evolution of Probes along with fitted Models. Visualization functionalities can be used to explore the database and set thresholds relative to selection criteria.

Image title

Visualization diagram

Dashboard

A Dashboard is an interactive Altair chart that lets you visualize variables aggregated by any combination of columns included in the Probe. In the library, the dashboards are divided into two parts:

  • On the top, there is the plot of the aggregated variable of interest.
  • On the bottom, there are interactive filters to set. Only the selected data is aggregated to produce the plot on the top.

Plot

A Plot is exportable in png or svg format and easy to integrate into a report. However, as it is less interactive it is preferred to specify the filters in the inputs of the functions.

Available Visualizations

The library provides interactive dashboards that let you set any combination of care sites, stay types and other columns if included in the Probe. You can only export a dashboard in HTML format.

The probe_dashboard() returns:

  • On the top, the aggregated variable is the average completeness predictor c(t) over time t with the prediction c^(t) if the fitted Model is specified.
  • On the bottom, the interactive filters are all the columns included in the Probe (such as time, care site, number of visits...etc.).

from edsteva.viz.dashboards import probe_dashboard

probe_dashboard(
    probe=probe,
    fitted_model=step_function_model,
    care_site_level=care_site_level,
)
An example is available here.

The normalized_probe_dashboard() returns a representation of the overall deviation from the Model:

  • On the top, the aggregated variable is a normalized completeness predictor c(t)c0 over normalized time tt0.
  • On the bottom, the interactive filters are all the columns included in the Probe (such as time, care site, number of visits...etc.) with all the Model coefficients and metrics included in the Model.
from edsteva.viz.dashboards import normalized_probe_dashboard

normalized_probe_dashboard(
    probe=probe,
    fitted_model=step_function_model,
    care_site_level=care_site_level,
)

An example is available here.

The library provides static plots that you can export in png or svg. As it is less interactive, you may specify the filters in the inputs of the functions.

The probe_plot() returns the top plot of the probe_dashboard(): the normalized completeness predictor c(t)c0 over normalized time tt0.

from edsteva.viz.plots import probe_plot

probe_plot(
    probe=probe,
    fitted_model=step_function_model,
    care_site_level=care_site_level,
    stay_type=stay_type,
    save_path=plot_path,
)

Mar 2016Apr 2016May 2016Jun 2016Jul 2016Aug 2016Sep 2016Oct 2016Nov 2016Dec 2016Jan 2017Feb 2017Mar 2017Apr 2017May 2017Jun 2017Jul 2017Aug 2017Sep 2017Oct 2017Nov 2017Dec 2017Jan 2018Feb 2018Mar 2018Apr 2018May 2018Jun 2018Jul 2018Aug 2018Sep 2018Oct 2018Nov 2018Dec 2018Jan 2019Feb 2019Mar 2019Apr 2019May 2019Jun 2019Jul 2019Aug 2019Sep 2019Oct 2019Nov 2019Dec 2019Jan 2020Feb 2020Mar 2020Apr 2020May 2020Jun 2020Jul 2020Aug 2020Sep 2020Oct 2020Nov 2020Dec 2020Jan 2021Feb 2021Mar 2021Apr 2021May 2021Jun 2021Jul 2021Aug 2021Sep 2021Oct 2021Nov 2021Dec 2021Time (Month Year)0.00.10.20.30.40.50.60.70.80.91.0Completeness predictor c(t)Hôpital-1Hôpital-2Hôpital-3Predictor c(t)Model f(t)

The normalized_probe_plot() returns the top plot of the normalized_probe_dashboard(). Consequently, you have to specify the filters in the inputs of the function.

from edsteva.viz.plots import normalized_probe_plot

normalized_probe_plot(
    probe=probe,
    fitted_model=step_function_model,
    t_min=-15,
    t_max=15,
    save_path=plot_path,
)
−15−14−13−12−11−10−9−8−7−6−5−4−3−2−10123456789101112131415Δt = (t - t₀) months0.00.51.01.52.0c(Δt) / c₀AllUrg_HospitMeanPredictor lineStandard deviationError bandStepFunctionModel line
Group by:

The estimates_densities_plot() returns the density plot and the median of each estimate. It can help you to set the thresholds.

from edsteva.viz.plots import estimates_densities_plot

estimates_densities_plot(
    fitted_model=step_function_model,
)
{ "schema-url": "../../assets/charts/estimates_densities.json" }