-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests passing for dask backend, improved coverage
- Loading branch information
Showing
63 changed files
with
368 additions
and
319 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,34 @@ | ||
# Fairness | ||
|
||
Fairness-aware postprocessors always require an additional keyword argument | ||
`sensitive=...` to be passed to their rank or transform methods. | ||
Fairness-aware graph filters and | ||
postprocessors are provided. Below | ||
we provide two example node ranking algorithms | ||
that make personalized PageRank fairer by | ||
supplying it with a postprocessor or straight | ||
up using a variation. | ||
|
||
```python | ||
import pygrank as pg | ||
|
||
ppro = pg.PageRank(alpha=0.9, max_iters=1000, tol=1.E-9) >> pg.AdHocFairness("O") | ||
lfpr = pg.LFPR(alpha=0.9, max_iters=1000, tol=1.E-9) | ||
``` | ||
|
||
When calling fairness-aware methods, add a *sensitive* keyword | ||
argument that holds information that together with a graph | ||
can construct a graph signal. | ||
|
||
Several measures also provide fairness assessment. | ||
|
||
```python | ||
_, graph, groups = next(pg.load_datasets_multiple_communities(['citeseer'], max_group_number=2, directed=False)) | ||
measure = pg.pRule(groups[1]) | ||
|
||
pg.benchmark_print_line("ppro", ppro(graph, groups[0], sensitive=groups[1]) >> measure) | ||
pg.benchmark_print_line("lfpr", lfpr(graph, groups[0], sensitive=groups[1]) >> measure) | ||
``` | ||
|
||
!!! info | ||
For multidimensional fairness evaluation of node | ||
ranking algorithms, prefer using the | ||
`fairbench` library. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.