forked from fairlearn/fairlearn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOC Changing the dataset from Adult to Diabetes Hospital in Getting S…
…tarted (fairlearn#1310) Co-authored-by: Hilde Weerts <[email protected]> Co-authored-by: Roman Lutz <[email protected]> Co-authored-by: MiroDudik <[email protected]> Co-authored-by: Richard Edgar (Microsoft) <[email protected]>
- Loading branch information
1 parent
ee71adc
commit 23789b2
Showing
5 changed files
with
151 additions
and
94 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright (c) Microsoft Corporation and Fairlearn contributors. | ||
# Licensed under the MIT License. | ||
|
||
""" | ||
============= | ||
Value counts | ||
============= | ||
""" | ||
from fairlearn.datasets import fetch_diabetes_hospital | ||
import matplotlib.pyplot as plt | ||
|
||
|
||
# %% | ||
fig, ax = plt.subplots() | ||
|
||
data = fetch_diabetes_hospital(as_frame=True) | ||
X = data.data | ||
X.drop(columns=["readmitted", "readmit_binary"], inplace=True) | ||
y_true = data.target | ||
race = X['race'] | ||
|
||
df = race.value_counts().reset_index() | ||
|
||
ax.bar(df["race"], df["count"]) | ||
ax.set_title('Counts by race') | ||
ax.tick_params(axis='x', labelrotation=45) | ||
|
||
plt.tight_layout() | ||
plt.show() |
This file was deleted.
Oops, something went wrong.