# Covariate shift

The covariate shift dashboard enables visualization of drift in all features (multivariate) and in a single feature, using six drift detection tests. If you prefer a video walkthrough, here is our guide explaining how to use the covariate shift page:

{% embed url="<https://youtu.be/9BWh6PkL9II>" %}

Here, you can find detailed descriptions of various elements on the covariate shift page:

<figure><img src="https://2363051145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWcs3xQupCdtvmF6k2Sun%2Fuploads%2F9qP2CV2bt7XBRk73V93m%2Fnew_covariate_shift_page.png?alt=media&#x26;token=7e426c4a-5614-419f-bc7c-d85aa1bc342e" alt=""><figcaption><p>Covariate shift dashboard.</p></figcaption></figure>

The **Covariate shift** dashboard consists of three main components:

### **1. Filters**

{% tabs %}
{% tab title="1.1 Methods" %}
Select which drift methods you want to have results displayed for. Drift methods that are not calculated are not visible under the filter. Selecting which drift measures you want to have calculated can be done under [model settings.](https://docs.nannyml.com/cloud/v0.20.2/product-tour/model-side-panel/model-settings) &#x20;

{% hint style="info" %}
Please find more info about statistical and distance measures in the [NannyML Open Source documentation.](https://nannyml.readthedocs.io/en/stable/how_it_works/univariate_drift_detection.html)
{% endhint %}

<figure><img src="https://2363051145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWcs3xQupCdtvmF6k2Sun%2Fuploads%2FjmsdmYbNHyInMVtqJ1jR%2Fnew_methods%20.png?alt=media&#x26;token=d33b3f97-456c-407f-9588-e07c6c2357e7" alt="" width="307"><figcaption><p>Covariate shift methods filter.</p></figcaption></figure>
{% endtab %}

{% tab title="1.2 Columns" %}
Filter charts for the columns you want to see. NannyML automatically identifies feature types such as targets, model outputs, and continuous and categorical features, making it easier for you to find the relevant ones.

{% hint style="info" %}
Note that the univariate drift detection methods can also be applied to the model output and the target, not just the features.
{% endhint %}

<figure><img src="https://2363051145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWcs3xQupCdtvmF6k2Sun%2Fuploads%2Fh8t3zfMeFr2r5gP6c9qf%2Fnew_columns.png?alt=media&#x26;token=786094b2-59e1-4c3d-8679-f4e6f3e9afa5" alt="" width="310"><figcaption><p>Columns filter.</p></figcaption></figure>
{% endtab %}

{% tab title="1.3 Alert status" %}
Select which drift measures to display depending on whether there are alerts in the last chunk, alerts in the previous chunks, or no alerts at all, or include all charts regardless of when and if any alerts occurred.

<figure><img src="https://2363051145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWcs3xQupCdtvmF6k2Sun%2Fuploads%2FiXfjnd2AATqCS5k8nRqD%2Fnew_alert_status.png?alt=media&#x26;token=a857d035-9234-408b-8454-033d81edd6a6" alt="" width="233"><figcaption><p>Alert status filter.</p></figcaption></figure>
{% endtab %}

{% tab title="1.4 Tags" %}
Filter charts by the previously specified tags.

<figure><img src="https://2363051145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWcs3xQupCdtvmF6k2Sun%2Fuploads%2FepXUMJD1D0yit1oimiIu%2Fcovariate_shift_tags.png?alt=media&#x26;token=f366db91-3b0e-4685-b58f-c738851d77a0" alt="" width="199"><figcaption><p>Tags filter.</p></figcaption></figure>
{% endtab %}
{% endtabs %}

### **2. Visualisations**

{% tabs %}
{% tab title="2.1 Sort by" %}
You can change the order of charts based on the metric name, number, or recency of the alerts.

<figure><img src="https://2363051145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWcs3xQupCdtvmF6k2Sun%2Fuploads%2FwoL7DMxUTSWVSD0XwTSc%2Fcovariate_shift_sort_by.png?alt=media&#x26;token=a32d5809-282e-435d-bc01-e50d148ede7d" alt="" width="194"><figcaption><p>Sort by window.</p></figcaption></figure>
{% endtab %}

{% tab title="2.2 Date range" %}
You can select a specific period of interest which applies to all charts.

<figure><img src="https://2363051145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWcs3xQupCdtvmF6k2Sun%2Fuploads%2FQF4norXN1wEx2tTUqJSy%2Fdate_range.png?alt=media&#x26;token=1b373de3-8a3c-411a-b32c-966371f73751" alt="" width="342"><figcaption><p>Date range window.</p></figcaption></figure>
{% endtab %}

{% tab title="2.3 Date reset" %}
To reset a previously set date period, whether using the date range or slider, simply press the "Reset" button.

<figure><img src="https://2363051145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWcs3xQupCdtvmF6k2Sun%2Fuploads%2FUWAouBfYp5yH7HkcZJto%2Fplot_data_format_gifs.gif?alt=media&#x26;token=6cc2a51b-a405-4244-bd7e-bd07e6d53f79" alt=""><figcaption><p>Date range reset.</p></figcaption></figure>
{% endtab %}

{% tab title="2.4 Date slider" %}
Similar to selecting a date range, you can choose a specific period of interest by simply moving the date slider.

<figure><img src="https://2363051145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWcs3xQupCdtvmF6k2Sun%2Fuploads%2FUWAouBfYp5yH7HkcZJto%2Fplot_data_format_gifs.gif?alt=media&#x26;token=6cc2a51b-a405-4244-bd7e-bd07e6d53f79" alt=""><figcaption><p>Date slider.</p></figcaption></figure>
{% endtab %}

{% tab title="2.5 Chart" %}
The charts are interactive, allowing you to hover over them for more details. Red dotted lines indicate the thresholds, while the blue line shows the metric during the reference period. The light blue line represents the metric during the analysis period.&#x20;

You can also zoom in on any part of a chart. Simply press and hold your mouse button, then draw a square over your area of interest. To reset the zoom, just double-click on the chart.&#x20;

<figure><img src="https://2363051145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWcs3xQupCdtvmF6k2Sun%2Fuploads%2F6oCdB0oaR5iZYEm8Tw7j%2Fcovariate_shift_plot.png?alt=media&#x26;token=9758e6d7-fc01-4947-97fa-79edf0ef44b5" alt=""><figcaption><p>Covariate shift plot.</p></figcaption></figure>
{% endtab %}
{% endtabs %}

### 3. Plots

{% tabs %}
{% tab title="3.1 Plot format" %}
There are three types of plot formats: **line**, **step**, and **distribution**. A line plot smoothly connects points with straight lines to show trends, while a step plot uses sharp vertical and horizontal lines to show exact changes between points clearly. The distribution plot gives you more insights into how feature distribution has changed over time.

<figure><img src="https://2363051145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWcs3xQupCdtvmF6k2Sun%2Fuploads%2FchVIuAmzxcUt5ajeQEba%2Fcovariate_shift_gifs.gif?alt=media&#x26;token=9e1dcbd5-5870-41ef-82ed-f6c3209bbac9" alt=""><figcaption><p>Plot formats.</p></figcaption></figure>
{% endtab %}

{% tab title="3.2 Datasets" %}
Select datasets to zoom in on reference, analysis, or create a separate subplot for both.&#x20;

<figure><img src="https://2363051145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWcs3xQupCdtvmF6k2Sun%2Fuploads%2F5ikire6geXQnV2lmK8RR%2Fdatasets_gif.gif?alt=media&#x26;token=77ca4d9d-1e9a-4394-8ada-049383029e06" alt=""><figcaption><p>Datasets plots.</p></figcaption></figure>
{% endtab %}

{% tab title="3.3 Plot elements" %}
Toggle on or off some components on the charts, like alerts, confidence bands, thresholds, and legends.

<figure><img src="https://2363051145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWcs3xQupCdtvmF6k2Sun%2Fuploads%2FocvP9pUOsrpKDJmtJpvO%2Fplot_elements_correct_gif.gif?alt=media&#x26;token=7349e037-228a-4dde-9a42-51dbc331c03c" alt=""><figcaption><p>Plot elements.</p></figcaption></figure>
{% endtab %}
{% endtabs %}

###
