diff --git a/examples/notebooks/responsibleaidashboard-housing-classification-model-debugging.ipynb b/examples/notebooks/responsibleaidashboard-housing-classification-model-debugging.ipynb index 7fefb941..66b4cb42 100644 --- a/examples/notebooks/responsibleaidashboard-housing-classification-model-debugging.ipynb +++ b/examples/notebooks/responsibleaidashboard-housing-classification-model-debugging.ipynb @@ -134,7 +134,7 @@ " return X, y\n", "\n", "target_feature = 'Sold_HigherThan_Median'\n", - "categorical_features = []\n", + "categorical_features = [\"OverallQual\", \"OverallCond\"]\n", "\n", "all_data = pd.read_csv(data_path)\n", "all_data = all_data.drop(['SalePrice','SalePriceK'], axis=1)\n", @@ -660,6 +660,11 @@ " \"threshold\": \">=0.7\"\n", " },\n", " \"precision_score\": {}\n", + " },\n", + " \"Fairness\": {\n", + " \"metric\": [\"accuracy_score\"],\n", + " \"sensitive_features\": [\"OverallQual\", \"OverallCond\"],\n", + " \"fairness_evaluation_kind\": \"ratio\"\n", " }\n", "}\n", "\n", diff --git a/src/responsibleai/rai_analyse/_score_card/classification_components.py b/src/responsibleai/rai_analyse/_score_card/classification_components.py index bac84ddd..0907f12c 100644 --- a/src/responsibleai/rai_analyse/_score_card/classification_components.py +++ b/src/responsibleai/rai_analyse/_score_card/classification_components.py @@ -357,11 +357,11 @@ def get_fairness_bar_plot(data): ] x_data = [ 100 * (get_metric( - "selection_rate", - data[c]["y_test"], - data[c]["y_pred"]), - data[c]["pos_label"] - ) + metric="selection_rate", + y_test=data[c]["y_test"], + y_pred=data[c]["y_pred"], + pos_label=data[c]["pos_label"] + )) for c in data ] x_data = [[x, 100 - x] for x in x_data]