{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "8071c256-54ef-4260-87e8-1aaef23c5010",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "import os\n",
    "import sys\n",
    "module_path = os.path.abspath(os.path.join('..', '..'))\n",
    "if module_path not in sys.path:\n",
    "    sys.path.append(module_path)\n",
    "import warnings\n",
    "warnings.filterwarnings('ignore')\n",
    "import facts\n",
    "from facts.clean import clean_dataset\n",
    "from facts import valid_ifthens_with_coverage_correctness, rules2rulesbyif\n",
    "from facts.models import customLogisticRegression\n",
    "from facts.parameters import ParameterProxy\n",
    "from facts.formatting import recourse_report_reverse, print_recourse_report, print_recourse_report_cumulative, print_recourse_report_KStest_cumulative\n",
    "from facts.utils import load_rules_by_if\n",
    "from facts.fairness_metrics_aggr import get_diff_table, get_comb_df, get_analysis_dfs,get_other_ranks_divided,get_map_metric_to_max_rank,get_diff_real_diff_drop"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "a09c4c77",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pathlib import Path\n",
    "\n",
    "computed_rules_file = Path(\"..\") / \"..\" / \"Pre-computed Results\" / \"IBM_AdCampaign\" / \"rulesAdCampaign_atomic.data\"\n",
    "computed_rules_with_cumulative_file = Path(\"..\") / \"..\" / \"Pre-computed Results\" / \"IBM_AdCampaign\" / \"rulesAdCampaign_cumulative.data\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "166a2d91-1ddc-4236-a497-fa20520d1057",
   "metadata": {},
   "outputs": [],
   "source": [
    "cost_budget = 10\n",
    "top_count = 20\n",
    "c_inf = 5"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c3dd2b22-5b50-4997-b484-c934d615c3e0",
   "metadata": {},
   "source": [
    "# Dataset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "c152f556-8250-4d43-b62e-3331aa937200",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>religion</th>\n",
       "      <th>politics</th>\n",
       "      <th>gender</th>\n",
       "      <th>parents</th>\n",
       "      <th>ages</th>\n",
       "      <th>income</th>\n",
       "      <th>area</th>\n",
       "      <th>college_educated</th>\n",
       "      <th>homeowner</th>\n",
       "      <th>true_conversion</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>1</td>\n",
       "      <td>55-64</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Other</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>1</td>\n",
       "      <td>55-64</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Urban</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Female</td>\n",
       "      <td>1</td>\n",
       "      <td>55-64</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Female</td>\n",
       "      <td>1</td>\n",
       "      <td>55-64</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Female</td>\n",
       "      <td>1</td>\n",
       "      <td>55-64</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Urban</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  religion politics   gender  parents   ages   income     area  \\\n",
       "0  Unknown  Unknown  Unknown        1  55-64  Unknown  Unknown   \n",
       "1    Other  Unknown  Unknown        1  55-64  Unknown    Urban   \n",
       "2  Unknown  Unknown   Female        1  55-64  Unknown  Unknown   \n",
       "3  Unknown  Unknown   Female        1  55-64  Unknown  Unknown   \n",
       "4  Unknown  Unknown   Female        1  55-64  Unknown    Urban   \n",
       "\n",
       "   college_educated  homeowner  true_conversion  \n",
       "0                 1          1                0  \n",
       "1                 1          1                0  \n",
       "2                 1          1                0  \n",
       "3                 1          1                0  \n",
       "4                 1          1                0  "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "DATAFILE = '../../../ad_campaign_data.csv' # location of dataset\n",
    "random_state = None # change to something for exactly reproducible results\n",
    "\n",
    "# as selected in \"tutorial_bias_advertising\" notebook\n",
    "selected_features = ['religion','politics','gender', 'parents', 'ages', 'income', 'area', 'college_educated', 'homeowner']\n",
    "cate_features = ['religion','politics','gender', 'parents', 'ages', 'income', 'area', 'college_educated']\n",
    "num_features = ['homeowner']\n",
    "\n",
    "# if not specified, set to 1\n",
    "feature_weights = {\"gender\": 1, \"parents\": 1, \"age\": 1}\n",
    "\n",
    "target_name = \"true_conversion\"\n",
    "positive_label = 1\n",
    "negative_label = 0\n",
    "\n",
    "model_train_fraction = 0.7\n",
    "learning_class_weights = {0: 0.5, 1: 265}\n",
    "\n",
    "sensitive_attribute = \"gender\"\n",
    "sensitive_alias = {\"M\": \"Male\", \"F\": \"Female\", \"Unknown\": \"Unknown\"}\n",
    "\n",
    "ad_conversion_dataset = pd.read_csv(DATAFILE)\n",
    "ad_conversion_dataset.gender = ad_conversion_dataset.gender.map(sensitive_alias)\n",
    "ad_conversion_dataset.rename(columns = {'age':'ages'}, inplace = True)\n",
    "ad_conversion_dataset = ad_conversion_dataset[selected_features + [target_name]]\n",
    "ad_conversion_dataset.head()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "31e8d05f-0136-4535-91bd-b8df86813187",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "y = ad_conversion_dataset['true_conversion']\n",
    "X = ad_conversion_dataset.drop('true_conversion', axis=1)\n",
    "\n",
    "num_features = X._get_numeric_data().columns.to_list()\n",
    "cate_features = X.select_dtypes(include=['object','category']).columns.to_list()\n",
    "ord_features = []"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2d1a3985-25b8-4fc7-ba40-a133d9ce7bf8",
   "metadata": {},
   "source": [
    "# Rules"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "f5d34e36-5988-4a04-bbe6-5b528f4e4506",
   "metadata": {},
   "outputs": [],
   "source": [
    "rules_with_atomic_correctness = load_rules_by_if(computed_rules_file)\n",
    "rules_with_cumulative_correctness = load_rules_by_if(computed_rules_with_cumulative_file)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "7ce8c71c-e23d-4bd7-9d05-519491724927",
   "metadata": {},
   "outputs": [],
   "source": [
    "num_features = []\n",
    "cate_features = ['religion','politics', 'parents', 'ages', 'income', 'area', 'college_educated', 'homeowner']\n",
    "ord_features = []\n",
    "\n",
    "feature_weights = {'religion':5,'politics':2, 'parents':3, 'ages':10, 'income':3, 'area':2, 'college_educated':3, 'homeowner':1}\n",
    "features_with_binary_cost = cate_features\n",
    "features_with_proportional_cost = num_features\n",
    "\n",
    "\n",
    "comparators = facts.feature_change_builder(\n",
    "    X,\n",
    "    num_cols=features_with_proportional_cost,\n",
    "    cate_cols=features_with_binary_cost,\n",
    "    ord_cols=ord_features,\n",
    "    feature_weights=feature_weights,\n",
    "    num_normalization=False,\n",
    ")\n",
    "params = ParameterProxy(featureChanges=comparators)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "16f75540-1605-4fcc-80a7-d483c2f99f7c",
   "metadata": {},
   "source": [
    "# Macro Viewpoint"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "affdd8c2-2468-4366-ba6c-74e0defb0812",
   "metadata": {},
   "source": [
    "## Equal Cost of Effectiveness (Macro)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "638ae849-4c7b-4ee0-91aa-34f40191cf40",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mhomeowner = 1\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m98.67%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m94.80%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m98.31%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m93.00%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\t\u001b[35mNo bias!\u001b[39m\n",
      "If \u001b[1mhomeowner = 1, income = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m95.78%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m95.46%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m95.46%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m93.93%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\t\u001b[35mNo bias!\u001b[39m\n",
      "If \u001b[1mhomeowner = 1, parents = 1\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m92.94%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m97.45%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m93.06%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m96.53%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\t\u001b[35mNo bias!\u001b[39m\n",
      "If \u001b[1mcollege_educated = 1, homeowner = 1\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m92.74%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m94.82%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m92.73%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m93.02%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\t\u001b[35mNo bias!\u001b[39m\n",
      "If \u001b[1mcollege_educated = 1, homeowner = 1, income = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m89.99%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m95.49%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m90.04%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m93.94%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\t\u001b[35mNo bias!\u001b[39m\n",
      "If \u001b[1mcollege_educated = 1, homeowner = 1, parents = 1\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m87.33%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m97.46%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m87.76%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m96.55%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\t\u001b[35mNo bias!\u001b[39m\n"
     ]
    }
   ],
   "source": [
    "top_rules, subgroup_costs = facts.select_rules_subset(\n",
    "    rules_with_atomic_correctness,\n",
    "    metric=\"min-above-thr\",\n",
    "    sort_strategy=\"generic-sorting-ignore-exists-subgroup-empty\",\n",
    "    top_count=top_count,\n",
    "    cor_threshold=0.7,\n",
    "    filter_sequence = [\n",
    "        \"remove-contained\",\n",
    "        \"remove-below-thr\",        \n",
    "        #\"remove-fair-rules\",\n",
    "        \"keep-only-min-change\"\n",
    "    ],\n",
    "    params=params\n",
    ")\n",
    "\n",
    "print_recourse_report(\n",
    "    top_rules,\n",
    "    subgroup_costs=subgroup_costs,\n",
    "    show_subgroup_costs=True,\n",
    "    metric_name = 'Equal Cost of Effectiveness (Macro) (threshold = 0.7)'\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4a3d96ad-7b69-4a2d-9274-3a2a0279be7e",
   "metadata": {},
   "source": [
    "## Equal Choice for Recourse(Macro)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "37d3d6be-08f8-41ca-83fb-37a7e5f61420",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m53.09%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m85.47%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m85.47%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.52%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.52%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-4.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m48.86%\u001b[39m covered\n",
      "\t\t\u001b[31mNo recourses for this subgroup!\u001b[39m\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Choice for Recourse(Macro) (threshold = 0.7). Unfairness score = 4.\u001b[39m\n",
      "If \u001b[1marea = Unknown, homeowner = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m51.81%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m90.59%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.24%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.27%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m85.15%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m85.15%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.29%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.29%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-7.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m47.69%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m90.10%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.61%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.61%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-3.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Choice for Recourse(Macro) (threshold = 0.7). Unfairness score = 4.\u001b[39m\n",
      "If \u001b[1marea = Unknown, income = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m50.65%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m86.44%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m86.44%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.62%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.62%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-4.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m46.53%\u001b[39m covered\n",
      "\t\t\u001b[31mNo recourses for this subgroup!\u001b[39m\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Choice for Recourse(Macro) (threshold = 0.7). Unfairness score = 4.\u001b[39m\n",
      "If \u001b[1marea = Unknown, college_educated = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m50.09%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.18%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.18%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.52%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.52%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-4.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m46.06%\u001b[39m covered\n",
      "\t\t\u001b[31mNo recourses for this subgroup!\u001b[39m\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Choice for Recourse(Macro) (threshold = 0.7). Unfairness score = 4.\u001b[39m\n",
      "If \u001b[1marea = Unknown, homeowner = 1, income = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m49.97%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m91.73%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.38%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.41%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m86.29%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m86.29%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m99.56%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.52%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.52%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.57%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.57%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-10.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m45.94%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m91.37%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.79%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.79%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m96.58%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.57%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.57%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-6.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Choice for Recourse(Macro) (threshold = 0.7). Unfairness score = 4.\u001b[39m\n",
      "If \u001b[1marea = Unknown, college_educated = 1, homeowner = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m48.88%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m90.58%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.38%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.41%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m89.96%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m89.96%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m, \u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m90.35%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.29%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.29%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-8.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m44.97%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m90.11%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.62%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.62%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m, \u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m89.97%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-4.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Choice for Recourse(Macro) (threshold = 0.7). Unfairness score = 4.\u001b[39m\n"
     ]
    }
   ],
   "source": [
    "top_rules, subgroup_costs = facts.select_rules_subset(\n",
    "    rules_with_atomic_correctness,\n",
    "    metric=\"num-above-thr\",\n",
    "    sort_strategy=\"generic-sorting-ignore-forall-subgroups-empty\",\n",
    "    top_count=top_count,\n",
    "    cor_threshold=0.7,\n",
    "    filter_sequence = [\n",
    "        \"remove-contained\",\n",
    "        \"remove-below-thr\",\n",
    "        \"remove-fair-rules\"\n",
    "    ],\n",
    "    params=params\n",
    ")\n",
    "\n",
    "print_recourse_report(\n",
    "    top_rules,\n",
    "    subgroup_costs=subgroup_costs,\n",
    "    show_subgroup_costs=True,\n",
    "    metric_name = 'Equal Choice for Recourse(Macro) (threshold = 0.7)'\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0be2f149-b6b2-4faa-8804-7f188c0fcd9a",
   "metadata": {},
   "source": [
    "# Micro Viewpoint"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d7b0a1f7-547b-475b-a90b-4147a7d7e396",
   "metadata": {},
   "source": [
    "##  Equal Conditional Mean Recourse"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "7fdbe147-c273-47bc-836a-6a0b6d4dccab",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, income = Unknown, parents = 0, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m2.77%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m14.23%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m14.23%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m14.23%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m14.23%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m14.23%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m9.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m2.52%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m3.00\u001b[39m\n",
      "\t\u001b[35mBias against Male due to Equal Conditional Mean Recourse. Unfairness score = 6.004.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, parents = 0, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m2.95%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m14.28%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m14.28%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m14.28%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m14.28%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.78%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.78%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m9.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m2.67%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m12.69%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m12.69%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m12.69%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m12.69%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m12.69%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m12.69%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m12.69%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m12.69%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m12.69%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m12.69%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m3.00\u001b[39m\n",
      "\t\u001b[35mBias against Male due to Equal Conditional Mean Recourse. Unfairness score = 6.0.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, parents = 0, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m3.07%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m13.70%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m16.41%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m16.41%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m16.41%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m93.64%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m93.64%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.64%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.64%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m8.89\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m2.79%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m12.16%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m13.30%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m13.30%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m13.30%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m15.19%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m15.19%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m15.19%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m15.19%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m4.02\u001b[39m\n",
      "\t\u001b[35mBias against Male due to Equal Conditional Mean Recourse. Unfairness score = 4.868.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, parents = 0, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m2.90%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m13.54%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m16.32%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m16.32%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m16.32%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m16.32%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.03%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.03%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.48%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.48%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m8.90\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m2.65%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m12.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m13.10%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m13.10%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m13.10%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m13.10%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m15.05%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m15.05%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m15.07%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m15.07%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m4.06\u001b[39m\n",
      "\t\u001b[35mBias against Male due to Equal Conditional Mean Recourse. Unfairness score = 4.834.\u001b[39m\n",
      "If \u001b[1mages = 25-34, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m1.23%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m27.74%\u001b[39m and counterfactual cost = 13.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m27.74%\u001b[39m and counterfactual cost = 15.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m27.74%\u001b[39m and counterfactual cost = 15.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m27.74%\u001b[39m and counterfactual cost = 18.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m27.74%\u001b[39m and counterfactual cost = 18.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m13.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m1.10%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m4.68%\u001b[39m and counterfactual cost = 13.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m4.68%\u001b[39m and counterfactual cost = 15.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m4.68%\u001b[39m and counterfactual cost = 15.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m30.96%\u001b[39m and counterfactual cost = 18.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m30.96%\u001b[39m and counterfactual cost = 18.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m17.24\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Conditional Mean Recourse. Unfairness score = 4.244.\u001b[39m\n",
      "If \u001b[1mages = 25-34, college_educated = 1, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m1.15%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 13.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m27.63%\u001b[39m and counterfactual cost = 13.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m27.63%\u001b[39m and counterfactual cost = 15.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m27.63%\u001b[39m and counterfactual cost = 15.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m27.63%\u001b[39m and counterfactual cost = 18.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m27.63%\u001b[39m and counterfactual cost = 18.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m13.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m1.04%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 13.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m4.95%\u001b[39m and counterfactual cost = 13.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m4.95%\u001b[39m and counterfactual cost = 15.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m4.95%\u001b[39m and counterfactual cost = 15.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m30.83%\u001b[39m and counterfactual cost = 18.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m30.83%\u001b[39m and counterfactual cost = 18.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m17.20\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Conditional Mean Recourse. Unfairness score = 4.197.\u001b[39m\n",
      "If \u001b[1mages = 55-64, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m63.34%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m30.66%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m30.66%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m30.66%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m30.66%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m30.66%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m3.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m58.02%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m4.93%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m4.93%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m4.93%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m30.21%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m30.21%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m7.18\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Conditional Mean Recourse. Unfairness score = 4.184.\u001b[39m\n",
      "If \u001b[1mages = 45-54, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m1.15%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m27.73%\u001b[39m and counterfactual cost = 13.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m27.73%\u001b[39m and counterfactual cost = 15.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m27.73%\u001b[39m and counterfactual cost = 15.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m27.73%\u001b[39m and counterfactual cost = 18.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m27.73%\u001b[39m and counterfactual cost = 18.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m13.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m1.06%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m5.14%\u001b[39m and counterfactual cost = 13.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m5.14%\u001b[39m and counterfactual cost = 15.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m5.14%\u001b[39m and counterfactual cost = 15.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m31.21%\u001b[39m and counterfactual cost = 18.0.\n",
      "\t\tMake \u001b[1m\u001b[31mages = 55-64\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m31.21%\u001b[39m and counterfactual cost = 18.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m17.18\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Conditional Mean Recourse. Unfairness score = 4.176.\u001b[39m\n"
     ]
    }
   ],
   "source": [
    "top_rules, subgroup_costs = facts.select_rules_subset_cumulative(\n",
    "    rules_with_cumulative_correctness,\n",
    "    metric=\"fairness-of-mean-recourse-conditional\",\n",
    "    sort_strategy=\"generic-sorting-ignore-exists-subgroup-empty\",\n",
    "    top_count=top_count,\n",
    "    filter_sequence = [\n",
    "        \"remove-contained\",\n",
    "        \"remove-fair-rules\"\n",
    "    ],\n",
    "    params=params\n",
    ")\n",
    "\n",
    "print_recourse_report_cumulative(\n",
    "    top_rules,\n",
    "    subgroup_costs=subgroup_costs,\n",
    "    show_subgroup_costs=True,\n",
    "    show_then_costs=True,\n",
    "    metric_name = 'Equal Conditional Mean Recourse'\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cfac3d57-0748-487d-8d88-a26016ee2000",
   "metadata": {},
   "source": [
    "## Equal Cost of Effectiveness (Micro)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "12c3c19c-65e3-4b13-9f4c-39b2a04643a3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mhomeowner = 1\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m98.67%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m94.80%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m98.31%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m93.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\t\u001b[35mNo bias!\u001b[39m\n",
      "If \u001b[1mhomeowner = 1, income = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m95.78%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m95.46%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m95.46%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m93.93%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\t\u001b[35mNo bias!\u001b[39m\n",
      "If \u001b[1mhomeowner = 1, parents = 1\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m92.94%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m97.45%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m93.06%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m96.53%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\t\u001b[35mNo bias!\u001b[39m\n",
      "If \u001b[1mcollege_educated = 1, homeowner = 1\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m92.74%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m94.82%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m92.73%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m93.02%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\t\u001b[35mNo bias!\u001b[39m\n",
      "If \u001b[1mcollege_educated = 1, homeowner = 1, income = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m89.99%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m95.49%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m90.04%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m93.94%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\t\u001b[35mNo bias!\u001b[39m\n",
      "If \u001b[1mcollege_educated = 1, homeowner = 1, parents = 1\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m87.33%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m97.46%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m87.76%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m96.55%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\t\u001b[35mNo bias!\u001b[39m\n"
     ]
    }
   ],
   "source": [
    "top_rules, subgroup_costs = facts.select_rules_subset_cumulative(\n",
    "    rules_with_cumulative_correctness,\n",
    "    metric=\"min-above-corr\",\n",
    "    sort_strategy=\"generic-sorting-ignore-exists-subgroup-empty\",\n",
    "    top_count=top_count,\n",
    "    cor_threshold = 0.7,\n",
    "    filter_sequence = [\n",
    "        \"remove-contained\",\n",
    "        #\"remove-fair-rules\",\n",
    "        \"keep-cheap-rules-above-thr-cor\",\n",
    "        \n",
    "    ],\n",
    "    params=params\n",
    ")\n",
    "\n",
    "print_recourse_report_cumulative(\n",
    "    top_rules,\n",
    "    subgroup_costs=subgroup_costs,\n",
    "    show_subgroup_costs=True,\n",
    "    show_then_costs=True,\n",
    "    metric_name = 'Equal Cost of Effectiveness (Micro) (threshold = 0.7)'\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a2284475-0a55-4eb0-94dd-f954d5bbe8dc",
   "metadata": {},
   "source": [
    "## Equal Effectiveness"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "b276d125-782a-4c6a-8be9-8e5547b3de91",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m43.91%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.30%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.30%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m40.49%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m41.41%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m38.17%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Urban, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m16.00%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.35%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.35%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m14.50%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, parents = 1, politics = Unknown, religion = Christianity\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m10.31%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m94.57%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m9.57%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, parents = 1, politics = Unknown, religion = Other\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m9.66%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m94.50%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m8.67%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Rural, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m3.42%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m3.03%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 0, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m2.50%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m2.32%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n"
     ]
    }
   ],
   "source": [
    "top_rules, subgroup_costs = facts.select_rules_subset_cumulative(\n",
    "    rules_with_cumulative_correctness,\n",
    "    metric=\"total-correctness\",\n",
    "    sort_strategy=\"generic-sorting-ignore-forall-subgroups-empty\",\n",
    "    top_count=top_count,\n",
    "    filter_sequence = [\n",
    "        \"remove-contained\",\n",
    "        \"remove-fair-rules\",\n",
    "    ],\n",
    "    params=params\n",
    ")\n",
    "\n",
    "print_recourse_report_cumulative(\n",
    "    top_rules,\n",
    "    subgroup_costs=subgroup_costs,\n",
    "    show_subgroup_costs=True,\n",
    "    show_then_costs=True,\n",
    "    correctness_metric=True,\n",
    "    metric_name = 'Equal Effectiveness'\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7211301d-5c70-4bb7-80c2-38a79377d591",
   "metadata": {},
   "source": [
    "## Fair Effectiveness-Cost Trade-Off"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "ac354cf3-ca10-4d6a-bcd1-85c3e212778f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m43.91%\u001b[39m covered out of 94138\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.30%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.30%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m40.49%\u001b[39m covered out of 180304\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 162.46.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m44.12%\u001b[39m covered out of 94138\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m93.88%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m93.88%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.80%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.80%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.80%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.80%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m40.70%\u001b[39m covered out of 180304\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 162.46.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m46.07%\u001b[39m covered out of 94138\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.26%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.26%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.26%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m93.14%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m93.14%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.58%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.58%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m42.50%\u001b[39m covered out of 180304\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.12%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.12%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.12%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 158.64.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m46.29%\u001b[39m covered out of 94138\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.24%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.24%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.24%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m92.73%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m92.73%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.38%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.38%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m42.73%\u001b[39m covered out of 180304\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.16%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.16%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.16%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.29%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.29%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.29%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.29%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 158.63.\u001b[39m\n",
      "If \u001b[1marea = Unknown, college_educated = 1, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m44.59%\u001b[39m covered out of 94138\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.96%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.96%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.98%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.98%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.98%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.98%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m40.96%\u001b[39m covered out of 180304\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.42%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.42%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.84%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.84%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.84%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.84%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 157.94.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m41.60%\u001b[39m covered out of 94138\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.56%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.56%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.82%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.82%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.82%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.82%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m38.37%\u001b[39m covered out of 180304\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 157.77.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m41.41%\u001b[39m covered out of 94138\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m38.17%\u001b[39m covered out of 180304\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 157.75.\u001b[39m\n",
      "If \u001b[1marea = Unknown, college_educated = 1, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m44.79%\u001b[39m covered out of 94138\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.56%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.56%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.82%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.82%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.82%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.82%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m41.18%\u001b[39m covered out of 180304\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.04%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.04%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.04%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.46%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.46%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.87%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.87%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.87%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.87%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 157.58.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m46.86%\u001b[39m covered out of 94138\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.90%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.90%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.90%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m89.26%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m89.26%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.61%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.61%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.61%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.61%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m43.16%\u001b[39m covered out of 180304\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.74%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.74%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.74%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.78%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.78%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.78%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.78%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.78%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.78%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 157.43.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m47.08%\u001b[39m covered out of 94138\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.89%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.89%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.89%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m88.86%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m88.86%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.41%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.41%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.41%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.41%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m43.39%\u001b[39m covered out of 180304\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.77%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.77%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.77%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.83%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.83%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.83%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.83%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.83%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.83%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 157.42.\u001b[39m\n",
      "If \u001b[1marea = Unknown, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m47.48%\u001b[39m covered out of 94138\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.28%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.28%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.81%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.81%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.81%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.81%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m43.67%\u001b[39m covered out of 180304\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.04%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.04%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.04%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.47%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.47%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.68%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.77%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.77%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.77%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 157.26.\u001b[39m\n",
      "If \u001b[1marea = Unknown, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m47.27%\u001b[39m covered out of 94138\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.67%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.67%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.99%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.99%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.99%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.99%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m43.44%\u001b[39m covered out of 180304\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.42%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.42%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.65%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.75%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.75%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.75%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 157.23.\u001b[39m\n",
      "If \u001b[1marea = Unknown, college_educated = 1, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m46.77%\u001b[39m covered out of 94138\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.54%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m3.54%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.54%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.54%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m95.59%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m95.59%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m95.61%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m95.61%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m43.01%\u001b[39m covered out of 180304\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.59%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m1.59%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.59%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.59%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.58%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.59%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m6.85%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m6.85%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 154.18.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m43.67%\u001b[39m covered out of 94138\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.26%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m3.26%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.26%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.26%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.11%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.11%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.36%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.36%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m40.27%\u001b[39m covered out of 180304\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.14%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m1.14%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.14%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.14%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.28%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.28%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.29%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.29%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 154.02.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m43.47%\u001b[39m covered out of 94138\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.20%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.20%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.54%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.54%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.54%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.54%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m40.06%\u001b[39m covered out of 180304\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 154.01.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m49.14%\u001b[39m covered out of 94138\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.91%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.91%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.91%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m88.24%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m88.24%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m93.44%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m93.44%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m45.29%\u001b[39m covered out of 180304\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.80%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.80%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.80%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.80%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.80%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.87%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.87%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 153.93.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m49.38%\u001b[39m covered out of 94138\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.89%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.89%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.89%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m87.84%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m87.84%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m93.24%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m93.24%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m45.54%\u001b[39m covered out of 180304\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.83%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.83%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.83%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.83%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.83%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.91%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.91%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 153.91.\u001b[39m\n",
      "If \u001b[1marea = Unknown, college_educated = 1, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m46.98%\u001b[39m covered out of 94138\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.53%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m3.53%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.53%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.53%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m95.19%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m95.19%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m95.44%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m95.44%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m43.24%\u001b[39m covered out of 180304\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.62%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m1.62%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.62%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.62%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.62%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.62%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m6.87%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m6.87%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 153.83.\u001b[39m\n",
      "If \u001b[1marea = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m49.79%\u001b[39m covered out of 94138\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.52%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.52%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.52%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.19%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.19%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m95.46%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m95.46%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m45.86%\u001b[39m covered out of 180304\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.60%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.60%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.62%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.62%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m6.68%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m6.77%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 153.54.\u001b[39m\n",
      "If \u001b[1marea = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m49.56%\u001b[39m covered out of 94138\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.53%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.53%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.53%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.56%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.56%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m95.63%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m95.63%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m45.62%\u001b[39m covered out of 180304\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.57%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.57%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.57%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.58%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.59%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m6.66%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m6.75%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 153.52.\u001b[39m\n"
     ]
    }
   ],
   "source": [
    "# taken from the other notebooks\n",
    "affected_pop_sizes = {\"Male\": 94138, \"Female\": 180304}\n",
    "\n",
    "top_rules,unfairness = facts.select_rules_subset_KStest(\n",
    "    rules_with_cumulative_correctness,\n",
    "    affected_pop_sizes,\n",
    "    top_count=top_count\n",
    ")\n",
    "\n",
    "print_recourse_report_KStest_cumulative(\n",
    "    top_rules,\n",
    "    population_sizes=affected_pop_sizes,\n",
    "    unfairness = unfairness,\n",
    "    show_then_costs=True,\n",
    "    metric_name = 'Fair Effectiveness-Cost Trade-Off'\n",
    "    # show_cumulative_plots=True\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "72278d88-a53c-444f-b516-1065ea532679",
   "metadata": {},
   "source": [
    "## Equal Effectiveness within Budget (Micro)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "0adbc81d-9316-404a-9162-32cd2ecefac6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m43.91%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.30%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.30%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m40.49%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness within Budget (Micro). Unfairness score = 1.0.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m41.41%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m38.17%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness within Budget (Micro). Unfairness score = 1.0.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Urban, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m16.00%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.35%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.35%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m14.50%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness within Budget (Micro). Unfairness score = 1.0.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, parents = 1, politics = Unknown, religion = Christianity\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m10.31%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m94.57%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m9.57%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness within Budget (Micro). Unfairness score = 1.0.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, parents = 1, politics = Unknown, religion = Other\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m9.66%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m94.50%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m8.67%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness within Budget (Micro). Unfairness score = 1.0.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Rural, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m3.42%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m3.03%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness within Budget (Micro). Unfairness score = 1.0.\u001b[39m\n",
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 0, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m2.50%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m2.32%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness within Budget (Micro). Unfairness score = 1.0.\u001b[39m\n"
     ]
    }
   ],
   "source": [
    "top_rules, subgroup_costs = facts.select_rules_subset_cumulative(\n",
    "    rules_with_cumulative_correctness,\n",
    "    metric=\"max-upto-cost\",\n",
    "    sort_strategy=\"generic-sorting-ignore-exists-subgroup-empty\",\n",
    "    top_count=top_count,\n",
    "    cost_threshold = cost_budget,\n",
    "    filter_sequence = [\n",
    "        \"remove-contained\",\n",
    "        \"remove-fair-rules\",\n",
    "        \"remove-above-thr-cost\"\n",
    "    ],\n",
    "    params=params\n",
    ")\n",
    "\n",
    "print_recourse_report_cumulative(\n",
    "    top_rules,\n",
    "    subgroup_costs=subgroup_costs,\n",
    "    show_subgroup_costs=True,\n",
    "    show_then_costs=True,\n",
    "    correctness_metric = True,\n",
    "    metric_name = 'Equal Effectiveness within Budget (Micro)'\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2c94dccd-1c73-437b-b1f2-011e97f44987",
   "metadata": {},
   "source": [
    "## Get ranking of subgroups based on metrics"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "34782aa7-a36c-46b9-9806-353c4b883b35",
   "metadata": {},
   "outputs": [],
   "source": [
    "from facts.fairness_metrics_aggr import make_table, auto_budget_calculation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "e87a6af0-d57f-4976-8d2e-08e048982d64",
   "metadata": {},
   "outputs": [],
   "source": [
    "rules_with_both = {}\n",
    "for ifc, all_thens in rules_with_cumulative_correctness.items():\n",
    "    new_all_thens = {}\n",
    "    for sg, (cov, thens_cum) in all_thens.items():\n",
    "        thens_atom = rules_with_atomic_correctness[ifc][sg][1]\n",
    "        thens_atom_dict = {then: atom_cor for then, atom_cor in thens_atom}\n",
    "        new_all_thens[sg] = (cov, [(then, thens_atom_dict[then], cumcor) for then, cumcor, _cost in thens_cum])\n",
    "    rules_with_both[ifc] = new_all_thens"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "fa972b30-b619-42b0-a1b1-00b13beb2a94",
   "metadata": {},
   "outputs": [],
   "source": [
    "budgets = auto_budget_calculation(rules_with_cumulative_correctness, cor_thres=0.5, percentiles=[0.3, 0.6, 0.9])\n",
    "\n",
    "df = make_table(\n",
    "    rules_with_both,\n",
    "    sensitive_attribute_vals=[\"Male\", \"Female\"],\n",
    "    effectiveness_thresholds=[0.3, 0.7],\n",
    "    cost_budgets=budgets,\n",
    "    params=params\n",
    ")\n",
    "# dropping 'weighted-average' and 'mean-cost-cinf'\n",
    "df.drop(['weighted-average', 'mean-cost-cinf'], axis=1, inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "4b762128",
   "metadata": {},
   "outputs": [],
   "source": [
    "#table of differences between Male and Female for each metric\n",
    "diff = get_diff_table(df, sensitive_attribute_vals=[\"Male\", \"Female\"], with_abs = True)\n",
    "diff = diff.set_index('subgroup')\n",
    "ranked = diff.drop(columns=[('Fair Effectiveness-Cost Trade-Off','bias')]).mask(diff == 0).rank(ascending = False,axis=0,method='dense')\n",
    "ranked = ranked.replace(np.nan,\"Fair\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "8eb88d41",
   "metadata": {},
   "outputs": [],
   "source": [
    "rev_bias_metrics = ['Equal Effectiveness', 'Equal Effectiveness within Budget']\n",
    "comb_df = get_comb_df(df, ranked, diff, rev_bias_metrics, sensitive_attribute_vals=[\"Male\", \"Female\"])\n",
    "diff_real_val, _, = get_diff_real_diff_drop(df, diff, sensitive_attribute_vals=[\"Male\", \"Female\"])\n",
    "analysis_df,rank_analysis_df = get_analysis_dfs(comb_df, diff_real_val, rev_bias_metrics, ranked, sensitive_attribute_vals=[\"Male\", \"Female\"], percentage=0.1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "5004d241",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr:last-of-type th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th colspan=\"3\" halign=\"left\">(Equal Cost of Effectiveness(Macro), 0.3)</th>\n",
       "      <th colspan=\"3\" halign=\"left\">(Equal Cost of Effectiveness(Macro), 0.7)</th>\n",
       "      <th colspan=\"3\" halign=\"left\">(Equal Choice for Recourse, 0.3)</th>\n",
       "      <th>(Equal Choice for Recourse, 0.7)</th>\n",
       "      <th>...</th>\n",
       "      <th>(Equal Cost of Effectiveness(Micro), 0.3)</th>\n",
       "      <th colspan=\"3\" halign=\"left\">(Equal Cost of Effectiveness(Micro), 0.7)</th>\n",
       "      <th colspan=\"3\" halign=\"left\">Equal(Conditional) Mean Recourse</th>\n",
       "      <th colspan=\"3\" halign=\"left\">Fair Effectiveness-Cost Trade-Off</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>rank</th>\n",
       "      <th>score</th>\n",
       "      <th>bias against</th>\n",
       "      <th>rank</th>\n",
       "      <th>score</th>\n",
       "      <th>bias against</th>\n",
       "      <th>rank</th>\n",
       "      <th>score</th>\n",
       "      <th>bias against</th>\n",
       "      <th>rank</th>\n",
       "      <th>...</th>\n",
       "      <th>bias against</th>\n",
       "      <th>rank</th>\n",
       "      <th>score</th>\n",
       "      <th>bias against</th>\n",
       "      <th>rank</th>\n",
       "      <th>score</th>\n",
       "      <th>bias against</th>\n",
       "      <th>rank</th>\n",
       "      <th>score</th>\n",
       "      <th>bias against</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>subgroup</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>homeowner = 1</th>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>...</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>Fair</td>\n",
       "      <td>908.0</td>\n",
       "      <td>0.018080</td>\n",
       "      <td>Female</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>homeowner = 1, politics = Unknown</th>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>...</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>Fair</td>\n",
       "      <td>929.0</td>\n",
       "      <td>0.016813</td>\n",
       "      <td>Female</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>income = Unknown</th>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>...</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>642.0</td>\n",
       "      <td>4.440892e-16</td>\n",
       "      <td>Male</td>\n",
       "      <td>541.0</td>\n",
       "      <td>0.100406</td>\n",
       "      <td>Female</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>income = Unknown, politics = Unknown</th>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>...</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>Fair</td>\n",
       "      <td>540.0</td>\n",
       "      <td>0.100887</td>\n",
       "      <td>Female</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>homeowner = 1, income = Unknown</th>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>...</td>\n",
       "      <td>Fair</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>619.0</td>\n",
       "      <td>3.322132e-03</td>\n",
       "      <td>Female</td>\n",
       "      <td>945.0</td>\n",
       "      <td>0.015355</td>\n",
       "      <td>Female</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 33 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                     (Equal Cost of Effectiveness(Macro), 0.3)  \\\n",
       "                                                                          rank   \n",
       "subgroup                                                                         \n",
       "homeowner = 1                                                             Fair   \n",
       "homeowner = 1, politics = Unknown                                         Fair   \n",
       "income = Unknown                                                          Fair   \n",
       "income = Unknown, politics = Unknown                                      Fair   \n",
       "homeowner = 1, income = Unknown                                           Fair   \n",
       "\n",
       "                                                         \\\n",
       "                                     score bias against   \n",
       "subgroup                                                  \n",
       "homeowner = 1                          0.0         Fair   \n",
       "homeowner = 1, politics = Unknown      0.0         Fair   \n",
       "income = Unknown                       0.0         Fair   \n",
       "income = Unknown, politics = Unknown   0.0         Fair   \n",
       "homeowner = 1, income = Unknown        0.0         Fair   \n",
       "\n",
       "                                     (Equal Cost of Effectiveness(Macro), 0.7)  \\\n",
       "                                                                          rank   \n",
       "subgroup                                                                         \n",
       "homeowner = 1                                                             Fair   \n",
       "homeowner = 1, politics = Unknown                                         Fair   \n",
       "income = Unknown                                                          Fair   \n",
       "income = Unknown, politics = Unknown                                      Fair   \n",
       "homeowner = 1, income = Unknown                                           Fair   \n",
       "\n",
       "                                                         \\\n",
       "                                     score bias against   \n",
       "subgroup                                                  \n",
       "homeowner = 1                          0.0         Fair   \n",
       "homeowner = 1, politics = Unknown      0.0         Fair   \n",
       "income = Unknown                       0.0         Fair   \n",
       "income = Unknown, politics = Unknown   0.0         Fair   \n",
       "homeowner = 1, income = Unknown        0.0         Fair   \n",
       "\n",
       "                                     (Equal Choice for Recourse, 0.3)        \\\n",
       "                                                                 rank score   \n",
       "subgroup                                                                      \n",
       "homeowner = 1                                                    Fair   0.0   \n",
       "homeowner = 1, politics = Unknown                                Fair   0.0   \n",
       "income = Unknown                                                 Fair   0.0   \n",
       "income = Unknown, politics = Unknown                             Fair   0.0   \n",
       "homeowner = 1, income = Unknown                                  Fair   0.0   \n",
       "\n",
       "                                                   \\\n",
       "                                     bias against   \n",
       "subgroup                                            \n",
       "homeowner = 1                                Fair   \n",
       "homeowner = 1, politics = Unknown            Fair   \n",
       "income = Unknown                             Fair   \n",
       "income = Unknown, politics = Unknown         Fair   \n",
       "homeowner = 1, income = Unknown              Fair   \n",
       "\n",
       "                                     (Equal Choice for Recourse, 0.7)  ...  \\\n",
       "                                                                 rank  ...   \n",
       "subgroup                                                               ...   \n",
       "homeowner = 1                                                    Fair  ...   \n",
       "homeowner = 1, politics = Unknown                                Fair  ...   \n",
       "income = Unknown                                                 Fair  ...   \n",
       "income = Unknown, politics = Unknown                             Fair  ...   \n",
       "homeowner = 1, income = Unknown                                  Fair  ...   \n",
       "\n",
       "                                     (Equal Cost of Effectiveness(Micro), 0.3)  \\\n",
       "                                                                  bias against   \n",
       "subgroup                                                                         \n",
       "homeowner = 1                                                             Fair   \n",
       "homeowner = 1, politics = Unknown                                         Fair   \n",
       "income = Unknown                                                          Fair   \n",
       "income = Unknown, politics = Unknown                                      Fair   \n",
       "homeowner = 1, income = Unknown                                           Fair   \n",
       "\n",
       "                                     (Equal Cost of Effectiveness(Micro), 0.7)  \\\n",
       "                                                                          rank   \n",
       "subgroup                                                                         \n",
       "homeowner = 1                                                             Fair   \n",
       "homeowner = 1, politics = Unknown                                         Fair   \n",
       "income = Unknown                                                          Fair   \n",
       "income = Unknown, politics = Unknown                                      Fair   \n",
       "homeowner = 1, income = Unknown                                           Fair   \n",
       "\n",
       "                                                         \\\n",
       "                                     score bias against   \n",
       "subgroup                                                  \n",
       "homeowner = 1                          0.0         Fair   \n",
       "homeowner = 1, politics = Unknown      0.0         Fair   \n",
       "income = Unknown                       0.0         Fair   \n",
       "income = Unknown, politics = Unknown   0.0         Fair   \n",
       "homeowner = 1, income = Unknown        0.0         Fair   \n",
       "\n",
       "                                     Equal(Conditional) Mean Recourse  \\\n",
       "                                                                 rank   \n",
       "subgroup                                                                \n",
       "homeowner = 1                                                    Fair   \n",
       "homeowner = 1, politics = Unknown                                Fair   \n",
       "income = Unknown                                                642.0   \n",
       "income = Unknown, politics = Unknown                             Fair   \n",
       "homeowner = 1, income = Unknown                                 619.0   \n",
       "\n",
       "                                                                 \\\n",
       "                                             score bias against   \n",
       "subgroup                                                          \n",
       "homeowner = 1                         0.000000e+00         Fair   \n",
       "homeowner = 1, politics = Unknown     0.000000e+00         Fair   \n",
       "income = Unknown                      4.440892e-16         Male   \n",
       "income = Unknown, politics = Unknown  0.000000e+00         Fair   \n",
       "homeowner = 1, income = Unknown       3.322132e-03       Female   \n",
       "\n",
       "                                     Fair Effectiveness-Cost Trade-Off  \\\n",
       "                                                                  rank   \n",
       "subgroup                                                                 \n",
       "homeowner = 1                                                    908.0   \n",
       "homeowner = 1, politics = Unknown                                929.0   \n",
       "income = Unknown                                                 541.0   \n",
       "income = Unknown, politics = Unknown                             540.0   \n",
       "homeowner = 1, income = Unknown                                  945.0   \n",
       "\n",
       "                                                             \n",
       "                                         score bias against  \n",
       "subgroup                                                     \n",
       "homeowner = 1                         0.018080       Female  \n",
       "homeowner = 1, politics = Unknown     0.016813       Female  \n",
       "income = Unknown                      0.100406       Female  \n",
       "income = Unknown, politics = Unknown  0.100887       Female  \n",
       "homeowner = 1, income = Unknown       0.015355       Female  \n",
       "\n",
       "[5 rows x 33 columns]"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "comb_df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "55cae6a0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Rank = 1 Count</th>\n",
       "      <th>Male bias against Count</th>\n",
       "      <th>Female bias against Count</th>\n",
       "      <th>Top 10% Male bias against Count</th>\n",
       "      <th>Top 10% Female bias against Count</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>(Equal Cost of Effectiveness(Macro), 0.3)</th>\n",
       "      <td>427</td>\n",
       "      <td>16</td>\n",
       "      <td>429</td>\n",
       "      <td>0</td>\n",
       "      <td>44</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Cost of Effectiveness(Macro), 0.7)</th>\n",
       "      <td>264</td>\n",
       "      <td>0</td>\n",
       "      <td>264</td>\n",
       "      <td>0</td>\n",
       "      <td>26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Choice for Recourse, 0.3)</th>\n",
       "      <td>2</td>\n",
       "      <td>16</td>\n",
       "      <td>645</td>\n",
       "      <td>0</td>\n",
       "      <td>66</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Choice for Recourse, 0.7)</th>\n",
       "      <td>384</td>\n",
       "      <td>0</td>\n",
       "      <td>392</td>\n",
       "      <td>0</td>\n",
       "      <td>39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Equal Effectiveness</th>\n",
       "      <td>15</td>\n",
       "      <td>167</td>\n",
       "      <td>1072</td>\n",
       "      <td>0</td>\n",
       "      <td>123</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Effectiveness within Budget, 1.0)</th>\n",
       "      <td>1</td>\n",
       "      <td>20</td>\n",
       "      <td>402</td>\n",
       "      <td>0</td>\n",
       "      <td>42</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Effectiveness within Budget, 5.0)</th>\n",
       "      <td>10</td>\n",
       "      <td>151</td>\n",
       "      <td>989</td>\n",
       "      <td>0</td>\n",
       "      <td>114</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Cost of Effectiveness(Micro), 0.3)</th>\n",
       "      <td>427</td>\n",
       "      <td>16</td>\n",
       "      <td>429</td>\n",
       "      <td>0</td>\n",
       "      <td>44</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Cost of Effectiveness(Micro), 0.7)</th>\n",
       "      <td>264</td>\n",
       "      <td>0</td>\n",
       "      <td>264</td>\n",
       "      <td>0</td>\n",
       "      <td>26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Equal(Conditional) Mean Recourse</th>\n",
       "      <td>108</td>\n",
       "      <td>278</td>\n",
       "      <td>554</td>\n",
       "      <td>9</td>\n",
       "      <td>74</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Fair Effectiveness-Cost Trade-Off, value)</th>\n",
       "      <td>15</td>\n",
       "      <td>244</td>\n",
       "      <td>1188</td>\n",
       "      <td>0</td>\n",
       "      <td>128</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Total Count</th>\n",
       "      <td>1917</td>\n",
       "      <td>908</td>\n",
       "      <td>6628</td>\n",
       "      <td>9</td>\n",
       "      <td>726</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                            Rank = 1 Count  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)              427   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)              264   \n",
       "(Equal Choice for Recourse, 0.3)                         2   \n",
       "(Equal Choice for Recourse, 0.7)                       384   \n",
       "Equal Effectiveness                                     15   \n",
       "(Equal Effectiveness within Budget, 1.0)                 1   \n",
       "(Equal Effectiveness within Budget, 5.0)                10   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)              427   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)              264   \n",
       "Equal(Conditional) Mean Recourse                       108   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)              15   \n",
       "Total Count                                           1917   \n",
       "\n",
       "                                            Male bias against Count  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                        16   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                         0   \n",
       "(Equal Choice for Recourse, 0.3)                                 16   \n",
       "(Equal Choice for Recourse, 0.7)                                  0   \n",
       "Equal Effectiveness                                             167   \n",
       "(Equal Effectiveness within Budget, 1.0)                         20   \n",
       "(Equal Effectiveness within Budget, 5.0)                        151   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                        16   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                         0   \n",
       "Equal(Conditional) Mean Recourse                                278   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                      244   \n",
       "Total Count                                                     908   \n",
       "\n",
       "                                            Female bias against Count  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                         429   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                         264   \n",
       "(Equal Choice for Recourse, 0.3)                                  645   \n",
       "(Equal Choice for Recourse, 0.7)                                  392   \n",
       "Equal Effectiveness                                              1072   \n",
       "(Equal Effectiveness within Budget, 1.0)                          402   \n",
       "(Equal Effectiveness within Budget, 5.0)                          989   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                         429   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                         264   \n",
       "Equal(Conditional) Mean Recourse                                  554   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                       1188   \n",
       "Total Count                                                      6628   \n",
       "\n",
       "                                            Top 10% Male bias against Count  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                 0   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                 0   \n",
       "(Equal Choice for Recourse, 0.3)                                          0   \n",
       "(Equal Choice for Recourse, 0.7)                                          0   \n",
       "Equal Effectiveness                                                       0   \n",
       "(Equal Effectiveness within Budget, 1.0)                                  0   \n",
       "(Equal Effectiveness within Budget, 5.0)                                  0   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                 0   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                 0   \n",
       "Equal(Conditional) Mean Recourse                                          9   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                0   \n",
       "Total Count                                                               9   \n",
       "\n",
       "                                            Top 10% Female bias against Count  \n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                  44  \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                  26  \n",
       "(Equal Choice for Recourse, 0.3)                                           66  \n",
       "(Equal Choice for Recourse, 0.7)                                           39  \n",
       "Equal Effectiveness                                                       123  \n",
       "(Equal Effectiveness within Budget, 1.0)                                   42  \n",
       "(Equal Effectiveness within Budget, 5.0)                                  114  \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                  44  \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                  26  \n",
       "Equal(Conditional) Mean Recourse                                           74  \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                128  \n",
       "Total Count                                                               726  "
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "analysis_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "1aa7eeab-1af6-4a09-bea5-48c16ce51b7b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>(Equal Cost of Effectiveness(Macro), 0.3)</th>\n",
       "      <th>(Equal Cost of Effectiveness(Macro), 0.7)</th>\n",
       "      <th>(Equal Choice for Recourse, 0.3)</th>\n",
       "      <th>(Equal Choice for Recourse, 0.7)</th>\n",
       "      <th>Equal Effectiveness</th>\n",
       "      <th>(Equal Effectiveness within Budget, 1.0)</th>\n",
       "      <th>(Equal Effectiveness within Budget, 5.0)</th>\n",
       "      <th>(Equal Cost of Effectiveness(Micro), 0.3)</th>\n",
       "      <th>(Equal Cost of Effectiveness(Micro), 0.7)</th>\n",
       "      <th>Equal(Conditional) Mean Recourse</th>\n",
       "      <th>(Fair Effectiveness-Cost Trade-Off, value)</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>(Equal Cost of Effectiveness(Macro), 0.3)</th>\n",
       "      <td>NaN</td>\n",
       "      <td>0.70</td>\n",
       "      <td>0.483</td>\n",
       "      <td>0.600</td>\n",
       "      <td>0.167</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.276</td>\n",
       "      <td>0.250</td>\n",
       "      <td>0.70</td>\n",
       "      <td>0.487</td>\n",
       "      <td>0.154</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Cost of Effectiveness(Macro), 0.7)</th>\n",
       "      <td>0.250</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.350</td>\n",
       "      <td>0.333</td>\n",
       "      <td>0.082</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.210</td>\n",
       "      <td>0.250</td>\n",
       "      <td>0.50</td>\n",
       "      <td>0.506</td>\n",
       "      <td>0.079</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Choice for Recourse, 0.3)</th>\n",
       "      <td>0.250</td>\n",
       "      <td>1.00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.730</td>\n",
       "      <td>1.000</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.250</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0.037</td>\n",
       "      <td>0.338</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Choice for Recourse, 0.7)</th>\n",
       "      <td>0.500</td>\n",
       "      <td>0.65</td>\n",
       "      <td>0.333</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.296</td>\n",
       "      <td>0.851</td>\n",
       "      <td>0.385</td>\n",
       "      <td>0.500</td>\n",
       "      <td>0.65</td>\n",
       "      <td>0.566</td>\n",
       "      <td>0.273</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Equal Effectiveness</th>\n",
       "      <td>0.250</td>\n",
       "      <td>0.50</td>\n",
       "      <td>0.333</td>\n",
       "      <td>0.333</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.205</td>\n",
       "      <td>0.250</td>\n",
       "      <td>0.50</td>\n",
       "      <td>0.002</td>\n",
       "      <td>0.001</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Effectiveness within Budget, 1.0)</th>\n",
       "      <td>1.000</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.000</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.714</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.671</td>\n",
       "      <td>1.000</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0.305</td>\n",
       "      <td>0.395</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Effectiveness within Budget, 5.0)</th>\n",
       "      <td>0.250</td>\n",
       "      <td>0.50</td>\n",
       "      <td>0.333</td>\n",
       "      <td>0.333</td>\n",
       "      <td>0.001</td>\n",
       "      <td>1.000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.250</td>\n",
       "      <td>0.50</td>\n",
       "      <td>0.002</td>\n",
       "      <td>0.001</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Cost of Effectiveness(Micro), 0.3)</th>\n",
       "      <td>0.250</td>\n",
       "      <td>0.70</td>\n",
       "      <td>0.483</td>\n",
       "      <td>0.600</td>\n",
       "      <td>0.167</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.276</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.70</td>\n",
       "      <td>0.487</td>\n",
       "      <td>0.154</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Cost of Effectiveness(Micro), 0.7)</th>\n",
       "      <td>0.250</td>\n",
       "      <td>0.50</td>\n",
       "      <td>0.350</td>\n",
       "      <td>0.333</td>\n",
       "      <td>0.082</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.210</td>\n",
       "      <td>0.250</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.506</td>\n",
       "      <td>0.079</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Equal(Conditional) Mean Recourse</th>\n",
       "      <td>0.525</td>\n",
       "      <td>0.75</td>\n",
       "      <td>0.650</td>\n",
       "      <td>0.700</td>\n",
       "      <td>0.250</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.408</td>\n",
       "      <td>0.525</td>\n",
       "      <td>0.75</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.267</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Fair Effectiveness-Cost Trade-Off, value)</th>\n",
       "      <td>0.250</td>\n",
       "      <td>0.50</td>\n",
       "      <td>0.333</td>\n",
       "      <td>0.333</td>\n",
       "      <td>0.001</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.205</td>\n",
       "      <td>0.250</td>\n",
       "      <td>0.50</td>\n",
       "      <td>0.002</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                            (Equal Cost of Effectiveness(Macro), 0.3)  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                         NaN   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                       0.250   \n",
       "(Equal Choice for Recourse, 0.3)                                                0.250   \n",
       "(Equal Choice for Recourse, 0.7)                                                0.500   \n",
       "Equal Effectiveness                                                             0.250   \n",
       "(Equal Effectiveness within Budget, 1.0)                                        1.000   \n",
       "(Equal Effectiveness within Budget, 5.0)                                        0.250   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                       0.250   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                       0.250   \n",
       "Equal(Conditional) Mean Recourse                                                0.525   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                      0.250   \n",
       "\n",
       "                                            (Equal Cost of Effectiveness(Macro), 0.7)  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                        0.70   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                         NaN   \n",
       "(Equal Choice for Recourse, 0.3)                                                 1.00   \n",
       "(Equal Choice for Recourse, 0.7)                                                 0.65   \n",
       "Equal Effectiveness                                                              0.50   \n",
       "(Equal Effectiveness within Budget, 1.0)                                         1.00   \n",
       "(Equal Effectiveness within Budget, 5.0)                                         0.50   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                        0.70   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                        0.50   \n",
       "Equal(Conditional) Mean Recourse                                                 0.75   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                       0.50   \n",
       "\n",
       "                                            (Equal Choice for Recourse, 0.3)  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                              0.483   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                              0.350   \n",
       "(Equal Choice for Recourse, 0.3)                                         NaN   \n",
       "(Equal Choice for Recourse, 0.7)                                       0.333   \n",
       "Equal Effectiveness                                                    0.333   \n",
       "(Equal Effectiveness within Budget, 1.0)                               1.000   \n",
       "(Equal Effectiveness within Budget, 5.0)                               0.333   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                              0.483   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                              0.350   \n",
       "Equal(Conditional) Mean Recourse                                       0.650   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                             0.333   \n",
       "\n",
       "                                            (Equal Choice for Recourse, 0.7)  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                              0.600   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                              0.333   \n",
       "(Equal Choice for Recourse, 0.3)                                       1.000   \n",
       "(Equal Choice for Recourse, 0.7)                                         NaN   \n",
       "Equal Effectiveness                                                    0.333   \n",
       "(Equal Effectiveness within Budget, 1.0)                               1.000   \n",
       "(Equal Effectiveness within Budget, 5.0)                               0.333   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                              0.600   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                              0.333   \n",
       "Equal(Conditional) Mean Recourse                                       0.700   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                             0.333   \n",
       "\n",
       "                                            Equal Effectiveness  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                 0.167   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                 0.082   \n",
       "(Equal Choice for Recourse, 0.3)                          0.730   \n",
       "(Equal Choice for Recourse, 0.7)                          0.296   \n",
       "Equal Effectiveness                                         NaN   \n",
       "(Equal Effectiveness within Budget, 1.0)                  0.714   \n",
       "(Equal Effectiveness within Budget, 5.0)                  0.001   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                 0.167   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                 0.082   \n",
       "Equal(Conditional) Mean Recourse                          0.250   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                0.001   \n",
       "\n",
       "                                            (Equal Effectiveness within Budget, 1.0)  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                      1.000   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                      1.000   \n",
       "(Equal Choice for Recourse, 0.3)                                               1.000   \n",
       "(Equal Choice for Recourse, 0.7)                                               0.851   \n",
       "Equal Effectiveness                                                            1.000   \n",
       "(Equal Effectiveness within Budget, 1.0)                                         NaN   \n",
       "(Equal Effectiveness within Budget, 5.0)                                       1.000   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                      1.000   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                      1.000   \n",
       "Equal(Conditional) Mean Recourse                                               1.000   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                     1.000   \n",
       "\n",
       "                                            (Equal Effectiveness within Budget, 5.0)  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                      0.276   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                      0.210   \n",
       "(Equal Choice for Recourse, 0.3)                                               1.000   \n",
       "(Equal Choice for Recourse, 0.7)                                               0.385   \n",
       "Equal Effectiveness                                                            0.205   \n",
       "(Equal Effectiveness within Budget, 1.0)                                       0.671   \n",
       "(Equal Effectiveness within Budget, 5.0)                                         NaN   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                      0.276   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                      0.210   \n",
       "Equal(Conditional) Mean Recourse                                               0.408   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                     0.205   \n",
       "\n",
       "                                            (Equal Cost of Effectiveness(Micro), 0.3)  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                       0.250   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                       0.250   \n",
       "(Equal Choice for Recourse, 0.3)                                                0.250   \n",
       "(Equal Choice for Recourse, 0.7)                                                0.500   \n",
       "Equal Effectiveness                                                             0.250   \n",
       "(Equal Effectiveness within Budget, 1.0)                                        1.000   \n",
       "(Equal Effectiveness within Budget, 5.0)                                        0.250   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                         NaN   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                       0.250   \n",
       "Equal(Conditional) Mean Recourse                                                0.525   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                      0.250   \n",
       "\n",
       "                                            (Equal Cost of Effectiveness(Micro), 0.7)  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                        0.70   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                        0.50   \n",
       "(Equal Choice for Recourse, 0.3)                                                 1.00   \n",
       "(Equal Choice for Recourse, 0.7)                                                 0.65   \n",
       "Equal Effectiveness                                                              0.50   \n",
       "(Equal Effectiveness within Budget, 1.0)                                         1.00   \n",
       "(Equal Effectiveness within Budget, 5.0)                                         0.50   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                        0.70   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                         NaN   \n",
       "Equal(Conditional) Mean Recourse                                                 0.75   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                       0.50   \n",
       "\n",
       "                                            Equal(Conditional) Mean Recourse  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                              0.487   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                              0.506   \n",
       "(Equal Choice for Recourse, 0.3)                                       0.037   \n",
       "(Equal Choice for Recourse, 0.7)                                       0.566   \n",
       "Equal Effectiveness                                                    0.002   \n",
       "(Equal Effectiveness within Budget, 1.0)                               0.305   \n",
       "(Equal Effectiveness within Budget, 5.0)                               0.002   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                              0.487   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                              0.506   \n",
       "Equal(Conditional) Mean Recourse                                         NaN   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                             0.002   \n",
       "\n",
       "                                            (Fair Effectiveness-Cost Trade-Off, value)  \n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                        0.154  \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                        0.079  \n",
       "(Equal Choice for Recourse, 0.3)                                                 0.338  \n",
       "(Equal Choice for Recourse, 0.7)                                                 0.273  \n",
       "Equal Effectiveness                                                              0.001  \n",
       "(Equal Effectiveness within Budget, 1.0)                                         0.395  \n",
       "(Equal Effectiveness within Budget, 5.0)                                         0.001  \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                        0.154  \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                        0.079  \n",
       "Equal(Conditional) Mean Recourse                                                 0.267  \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                         NaN  "
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "max_ranks = get_map_metric_to_max_rank(ranked)\n",
    "rank_divided = get_other_ranks_divided(rank_analysis_df, max_ranks)\n",
    "rank_divided"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
