IBM / monitor-ibm-cloud-pak-with-watson-openscale

Data analysis, model building, and deploying with Watson Machine Learning with notebook
https://developer.ibm.com/patterns/data-analysis-model-building-and-deploying-with-wml/
Apache License 2.0
4 stars 18 forks source link

Historical counts not showing in WOS fairness monitor #25

Open N-otna opened 4 years ago

N-otna commented 4 years ago

Hi,

I am configuring OpenScale to monitor a deployed model, and inject seven days' worth of historical records and measurements for viewing in the OpenScale Insights dashboard. I am following this repo and running notebooks/ConfigureOpenScale.ipynb.

For some reason, after I inject historical fairness logs (step 8.2 in the notebook), the counts remain at 0 when I select any of the historical fairness data points and look at the Payload + Perturbed tab:

Screenshot 2020-05-14 at 14 47 32

The other tabs, such as the Debiased one for example show the counts properly:

Screenshot 2020-05-14 at 14 48 47

This problem only happens with historical logs, so I assume something may be missing in the data/fairness_history.json file. Although the counts seem to be specified, WOS doesn't pick them up. See extract of the json file:

[
  {
    "metrics": [
      {
        "feature": "Sex",
        "majority": {
          "values": [
            {
              "value": "male",
              "distribution": {
                "male": [
                  {
                    "count": 84,
                    "label": "No Risk",
                    "is_favourable": true
                  },
                  {
                    "count": 45,
                    "label": "Risk",
                    "is_favourable": false
                  }
                ]
              },
              "fav_class_percent": 75.5
            }
          ],
          "total_fav_percent": 75.5,
          "total_rows_percent": 33.33333333333333
        },
        "minority": {
          "values": [
            {
              "value": "female",
              "is_biased": true,
              "distribution": {
                "female": [
                  {
                    "count": 65,
                    "label": "No Risk",
                    "is_favourable": true
                  },
                  {
                    "count": 6,
                    "label": "Risk",
                    "is_favourable": false
                  }
                ]
              },
              "fairness_value": 0.947,
              "fav_class_percent": 71.5
            }
          ],
          "total_fav_percent": 71.5,
          "total_rows_percent": 33.33333333333333
        }
      },
rounok commented 4 years ago

The version in pmservice is working okay. Please sync up the historical file data from there. sample working version: https://github.com/pmservice/ai-openscale-tutorials/blob/master/notebooks/Watson%20OpenScale%20and%20Watson%20ML%20Engine%20-%20CP4D.ipynb