Skip to content

Commit

Permalink
Merge pull request #6 from ZanMervic/docs
Browse files Browse the repository at this point in the history
As Fairness Data widget documentation fix
  • Loading branch information
ZanMervic authored Dec 7, 2023
2 parents 7c7a229 + 945c4f5 commit eb278e6
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Widgets
.. toctree::
:maxdepth: 1

widgets/as-fairness
widgets/as-fairness-data
widgets/dataset-bias
widgets/reweighing
widgets/adversarial-debiasing
Expand Down
6 changes: 3 additions & 3 deletions doc/widgets.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"Fairness",
[
{
"text": "As Fairness",
"doc": "widgets/as-fairness.md",
"icon": "../orangecontrib/fairness/widgets/icons/as_fairness.svg",
"text": "As Fairness Data",
"doc": "widgets/as-fairness-data.md",
"icon": "../orangecontrib/fairness/widgets/icons/as_fairness_data.svg",
"keywords": [
"fairness"
]
Expand Down
24 changes: 24 additions & 0 deletions doc/widgets/as-fairness-data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
As Fairness Data
================
Adds Fairness attributes to the dataset.

**Inputs**

- Data: reference dataset

**Outputs**

- Data: reference dataset with selected Fairness meta-attributes.

**As Fairness Data** is a widget that allows the user to select and add Fairness meta-attributes to the dataset. These meta-attributes are required by other fairness widget to function properly. These meta-attributes are: `Favorable Class Value`, `Protected Attributes` and `Privileged Protected Attribute Values`.

![](images/as-fairness-data.png)

Example
-------

This simple example shows how to use the **As Fairness Data** widget. First, we load the German Credit Data dataset and then we connect it to the **As Fairness Data** widget. We select the `Personal status and sex` attribute as the `Protected Attribute` and all values representing males as the `Privileged Protected Attribute Values`. We also select `good` as the `Favorable Class Value`. The output of the widget is a dataset with the added meta-attributes.

![](images/as-fairness-data-example.png)

It should be noted that datasets included in orange with the tag `fairness` already have some default fairness meta-attributes added to them and thus do not require the use of the **As Fairness Data** widget before using other fairness widgets. These datasets include: `Adult`, `German Credit Data` and `COMPAS Analysis`.
24 changes: 0 additions & 24 deletions doc/widgets/as-fairness.md

This file was deleted.

2 changes: 1 addition & 1 deletion doc/widgets/dataset-bias.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ This example shows a very simple use of the **Dataset Bias** widget. First we lo

![](images/dataset-bias-example.png)

Note, we did not use the [As Fairness Data](as-fairness.md) widget before using the **Dataset Bias** widget. This is because the Adult dataset already has the required fairness meta-attributes added to it.
Note, we did not use the [As Fairness Data](as-fairness-data.md) widget before using the **Dataset Bias** widget. This is because the Adult dataset already has the required fairness meta-attributes added to it.

Another thing to note is that the **Dataset Bias** widget (and other fairness widgets) do not support missing values, this is indicated by the warning icon above the widget. Any missing values in the dataset will automatically be imputed with the average or most frequent value before being used by the widget.
2 changes: 1 addition & 1 deletion orangecontrib/fairness/widgets/owasfairness.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class OWAsFairness(OWWidget):
"""
name = "As Fairness Data"
description = "Converts a dataset to a fairness dataset with marked favorable class values, protected attributes and priviliged protected attribute values."
icon = 'icons/as_fairness.svg'
icon = 'icons/as_fairness_data.svg'
priority = 0

want_main_area = False
Expand Down

0 comments on commit eb278e6

Please sign in to comment.