{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "502d47bb-15f4-4e02-b414-8f01294c6697",
   "metadata": {},
   "source": [
    "Datasets used: \n",
    "- `adult (Adult)` :<br>The UCI Adult dataset contains 14 features, which can be divided into two categories: demographic and income-related.<br> The demographic features include:\n",
    "\n",
    "    age: continuous.<br>\n",
    "    fnlwgt : continuous, represents final weight, which is the number of units in the target population that the responding unit represents.<br>\n",
    "    workclass: categorical, with values 'Private', 'Local-gov', 'Self-emp-not-inc', 'Federal-gov', 'State-gov', 'Self-emp-inc', 'Without-pay'.<br>\n",
    "    education: categorical, with values '11th', 'HS-grad', 'Assoc-acdm', 'Some-college', '10th', ..., '9th', 'Doctorate', '12th', '1st-4th', 'Preschool'.<br>\n",
    "    education-num: continuous with values 1 to 16, one number assigned to each label of education feature.<br>\n",
    "    marital-status: categorical, with values 'Never-married', 'Married-civ-spouse', 'Widowed', 'Separated', 'Divorced', 'Married-spouse-absent', 'Married-AF-spouse'.<br>\n",
    "    occupation: categorical, with values such as 'Machine-op-inspct', 'Farming-fishing', 'Protective-serv'.<br>\n",
    "    relationship: categorical, with values 'Own-child', 'Husband', 'Not-in-family', 'Unmarried', 'Wife', 'Other-relative'.<br>\n",
    "    race: categorical, with values such as white, black, and Asian.<br>\n",
    "    sex: categorical, with values male and female.<br>\n",
    "    \n",
    "    The income-related features include:<br>\n",
    "\n",
    "    hours-per-week: continuous.<br>\n",
    "    native-country: categorical, with values such as United-States, Mexico, and Germany.<br>\n",
    "    capital-gain: continuous, represent the amount of money an individual has gained from the sale of investments such as stocks, bonds, or real estate.<br>\n",
    "    capital-loss: continuous, represent the amount of money an individual has lost from the sale of investments such as stocks, bonds, or real estate..<br>\n",
    "    The target feature is the income, which is binary:<br>\n",
    "    income: categorical, with values less than or equal to 50K and greater than 50K.<br>\n",
    "\n",
    "Reference Links: https://archive.ics.uci.edu/ml/datasets/adult"
   ]
  },
  {
   "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",
    "    \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_diff_real_diff_drop,get_other_ranks_divided,get_map_metric_to_max_rank"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "62e4604f",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pathlib import Path\n",
    "\n",
    "random_seed = 131313 # for reproducibility\n",
    "precomputed_rules_file = Path(\"..\") / \"..\" / \"Pre-computed Results\" / \"Adult\" / \"rulesAdult_race_atomic.data\"\n",
    "precomputed_rules_with_cumulative_file = Path(\"..\") / \"..\" / \"Pre-computed Results\" / \"Adult\" / \"rulesAdult_race_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>age</th>\n",
       "      <th>Workclass</th>\n",
       "      <th>education-num</th>\n",
       "      <th>marital-status</th>\n",
       "      <th>occupation</th>\n",
       "      <th>relationship</th>\n",
       "      <th>race</th>\n",
       "      <th>sex</th>\n",
       "      <th>capital-gain</th>\n",
       "      <th>capital-loss</th>\n",
       "      <th>hours-per-week</th>\n",
       "      <th>native-country</th>\n",
       "      <th>income</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>(34.0, 41.0]</td>\n",
       "      <td>State-gov</td>\n",
       "      <td>13</td>\n",
       "      <td>Never-married</td>\n",
       "      <td>Adm-clerical</td>\n",
       "      <td>Not-in-family</td>\n",
       "      <td>White</td>\n",
       "      <td>Male</td>\n",
       "      <td>2174</td>\n",
       "      <td>0</td>\n",
       "      <td>FullTime</td>\n",
       "      <td>United-States</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>(41.0, 50.0]</td>\n",
       "      <td>Self-emp-not-inc</td>\n",
       "      <td>13</td>\n",
       "      <td>Married-civ-spouse</td>\n",
       "      <td>Exec-managerial</td>\n",
       "      <td>Married</td>\n",
       "      <td>White</td>\n",
       "      <td>Male</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>PartTime</td>\n",
       "      <td>United-States</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>(34.0, 41.0]</td>\n",
       "      <td>Private</td>\n",
       "      <td>9</td>\n",
       "      <td>Divorced</td>\n",
       "      <td>Handlers-cleaners</td>\n",
       "      <td>Not-in-family</td>\n",
       "      <td>White</td>\n",
       "      <td>Male</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>FullTime</td>\n",
       "      <td>United-States</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>(50.0, 90.0]</td>\n",
       "      <td>Private</td>\n",
       "      <td>7</td>\n",
       "      <td>Married-civ-spouse</td>\n",
       "      <td>Handlers-cleaners</td>\n",
       "      <td>Married</td>\n",
       "      <td>Black</td>\n",
       "      <td>Male</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>FullTime</td>\n",
       "      <td>United-States</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>(26.0, 34.0]</td>\n",
       "      <td>Private</td>\n",
       "      <td>13</td>\n",
       "      <td>Married-civ-spouse</td>\n",
       "      <td>Prof-specialty</td>\n",
       "      <td>Married</td>\n",
       "      <td>Black</td>\n",
       "      <td>Female</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>FullTime</td>\n",
       "      <td>Cuba</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            age          Workclass  education-num       marital-status  \\\n",
       "0  (34.0, 41.0]          State-gov             13        Never-married   \n",
       "1  (41.0, 50.0]   Self-emp-not-inc             13   Married-civ-spouse   \n",
       "2  (34.0, 41.0]            Private              9             Divorced   \n",
       "3  (50.0, 90.0]            Private              7   Married-civ-spouse   \n",
       "4  (26.0, 34.0]            Private             13   Married-civ-spouse   \n",
       "\n",
       "           occupation    relationship    race      sex  capital-gain  \\\n",
       "0        Adm-clerical   Not-in-family   White     Male          2174   \n",
       "1     Exec-managerial         Married   White     Male             0   \n",
       "2   Handlers-cleaners   Not-in-family   White     Male             0   \n",
       "3   Handlers-cleaners         Married   Black     Male             0   \n",
       "4      Prof-specialty         Married   Black   Female             0   \n",
       "\n",
       "   capital-loss hours-per-week  native-country  income  \n",
       "0             0       FullTime   United-States       0  \n",
       "1             0       PartTime   United-States       0  \n",
       "2             0       FullTime   United-States       0  \n",
       "3             0       FullTime   United-States       0  \n",
       "4             0       FullTime            Cuba       0  "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "urlfile= \"https://raw.githubusercontent.com/columbia/fairtest/master/data/adult/adult.csv\"\n",
    "\n",
    "X = pd.read_csv(urlfile)\n",
    "df = clean_dataset(X, \"adult\")\n",
    "\n",
    "age = [val.left for val in df.age.unique()]\n",
    "age.sort()\n",
    "\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "31e8d05f-0136-4535-91bd-b8df86813187",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "y = df['income']\n",
    "X = df.drop('income', 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 = ['hours-per-week']"
   ]
  },
  {
   "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(precomputed_rules_file)\n",
    "rules_with_cumulative_correctness = load_rules_by_if(precomputed_rules_with_cumulative_file)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "7ce8c71c-e23d-4bd7-9d05-519491724927",
   "metadata": {},
   "outputs": [],
   "source": [
    "feature_weights = {\"race\" : 100 , \"sex\": 100, \"marital-status\": 5, \"relationship\":5, \"age\": 10, \"occupation\": 4, \"Workclass\": 2, \"native-country\": 4,\n",
    "                    \"hours-per-week\":2, \"capital-gain\": 1, \"capital-loss\":1, \"education-num\": 3}\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=True,\n",
    "    feats_to_normalize = [\"capital-gain\",\"capital-loss\"]\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[1mage = (26.0, 34.0], marital-status =  Never-married, occupation =  Prof-specialty, relationship =  Not-in-family\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.15%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m80.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m80.00%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m20.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.18%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m75.47%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m10.00\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Cost of Effectiveness (Macro) (threshold = 0.7). Unfairness score = 10.\u001b[39m\n",
      "If \u001b[1mage = (26.0, 34.0], education-num = 13, marital-status =  Never-married, relationship =  Not-in-family\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.78%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m87.10%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m80.65%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m20.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.66%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 14\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m84.67%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m13.00\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Cost of Effectiveness (Macro) (threshold = 0.7). Unfairness score = 7.\u001b[39m\n",
      "If \u001b[1mWorkclass =  Private, marital-status =  Never-married, occupation =  Prof-specialty, relationship =  Not-in-family\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.43%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Federal-gov\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m72.00%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m12.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m2.17%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Federal-gov\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m72.45%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m16.00\u001b[39m\n",
      "\t\u001b[35mBias against  White due to Equal Cost of Effectiveness (Macro) (threshold = 0.7). Unfairness score = 4.\u001b[39m\n",
      "If \u001b[1meducation-num = 9, marital-status =  Married-civ-spouse, occupation =  Transport-moving, sex =  Male\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.78%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m70.97%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m10.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m2.00%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m70.56%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m7.00\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Cost of Effectiveness (Macro) (threshold = 0.7). Unfairness score = 3.\u001b[39m\n",
      "If \u001b[1meducation-num = 9, occupation =  Transport-moving, relationship =  Married, sex =  Male\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.78%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m70.97%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m10.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.97%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m71.35%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m7.00\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Cost of Effectiveness (Macro) (threshold = 0.7). Unfairness score = 3.\u001b[39m\n",
      "If \u001b[1meducation-num = 13, hours-per-week = FullTime, marital-status =  Never-married, relationship =  Not-in-family\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.66%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 14\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m72.41%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m15.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m2.32%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 15\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m80.38%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m18.00\u001b[39m\n",
      "\t\u001b[35mBias against  White due to Equal Cost of Effectiveness (Macro) (threshold = 0.7). Unfairness score = 3.\u001b[39m\n",
      "If \u001b[1meducation-num = 9, marital-status =  Married-civ-spouse, native-country =  United-States, occupation =  Transport-moving, relationship =  Married\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.55%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m70.37%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m10.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.93%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m71.84%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m7.00\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Cost of Effectiveness (Macro) (threshold = 0.7). Unfairness score = 3.\u001b[39m\n",
      "If \u001b[1mcapital-loss = 0, education-num = 9, native-country =  United-States, occupation =  Transport-moving, relationship =  Married\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.55%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m70.37%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m10.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.89%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m71.18%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m7.00\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Cost of Effectiveness (Macro) (threshold = 0.7). Unfairness score = 3.0.\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"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "37d3d6be-08f8-41ca-83fb-37a7e5f61420",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mage = (26.0, 34.0], marital-status =  Never-married, occupation =  Prof-specialty, relationship =  Not-in-family\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.15%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m90.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m80.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m80.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m80.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m80.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Tech-support\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m80.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Tech-support\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m70.00%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-7.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.18%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m93.40%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m89.62%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m88.68%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m85.85%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m75.47%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m85.85%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m83.02%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m83.02%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m82.08%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m83.02%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m75.47%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m80.19%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Tech-support\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m88.68%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Tech-support\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m84.91%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-14.00\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Choice for Recourse(Macro) (threshold = 0.7). Unfairness score = 7.\u001b[39m\n",
      "If \u001b[1mcapital-gain = 0, capital-loss = 0, marital-status =  Divorced, relationship =  Not-in-family\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m5.39%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m81.91%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m81.91%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-4.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m8.81%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m94.21%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m93.83%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1902\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m71.03%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1977\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m71.91%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1887\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m71.03%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 5178\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m83.63%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 4386\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m77.46%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-9.00\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Choice for Recourse(Macro) (threshold = 0.7). Unfairness score = 5.\u001b[39m\n",
      "If \u001b[1mcapital-gain = 0, capital-loss = 0, hours-per-week = FullTime, marital-status =  Widowed\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m2.24%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m97.44%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-3.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.19%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m82.24%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m73.83%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m71.03%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m80.37%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-7.00\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Choice for Recourse(Macro) (threshold = 0.7). Unfairness score = 4.\u001b[39m\n",
      "If \u001b[1mcapital-gain = 0, hours-per-week = FullTime, marital-status =  Widowed, native-country =  United-States\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m2.07%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m97.22%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-3.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.08%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m83.51%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m76.29%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m74.23%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m81.44%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-7.00\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Choice for Recourse(Macro) (threshold = 0.7). Unfairness score = 4.\u001b[39m\n",
      "If \u001b[1mWorkclass =  Private, age = (26.0, 34.0], hours-per-week = FullTime, marital-status =  Never-married, native-country =  United-States, relationship =  Not-in-family\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.89%\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",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m2.22%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m70.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-inc\u001b[39m, \u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m76.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Federal-gov\u001b[39m, \u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m74.50%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-inc\u001b[39m, \u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m79.50%\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  Non-White due to Equal Choice for Recourse(Macro) (threshold = 0.7). Unfairness score = 4.\u001b[39m\n",
      "If \u001b[1meducation-num = 13, marital-status =  Never-married, occupation =  Prof-specialty, relationship =  Not-in-family\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.26%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m72.73%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 14\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m72.73%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 15\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m86.36%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 14\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m81.82%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-4.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.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  White due to Equal Choice for Recourse(Macro) (threshold = 0.7). Unfairness score = 4.\u001b[39m\n",
      "If \u001b[1mcapital-gain = 0, hours-per-week = PartTime, marital-status =  Never-married, native-country =  United-States, relationship =  Not-in-family\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.09%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = FullTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-3.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.44%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m86.15%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = FullTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m, \u001b[31mhours-per-week = FullTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m79.23%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m, \u001b[31mhours-per-week = FullTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m76.15%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m83.85%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-7.00\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Choice for Recourse(Macro) (threshold = 0.7). Unfairness score = 4.\u001b[39m\n",
      "If \u001b[1mcapital-gain = 0, capital-loss = 0, hours-per-week = PartTime, marital-status =  Never-married, native-country =  United-States, relationship =  Not-in-family\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.09%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = FullTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-3.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.36%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m85.37%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = FullTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m, \u001b[31mhours-per-week = FullTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m78.05%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m, \u001b[31mhours-per-week = FullTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m74.80%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m82.93%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-7.00\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Choice for Recourse(Macro) (threshold = 0.7). Unfairness score = 4.\u001b[39m\n",
      "If \u001b[1mcapital-gain = 0, hours-per-week = FullTime, native-country =  United-States, relationship =  Unmarried\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m11.65%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m99.51%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m98.52%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m99.51%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-3.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m4.74%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m99.77%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m79.63%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m99.77%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m70.49%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m76.35%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\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  Non-White due to Equal Choice for Recourse(Macro) (threshold = 0.7). Unfairness score = 3.\u001b[39m\n",
      "If \u001b[1mcapital-loss = 0, marital-status =  Divorced, relationship =  Not-in-family\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m5.57%\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",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m9.21%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1902\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m72.05%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1977\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m73.01%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1887\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m72.05%\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  Non-White due to Equal Choice for Recourse(Macro) (threshold = 0.7). Unfairness score = 3.\u001b[39m\n",
      "If \u001b[1mage = (34.0, 41.0], capital-gain = 0, capital-loss = 0, marital-status =  Never-married\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m5.39%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-3.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m3.67%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m99.70%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m99.40%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m99.40%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mcapital-gain = 7688\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m85.80%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m77.34%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31mcapital-gain = 7688\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m82.48%\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  Non-White due to Equal Choice for Recourse(Macro) (threshold = 0.7). Unfairness score = 3.\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": [
    "# New Metrics"
   ]
  },
  {
   "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[1mWorkclass =  Private, capital-loss = 0, education-num = 10, hours-per-week = FullTime, marital-status =  Never-married, sex =  Male\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m2.35%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m2.44%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m2.44%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m2.44%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m2.44%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m2.44%\u001b[39m and counterfactual cost = 22.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 12\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m2.44%\u001b[39m and counterfactual cost = 42.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.84%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 22.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 12\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m2.41%\u001b[39m and counterfactual cost = 42.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m42.00\u001b[39m\n",
      "\t\u001b[35mBias against  White due to Equal Conditional Mean Recourse. Unfairness score = 41.0.\u001b[39m\n",
      "If \u001b[1mWorkclass =  Private, capital-loss = 0, education-num = 10, hours-per-week = FullTime, native-country =  United-States, relationship =  Not-in-family, sex =  Male\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.20%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m4.76%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m4.76%\u001b[39m and counterfactual cost = 12.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 12\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m4.76%\u001b[39m and counterfactual cost = 51.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m11.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.10%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 12.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 12\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m1.01%\u001b[39m and counterfactual cost = 51.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m51.00\u001b[39m\n",
      "\t\u001b[35mBias against  White due to Equal Conditional Mean Recourse. Unfairness score = 40.0.\u001b[39m\n",
      "If \u001b[1meducation-num = 9, hours-per-week = FullTime, relationship =  Unmarried\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m5.28%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m1.09%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m1.09%\u001b[39m and counterfactual cost = 12.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m1.09%\u001b[39m and counterfactual cost = 30.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m1.09%\u001b[39m and counterfactual cost = 31.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m1.09%\u001b[39m and counterfactual cost = 32.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m1.09%\u001b[39m and counterfactual cost = 50.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m1.09%\u001b[39m and counterfactual cost = 51.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m11.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m2.11%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 12.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 30.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 31.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 32.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 50.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m2.63%\u001b[39m and counterfactual cost = 51.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m51.00\u001b[39m\n",
      "\t\u001b[35mBias against  White due to Equal Conditional Mean Recourse. Unfairness score = 40.0.\u001b[39m\n",
      "If \u001b[1mcapital-loss = 0, education-num = 10, relationship =  Unmarried\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m5.22%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 30.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 12\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m2.20%\u001b[39m and counterfactual cost = 50.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m50.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m2.50%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m2.67%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m2.67%\u001b[39m and counterfactual cost = 30.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 12\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m2.67%\u001b[39m and counterfactual cost = 50.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m10.00\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Conditional Mean Recourse. Unfairness score = 40.0.\u001b[39m\n",
      "If \u001b[1mWorkclass =  Private, capital-loss = 0, education-num = 10, relationship =  Unmarried\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m3.67%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-inc\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Federal-gov\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 30.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 12\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m3.12%\u001b[39m and counterfactual cost = 50.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m50.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.93%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m3.45%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-inc\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m3.45%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Federal-gov\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m3.45%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m3.45%\u001b[39m and counterfactual cost = 30.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 12\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m3.45%\u001b[39m and counterfactual cost = 50.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m10.00\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Conditional Mean Recourse. Unfairness score = 40.0.\u001b[39m\n",
      "If \u001b[1mage = (34.0, 41.0], capital-gain = 0, education-num = 9, marital-status =  Never-married\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m2.35%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m2.44%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m2.44%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m2.44%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31meducation-num = 10\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m2.44%\u001b[39m and counterfactual cost = 22.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31meducation-num = 10\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m2.44%\u001b[39m and counterfactual cost = 22.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31meducation-num = 11\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m2.44%\u001b[39m and counterfactual cost = 42.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m2.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.33%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31meducation-num = 10\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 22.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31meducation-num = 10\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 22.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31meducation-num = 11\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m\u001b[0m with effectiveness \u001b[32m1.67%\u001b[39m and counterfactual cost = 42.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m42.00\u001b[39m\n",
      "\t\u001b[35mBias against  White due to Equal Conditional Mean Recourse. Unfairness score = 40.0.\u001b[39m\n",
      "If \u001b[1mcapital-loss = 0, education-num = 9, marital-status =  Never-married, occupation =  Machine-op-inspct\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m2.01%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 22.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 22.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 22.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 22.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m2.86%\u001b[39m and counterfactual cost = 42.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m42.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.01%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m1.10%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m1.10%\u001b[39m and counterfactual cost = 22.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m1.10%\u001b[39m and counterfactual cost = 22.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m1.10%\u001b[39m and counterfactual cost = 22.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m1.10%\u001b[39m and counterfactual cost = 22.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m1.10%\u001b[39m and counterfactual cost = 42.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m2.00\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Conditional Mean Recourse. Unfairness score = 40.0.\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[1meducation-num = 9, marital-status =  Married-civ-spouse, occupation =  Transport-moving, sex =  Male\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.78%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m6.45%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m29.03%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m29.03%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m29.03%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m29.03%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m41.94%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m70.97%\u001b[39m and counterfactual cost = 41.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m41.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m2.00%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m0.56%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m10.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m49.44%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m49.44%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m49.44%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m50.56%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m70.56%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m21.00\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Cost of Effectiveness (Micro) (threshold = 0.7). Unfairness score = 20.0.\u001b[39m\n",
      "If \u001b[1meducation-num = 9, occupation =  Transport-moving, relationship =  Married, sex =  Male\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.78%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m6.45%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m29.03%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m29.03%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m29.03%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m29.03%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m41.94%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m70.97%\u001b[39m and counterfactual cost = 41.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m41.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.97%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m0.56%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m10.11%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m50.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m50.00%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m50.00%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m51.12%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m71.35%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m21.00\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Cost of Effectiveness (Micro) (threshold = 0.7). Unfairness score = 20.0.\u001b[39m\n",
      "If \u001b[1meducation-num = 13, hours-per-week = FullTime, marital-status =  Never-married, relationship =  Not-in-family\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.66%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m37.93%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = MidTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m37.93%\u001b[39m and counterfactual cost = 12.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m48.28%\u001b[39m and counterfactual cost = 12.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m51.72%\u001b[39m and counterfactual cost = 13.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 14\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m51.72%\u001b[39m and counterfactual cost = 31.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 14\u001b[39m, \u001b[31mhours-per-week = MidTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m51.72%\u001b[39m and counterfactual cost = 32.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 14\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m72.41%\u001b[39m and counterfactual cost = 32.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m32.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m2.32%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m47.37%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = MidTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m47.37%\u001b[39m and counterfactual cost = 12.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m59.33%\u001b[39m and counterfactual cost = 12.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m60.29%\u001b[39m and counterfactual cost = 13.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 14\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m60.29%\u001b[39m and counterfactual cost = 31.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 14\u001b[39m, \u001b[31mhours-per-week = MidTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m60.29%\u001b[39m and counterfactual cost = 32.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 14\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m63.64%\u001b[39m and counterfactual cost = 32.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 14\u001b[39m, \u001b[31mhours-per-week = BrainDrain\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m67.46%\u001b[39m and counterfactual cost = 33.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 15\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m67.46%\u001b[39m and counterfactual cost = 51.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 15\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m80.38%\u001b[39m and counterfactual cost = 52.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m52.00\u001b[39m\n",
      "\t\u001b[35mBias against  White due to Equal Cost of Effectiveness (Micro) (threshold = 0.7). Unfairness score = 20.0.\u001b[39m\n",
      "If \u001b[1meducation-num = 9, marital-status =  Married-civ-spouse, native-country =  United-States, occupation =  Transport-moving\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.55%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m3.70%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m44.44%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m70.37%\u001b[39m and counterfactual cost = 41.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m41.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.94%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m0.57%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m10.29%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m50.29%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m50.29%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m50.29%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m50.29%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m51.43%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m71.43%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m21.00\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Cost of Effectiveness (Micro) (threshold = 0.7). Unfairness score = 20.0.\u001b[39m\n",
      "If \u001b[1meducation-num = 9, native-country =  United-States, occupation =  Transport-moving, relationship =  Married\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.55%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m3.70%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m44.44%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 11\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m70.37%\u001b[39m and counterfactual cost = 41.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m41.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.93%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m0.57%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m10.34%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m50.57%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m50.57%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m50.57%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m50.57%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m51.72%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 10\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m71.84%\u001b[39m and counterfactual cost = 21.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m21.00\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Cost of Effectiveness (Micro) (threshold = 0.7). Unfairness score = 20.0.\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[1mage = (34.0, 41.0], capital-loss = 0, native-country =  United-States, occupation =  Machine-op-inspct\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.38%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Tech-support\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Tech-support\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.20%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m3.70%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m6.48%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m11.11%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Tech-support\u001b[39m\u001b[0m with effectiveness \u001b[32m13.89%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m17.59%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Tech-support\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m50.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.50\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Effectiveness. Unfairness score = 0.5.\u001b[39m\n",
      "If \u001b[1meducation-num = 14, relationship =  Not-in-family\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.20%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m4.76%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 15\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m9.52%\u001b[39m and counterfactual cost = 30.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 16\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m9.52%\u001b[39m and counterfactual cost = 50.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.10\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m2.02%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m21.98%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 15\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m36.81%\u001b[39m and counterfactual cost = 30.0.\n",
      "\t\tMake \u001b[1m\u001b[31meducation-num = 16\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m52.75%\u001b[39m and counterfactual cost = 50.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.53\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Effectiveness. Unfairness score = 0.432.\u001b[39m\n",
      "If \u001b[1mage = (34.0, 41.0], capital-gain = 0, capital-loss = 0, marital-status =  Married-civ-spouse, occupation =  Craft-repair\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.09%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m5.26%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m10.53%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m10.53%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m10.53%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m10.53%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m10.53%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m10.53%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m26.32%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m26.32%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.26\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.91%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m\u001b[0m with effectiveness \u001b[32m3.49%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m13.95%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m19.77%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m47.09%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m69.19%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.69\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Effectiveness. Unfairness score = 0.429.\u001b[39m\n",
      "If \u001b[1mage = (34.0, 41.0], capital-loss = 0, marital-status =  Never-married, relationship =  Not-in-family, sex =  Male\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.09%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m21.05%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m26.32%\u001b[39m and counterfactual cost = 12.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m26.32%\u001b[39m and counterfactual cost = 12.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mcapital-loss = 1902\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m42.11%\u001b[39m and counterfactual cost = 12.44.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.42\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.71%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m38.96%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m40.91%\u001b[39m and counterfactual cost = 12.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m42.21%\u001b[39m and counterfactual cost = 12.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mcapital-loss = 1902\u001b[39m, \u001b[31mmarital-status =  Married-civ-spouse\u001b[39m, \u001b[31mrelationship =  Married\u001b[39m\u001b[0m with effectiveness \u001b[32m83.77%\u001b[39m and counterfactual cost = 12.44.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.84\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Effectiveness. Unfairness score = 0.417.\u001b[39m\n",
      "If \u001b[1mWorkclass =  Self-emp-not-inc, capital-loss = 0, native-country =  United-States, relationship =  Married, sex =  Male\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.09%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Local-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m5.26%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  State-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m5.26%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Private\u001b[39m\u001b[0m with effectiveness \u001b[32m10.53%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-inc\u001b[39m\u001b[0m with effectiveness \u001b[32m26.32%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Federal-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m26.32%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Private\u001b[39m, \u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m31.58%\u001b[39m and counterfactual cost = 1.43.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Private\u001b[39m, \u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m31.58%\u001b[39m and counterfactual cost = 1.44.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Private\u001b[39m, \u001b[31mcapital-loss = 1977\u001b[39m\u001b[0m with effectiveness \u001b[32m31.58%\u001b[39m and counterfactual cost = 1.45.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Private\u001b[39m, \u001b[31mrelationship =  Not-in-family\u001b[39m\u001b[0m with effectiveness \u001b[32m31.58%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.32\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m4.55%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  State-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m10.73%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Local-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m15.37%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Private\u001b[39m\u001b[0m with effectiveness \u001b[32m17.80%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-inc\u001b[39m\u001b[0m with effectiveness \u001b[32m31.95%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Federal-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m40.24%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Private\u001b[39m, \u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m70.73%\u001b[39m and counterfactual cost = 1.43.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Private\u001b[39m, \u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m70.73%\u001b[39m and counterfactual cost = 1.44.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Private\u001b[39m, \u001b[31mcapital-loss = 1977\u001b[39m\u001b[0m with effectiveness \u001b[32m73.17%\u001b[39m and counterfactual cost = 1.45.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Private\u001b[39m, \u001b[31mrelationship =  Not-in-family\u001b[39m\u001b[0m with effectiveness \u001b[32m73.17%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.73\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Effectiveness. Unfairness score = 0.416.\u001b[39m\n",
      "If \u001b[1mage = (34.0, 41.0], capital-loss = 0, occupation =  Craft-repair, relationship =  Married\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.03%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m5.56%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Tech-support\u001b[39m\u001b[0m with effectiveness \u001b[32m5.56%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m11.11%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m11.11%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m11.11%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m11.11%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m11.11%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m11.11%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m11.11%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Tech-support\u001b[39m\u001b[0m with effectiveness \u001b[32m11.11%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m27.78%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m27.78%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.28\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.91%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m2.33%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m\u001b[0m with effectiveness \u001b[32m2.33%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m\u001b[0m with effectiveness \u001b[32m3.49%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m13.95%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Tech-support\u001b[39m\u001b[0m with effectiveness \u001b[32m18.60%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m19.77%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Tech-support\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m47.09%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m69.19%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.69\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Effectiveness. Unfairness score = 0.414.\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[1mcapital-gain = 0, native-country =  United-States\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m76.82%\u001b[39m covered out of 1727\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 3103\u001b[39m\u001b[0m with effectiveness \u001b[32m9.19%\u001b[39m and counterfactual cost = 0.03.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 4386\u001b[39m\u001b[0m with effectiveness \u001b[32m12.99%\u001b[39m and counterfactual cost = 0.04.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 5178\u001b[39m\u001b[0m with effectiveness \u001b[32m17.77%\u001b[39m and counterfactual cost = 0.05.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m27.71%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m29.87%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m74.46%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m89.37%\u001b[39m covered out of 9027\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 3103\u001b[39m\u001b[0m with effectiveness \u001b[32m20.20%\u001b[39m and counterfactual cost = 0.03.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 4386\u001b[39m\u001b[0m with effectiveness \u001b[32m28.05%\u001b[39m and counterfactual cost = 0.04.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 5178\u001b[39m\u001b[0m with effectiveness \u001b[32m32.66%\u001b[39m and counterfactual cost = 0.05.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m44.56%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m46.64%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m81.06%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 5.69.\u001b[39m\n",
      "If \u001b[1mcapital-gain = 0, capital-loss = 0, native-country =  United-States\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m74.81%\u001b[39m covered out of 1727\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 3103\u001b[39m\u001b[0m with effectiveness \u001b[32m8.82%\u001b[39m and counterfactual cost = 0.03.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 4386\u001b[39m\u001b[0m with effectiveness \u001b[32m12.50%\u001b[39m and counterfactual cost = 0.04.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 5178\u001b[39m\u001b[0m with effectiveness \u001b[32m17.02%\u001b[39m and counterfactual cost = 0.05.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m26.99%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m29.14%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m73.93%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m73.93%\u001b[39m and counterfactual cost = 0.43.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m73.93%\u001b[39m and counterfactual cost = 0.44.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1977\u001b[39m\u001b[0m with effectiveness \u001b[32m73.93%\u001b[39m and counterfactual cost = 0.45.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m86.65%\u001b[39m covered out of 9027\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 3103\u001b[39m\u001b[0m with effectiveness \u001b[32m19.76%\u001b[39m and counterfactual cost = 0.03.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 4386\u001b[39m\u001b[0m with effectiveness \u001b[32m27.50%\u001b[39m and counterfactual cost = 0.04.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 5178\u001b[39m\u001b[0m with effectiveness \u001b[32m31.98%\u001b[39m and counterfactual cost = 0.05.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m43.82%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m45.84%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m80.66%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m80.66%\u001b[39m and counterfactual cost = 0.43.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m80.66%\u001b[39m and counterfactual cost = 0.44.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1977\u001b[39m\u001b[0m with effectiveness \u001b[32m80.66%\u001b[39m and counterfactual cost = 0.45.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 5.6.\u001b[39m\n",
      "If \u001b[1mcapital-gain = 0\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m96.16%\u001b[39m covered out of 1727\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 3103\u001b[39m\u001b[0m with effectiveness \u001b[32m9.37%\u001b[39m and counterfactual cost = 0.03.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 4386\u001b[39m\u001b[0m with effectiveness \u001b[32m13.66%\u001b[39m and counterfactual cost = 0.04.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 5178\u001b[39m\u001b[0m with effectiveness \u001b[32m18.38%\u001b[39m and counterfactual cost = 0.05.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m28.94%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m31.09%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m74.64%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m96.61%\u001b[39m covered out of 9027\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 3103\u001b[39m\u001b[0m with effectiveness \u001b[32m19.51%\u001b[39m and counterfactual cost = 0.03.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 4386\u001b[39m\u001b[0m with effectiveness \u001b[32m27.08%\u001b[39m and counterfactual cost = 0.04.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 5178\u001b[39m\u001b[0m with effectiveness \u001b[32m31.61%\u001b[39m and counterfactual cost = 0.05.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m43.27%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m45.38%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m80.23%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 5.35.\u001b[39m\n",
      "If \u001b[1mcapital-gain = 0, capital-loss = 0\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m93.75%\u001b[39m covered out of 1727\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 3103\u001b[39m\u001b[0m with effectiveness \u001b[32m9.06%\u001b[39m and counterfactual cost = 0.03.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 4386\u001b[39m\u001b[0m with effectiveness \u001b[32m13.16%\u001b[39m and counterfactual cost = 0.04.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 5178\u001b[39m\u001b[0m with effectiveness \u001b[32m17.63%\u001b[39m and counterfactual cost = 0.05.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m28.21%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m30.35%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m74.11%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m74.11%\u001b[39m and counterfactual cost = 0.43.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m74.11%\u001b[39m and counterfactual cost = 0.44.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1977\u001b[39m\u001b[0m with effectiveness \u001b[32m74.11%\u001b[39m and counterfactual cost = 0.45.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m93.76%\u001b[39m covered out of 9027\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 3103\u001b[39m\u001b[0m with effectiveness \u001b[32m19.08%\u001b[39m and counterfactual cost = 0.03.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 4386\u001b[39m\u001b[0m with effectiveness \u001b[32m26.53%\u001b[39m and counterfactual cost = 0.04.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 5178\u001b[39m\u001b[0m with effectiveness \u001b[32m30.94%\u001b[39m and counterfactual cost = 0.05.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m42.54%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m44.60%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m79.82%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m79.82%\u001b[39m and counterfactual cost = 0.43.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m79.82%\u001b[39m and counterfactual cost = 0.44.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1977\u001b[39m\u001b[0m with effectiveness \u001b[32m79.82%\u001b[39m and counterfactual cost = 0.45.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 5.28.\u001b[39m\n",
      "If \u001b[1mWorkclass =  Private, capital-gain = 0, native-country =  United-States\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m57.43%\u001b[39m covered out of 1727\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m24.18%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m26.17%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m70.83%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Local-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m70.83%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-not-inc\u001b[39m\u001b[0m with effectiveness \u001b[32m70.83%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  State-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m70.83%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-inc\u001b[39m\u001b[0m with effectiveness \u001b[32m70.83%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Federal-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m70.83%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m68.80%\u001b[39m covered out of 9027\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m40.27%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m42.24%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m78.17%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Local-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m78.17%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-not-inc\u001b[39m\u001b[0m with effectiveness \u001b[32m78.17%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  State-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m78.17%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-inc\u001b[39m\u001b[0m with effectiveness \u001b[32m78.17%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Federal-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m78.17%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 4.71.\u001b[39m\n",
      "If \u001b[1mWorkclass =  Private, capital-gain = 0, capital-loss = 0, native-country =  United-States\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m55.77%\u001b[39m covered out of 1727\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m23.25%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m25.21%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m70.16%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m70.16%\u001b[39m and counterfactual cost = 0.43.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m70.16%\u001b[39m and counterfactual cost = 0.44.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1977\u001b[39m\u001b[0m with effectiveness \u001b[32m70.16%\u001b[39m and counterfactual cost = 0.45.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Local-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m70.16%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-not-inc\u001b[39m\u001b[0m with effectiveness \u001b[32m70.16%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  State-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m70.16%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-inc\u001b[39m\u001b[0m with effectiveness \u001b[32m70.16%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Federal-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m70.16%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m66.73%\u001b[39m covered out of 9027\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m39.49%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m41.41%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m77.73%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m77.73%\u001b[39m and counterfactual cost = 0.43.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m77.73%\u001b[39m and counterfactual cost = 0.44.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1977\u001b[39m\u001b[0m with effectiveness \u001b[32m77.73%\u001b[39m and counterfactual cost = 0.45.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Local-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m77.73%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-not-inc\u001b[39m\u001b[0m with effectiveness \u001b[32m77.73%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  State-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m77.73%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-inc\u001b[39m\u001b[0m with effectiveness \u001b[32m77.73%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Federal-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m77.73%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 4.68.\u001b[39m\n",
      "If \u001b[1mcapital-loss = 0, native-country =  United-States\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m78.03%\u001b[39m covered out of 1727\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m11.40%\u001b[39m and counterfactual cost = 0.43.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m11.40%\u001b[39m and counterfactual cost = 0.44.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1977\u001b[39m\u001b[0m with effectiveness \u001b[32m11.69%\u001b[39m and counterfactual cost = 0.45.\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m89.81%\u001b[39m covered out of 9027\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m23.54%\u001b[39m and counterfactual cost = 0.43.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m23.61%\u001b[39m and counterfactual cost = 0.44.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1977\u001b[39m\u001b[0m with effectiveness \u001b[32m24.40%\u001b[39m and counterfactual cost = 0.45.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 4.32.\u001b[39m\n",
      "If \u001b[1mcapital-loss = 0\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m97.59%\u001b[39m covered out of 1727\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m11.52%\u001b[39m and counterfactual cost = 0.43.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m11.64%\u001b[39m and counterfactual cost = 0.44.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1977\u001b[39m\u001b[0m with effectiveness \u001b[32m12.11%\u001b[39m and counterfactual cost = 0.45.\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m97.15%\u001b[39m covered out of 9027\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m22.77%\u001b[39m and counterfactual cost = 0.43.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m22.83%\u001b[39m and counterfactual cost = 0.44.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1977\u001b[39m\u001b[0m with effectiveness \u001b[32m23.60%\u001b[39m and counterfactual cost = 0.45.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 4.32.\u001b[39m\n",
      "If \u001b[1mWorkclass =  Private, capital-gain = 0\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m74.13%\u001b[39m covered out of 1727\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m25.70%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m27.71%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m71.28%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Local-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m71.28%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-not-inc\u001b[39m\u001b[0m with effectiveness \u001b[32m71.28%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  State-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m71.28%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-inc\u001b[39m\u001b[0m with effectiveness \u001b[32m71.28%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Federal-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m71.28%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m74.83%\u001b[39m covered out of 9027\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m38.83%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m40.77%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m77.20%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Local-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m77.20%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-not-inc\u001b[39m\u001b[0m with effectiveness \u001b[32m77.20%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  State-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m77.20%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-inc\u001b[39m\u001b[0m with effectiveness \u001b[32m77.20%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Federal-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m77.20%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 4.31.\u001b[39m\n",
      "If \u001b[1mage = (26.0, 34.0], capital-gain = 0, native-country =  United-States\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m19.33%\u001b[39m covered out of 1727\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m\u001b[0m with effectiveness \u001b[32m2.97%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m\u001b[0m with effectiveness \u001b[32m5.04%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m, \u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m33.23%\u001b[39m and counterfactual cost = 1.07.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m38.58%\u001b[39m and counterfactual cost = 1.08.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m, \u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m90.21%\u001b[39m and counterfactual cost = 1.15.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m94.07%\u001b[39m and counterfactual cost = 1.15.\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m19.76%\u001b[39m covered out of 9027\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m\u001b[0m with effectiveness \u001b[32m7.24%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m\u001b[0m with effectiveness \u001b[32m9.88%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m, \u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m57.80%\u001b[39m and counterfactual cost = 1.07.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m64.20%\u001b[39m and counterfactual cost = 1.08.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m, \u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m97.08%\u001b[39m and counterfactual cost = 1.15.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m98.37%\u001b[39m and counterfactual cost = 1.15.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 4.3.\u001b[39m\n",
      "If \u001b[1mWorkclass =  Private, capital-gain = 0, capital-loss = 0\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m72.12%\u001b[39m covered out of 1727\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m24.82%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m26.81%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m70.64%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m70.64%\u001b[39m and counterfactual cost = 0.43.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m70.64%\u001b[39m and counterfactual cost = 0.44.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1977\u001b[39m\u001b[0m with effectiveness \u001b[32m70.64%\u001b[39m and counterfactual cost = 0.45.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Local-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m70.64%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-not-inc\u001b[39m\u001b[0m with effectiveness \u001b[32m70.64%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  State-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m70.64%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-inc\u001b[39m\u001b[0m with effectiveness \u001b[32m70.64%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Federal-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m70.64%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m72.67%\u001b[39m covered out of 9027\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m38.10%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m39.97%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m76.76%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m76.76%\u001b[39m and counterfactual cost = 0.43.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m76.76%\u001b[39m and counterfactual cost = 0.44.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1977\u001b[39m\u001b[0m with effectiveness \u001b[32m76.76%\u001b[39m and counterfactual cost = 0.45.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Local-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m76.76%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-not-inc\u001b[39m\u001b[0m with effectiveness \u001b[32m76.76%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  State-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m76.76%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-inc\u001b[39m\u001b[0m with effectiveness \u001b[32m76.76%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Federal-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m76.76%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 4.29.\u001b[39m\n",
      "If \u001b[1mcapital-gain = 0, hours-per-week = FullTime, native-country =  United-States\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m46.30%\u001b[39m covered out of 1727\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m30.36%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m32.96%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m81.16%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = MidTime\u001b[39m\u001b[0m with effectiveness \u001b[32m81.16%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m81.16%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m81.16%\u001b[39m and counterfactual cost = 1.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m81.16%\u001b[39m and counterfactual cost = 1.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m85.75%\u001b[39m and counterfactual cost = 1.15.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = BrainDrain\u001b[39m\u001b[0m with effectiveness \u001b[32m85.75%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = BrainDrain\u001b[39m\u001b[0m with effectiveness \u001b[32m86.37%\u001b[39m and counterfactual cost = 2.15.\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m42.40%\u001b[39m covered out of 9027\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m46.93%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m49.25%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m87.92%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = MidTime\u001b[39m\u001b[0m with effectiveness \u001b[32m87.92%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m87.92%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m87.92%\u001b[39m and counterfactual cost = 1.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m87.92%\u001b[39m and counterfactual cost = 1.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m91.42%\u001b[39m and counterfactual cost = 1.15.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = BrainDrain\u001b[39m\u001b[0m with effectiveness \u001b[32m91.42%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = BrainDrain\u001b[39m\u001b[0m with effectiveness \u001b[32m91.79%\u001b[39m and counterfactual cost = 2.15.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 4.26.\u001b[39m\n",
      "If \u001b[1mcapital-gain = 0, capital-loss = 0, hours-per-week = FullTime, native-country =  United-States\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m45.27%\u001b[39m covered out of 1727\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m29.66%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m32.19%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m80.74%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m80.74%\u001b[39m and counterfactual cost = 0.43.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m80.74%\u001b[39m and counterfactual cost = 0.44.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = MidTime\u001b[39m\u001b[0m with effectiveness \u001b[32m80.74%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m80.74%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m80.74%\u001b[39m and counterfactual cost = 1.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m80.74%\u001b[39m and counterfactual cost = 1.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m85.42%\u001b[39m and counterfactual cost = 1.15.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = BrainDrain\u001b[39m\u001b[0m with effectiveness \u001b[32m85.42%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = BrainDrain\u001b[39m\u001b[0m with effectiveness \u001b[32m86.06%\u001b[39m and counterfactual cost = 2.15.\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m41.18%\u001b[39m covered out of 9027\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m46.19%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m48.48%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m87.61%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m87.61%\u001b[39m and counterfactual cost = 0.43.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m87.61%\u001b[39m and counterfactual cost = 0.44.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = MidTime\u001b[39m\u001b[0m with effectiveness \u001b[32m87.61%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m87.61%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m87.61%\u001b[39m and counterfactual cost = 1.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m87.61%\u001b[39m and counterfactual cost = 1.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m91.19%\u001b[39m and counterfactual cost = 1.15.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = BrainDrain\u001b[39m\u001b[0m with effectiveness \u001b[32m91.19%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = BrainDrain\u001b[39m\u001b[0m with effectiveness \u001b[32m91.57%\u001b[39m and counterfactual cost = 2.15.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 4.2.\u001b[39m\n",
      "If \u001b[1mage = (26.0, 34.0], capital-gain = 0, capital-loss = 0, native-country =  United-States\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m18.99%\u001b[39m covered out of 1727\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m\u001b[0m with effectiveness \u001b[32m2.72%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m\u001b[0m with effectiveness \u001b[32m4.83%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m, \u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m32.63%\u001b[39m and counterfactual cost = 1.07.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m38.07%\u001b[39m and counterfactual cost = 1.08.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m, \u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m90.03%\u001b[39m and counterfactual cost = 1.15.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m93.96%\u001b[39m and counterfactual cost = 1.15.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m93.96%\u001b[39m and counterfactual cost = 1.44.\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m19.13%\u001b[39m covered out of 9027\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m\u001b[0m with effectiveness \u001b[32m6.96%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m\u001b[0m with effectiveness \u001b[32m9.57%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m, \u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m57.04%\u001b[39m and counterfactual cost = 1.07.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m63.30%\u001b[39m and counterfactual cost = 1.08.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (34.0, 41.0]\u001b[39m, \u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m96.99%\u001b[39m and counterfactual cost = 1.15.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m98.32%\u001b[39m and counterfactual cost = 1.15.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m98.32%\u001b[39m and counterfactual cost = 1.44.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 4.19.\u001b[39m\n",
      "If \u001b[1mcapital-gain = 0, native-country =  United-States, sex =  Male\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m38.15%\u001b[39m covered out of 1727\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 3103\u001b[39m\u001b[0m with effectiveness \u001b[32m15.49%\u001b[39m and counterfactual cost = 0.03.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 5178\u001b[39m\u001b[0m with effectiveness \u001b[32m27.22%\u001b[39m and counterfactual cost = 0.05.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m38.05%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m40.00%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m78.50%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m56.23%\u001b[39m covered out of 9027\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 3103\u001b[39m\u001b[0m with effectiveness \u001b[32m28.15%\u001b[39m and counterfactual cost = 0.03.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 5178\u001b[39m\u001b[0m with effectiveness \u001b[32m43.16%\u001b[39m and counterfactual cost = 0.05.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m54.99%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m56.79%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m84.85%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 4.09.\u001b[39m\n",
      "If \u001b[1mcapital-gain = 0, capital-loss = 0, native-country =  United-States, sex =  Male\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m37.01%\u001b[39m covered out of 1727\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 3103\u001b[39m\u001b[0m with effectiveness \u001b[32m15.04%\u001b[39m and counterfactual cost = 0.03.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 5178\u001b[39m\u001b[0m with effectiveness \u001b[32m26.51%\u001b[39m and counterfactual cost = 0.05.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m37.52%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m39.53%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m78.14%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m78.14%\u001b[39m and counterfactual cost = 0.43.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m78.14%\u001b[39m and counterfactual cost = 0.44.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1977\u001b[39m\u001b[0m with effectiveness \u001b[32m78.14%\u001b[39m and counterfactual cost = 0.45.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m54.58%\u001b[39m covered out of 9027\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 3103\u001b[39m\u001b[0m with effectiveness \u001b[32m27.74%\u001b[39m and counterfactual cost = 0.03.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 5178\u001b[39m\u001b[0m with effectiveness \u001b[32m42.57%\u001b[39m and counterfactual cost = 0.05.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m54.44%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m56.21%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m84.54%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m84.54%\u001b[39m and counterfactual cost = 0.43.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m84.54%\u001b[39m and counterfactual cost = 0.44.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1977\u001b[39m\u001b[0m with effectiveness \u001b[32m84.54%\u001b[39m and counterfactual cost = 0.45.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 4.02.\u001b[39m\n",
      "If \u001b[1mcapital-gain = 0, sex =  Male\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m49.28%\u001b[39m covered out of 1727\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 3103\u001b[39m\u001b[0m with effectiveness \u001b[32m15.37%\u001b[39m and counterfactual cost = 0.03.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 5178\u001b[39m\u001b[0m with effectiveness \u001b[32m28.06%\u001b[39m and counterfactual cost = 0.05.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m39.23%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m40.98%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m78.58%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m60.95%\u001b[39m covered out of 9027\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 3103\u001b[39m\u001b[0m with effectiveness \u001b[32m27.04%\u001b[39m and counterfactual cost = 0.03.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 5178\u001b[39m\u001b[0m with effectiveness \u001b[32m41.57%\u001b[39m and counterfactual cost = 0.05.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m53.19%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m55.05%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m83.79%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 3.82.\u001b[39m\n",
      "If \u001b[1mcapital-gain = 0, capital-loss = 0, sex =  Male\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m47.91%\u001b[39m covered out of 1727\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 3103\u001b[39m\u001b[0m with effectiveness \u001b[32m14.97%\u001b[39m and counterfactual cost = 0.03.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 5178\u001b[39m\u001b[0m with effectiveness \u001b[32m27.31%\u001b[39m and counterfactual cost = 0.05.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m38.56%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m40.36%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m78.20%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m78.20%\u001b[39m and counterfactual cost = 0.43.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m78.20%\u001b[39m and counterfactual cost = 0.44.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1977\u001b[39m\u001b[0m with effectiveness \u001b[32m78.20%\u001b[39m and counterfactual cost = 0.45.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m59.25%\u001b[39m covered out of 9027\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 3103\u001b[39m\u001b[0m with effectiveness \u001b[32m26.64%\u001b[39m and counterfactual cost = 0.03.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 5178\u001b[39m\u001b[0m with effectiveness \u001b[32m40.98%\u001b[39m and counterfactual cost = 0.05.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m52.64%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m54.47%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m83.47%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m83.47%\u001b[39m and counterfactual cost = 0.43.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m83.47%\u001b[39m and counterfactual cost = 0.44.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-loss = 1977\u001b[39m\u001b[0m with effectiveness \u001b[32m83.47%\u001b[39m and counterfactual cost = 0.45.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 99999\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 3.78.\u001b[39m\n",
      "If \u001b[1mage = (50.0, 90.0], capital-gain = 0\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m14.97%\u001b[39m covered out of 1727\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m39.85%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m86.59%\u001b[39m and counterfactual cost = 0.15.\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m17.20%\u001b[39m covered out of 9027\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m64.60%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m96.39%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 3.69.\u001b[39m\n",
      "If \u001b[1mcapital-gain = 0, hours-per-week = FullTime\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m57.60%\u001b[39m covered out of 1727\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m32.17%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m34.76%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m80.68%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = MidTime\u001b[39m\u001b[0m with effectiveness \u001b[32m80.68%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m80.68%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m80.68%\u001b[39m and counterfactual cost = 1.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m80.68%\u001b[39m and counterfactual cost = 1.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m85.16%\u001b[39m and counterfactual cost = 1.15.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = BrainDrain\u001b[39m\u001b[0m with effectiveness \u001b[32m85.16%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = BrainDrain\u001b[39m\u001b[0m with effectiveness \u001b[32m85.96%\u001b[39m and counterfactual cost = 2.15.\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m46.57%\u001b[39m covered out of 9027\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m\u001b[0m with effectiveness \u001b[32m45.11%\u001b[39m and counterfactual cost = 0.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m\u001b[0m with effectiveness \u001b[32m47.51%\u001b[39m and counterfactual cost = 0.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m\u001b[0m with effectiveness \u001b[32m86.52%\u001b[39m and counterfactual cost = 0.15.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = MidTime\u001b[39m\u001b[0m with effectiveness \u001b[32m86.52%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m86.52%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7298\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m86.52%\u001b[39m and counterfactual cost = 1.07.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 7688\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m86.52%\u001b[39m and counterfactual cost = 1.08.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = OverTime\u001b[39m\u001b[0m with effectiveness \u001b[32m90.19%\u001b[39m and counterfactual cost = 1.15.\n",
      "\t\tMake \u001b[1m\u001b[31mhours-per-week = BrainDrain\u001b[39m\u001b[0m with effectiveness \u001b[32m90.19%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcapital-gain = 15024\u001b[39m, \u001b[31mhours-per-week = BrainDrain\u001b[39m\u001b[0m with effectiveness \u001b[32m90.57%\u001b[39m and counterfactual cost = 2.15.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 3.67.\u001b[39m\n"
     ]
    }
   ],
   "source": [
    "# taken from the other notebooks\n",
    "affected_pop_sizes = {' Non-White': 1727, ' White': 9027}\n",
    "\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",
    ")\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[1mage = (34.0, 41.0], capital-loss = 0, native-country =  United-States, occupation =  Machine-op-inspct\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.38%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Tech-support\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Tech-support\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.20%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m3.70%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m6.48%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m11.11%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Tech-support\u001b[39m\u001b[0m with effectiveness \u001b[32m13.89%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m17.59%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Craft-repair\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Tech-support\u001b[39m\u001b[0m with effectiveness \u001b[32m29.63%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m50.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.50\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Effectiveness within Budget (Micro). Unfairness score = 0.5.\u001b[39m\n",
      "If \u001b[1mage = (34.0, 41.0], capital-gain = 0, capital-loss = 0, marital-status =  Married-civ-spouse, occupation =  Craft-repair\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.09%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m5.26%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m10.53%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m10.53%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m10.53%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m10.53%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m10.53%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m10.53%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m26.32%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m26.32%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.26\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.91%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m\u001b[0m with effectiveness \u001b[32m3.49%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m13.95%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m19.77%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m47.09%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m69.19%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.69\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Effectiveness within Budget (Micro). Unfairness score = 0.429.\u001b[39m\n",
      "If \u001b[1mWorkclass =  Self-emp-not-inc, capital-loss = 0, native-country =  United-States, relationship =  Married, sex =  Male\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.09%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Local-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m5.26%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  State-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m5.26%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Private\u001b[39m\u001b[0m with effectiveness \u001b[32m10.53%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-inc\u001b[39m\u001b[0m with effectiveness \u001b[32m26.32%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Federal-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m26.32%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Private\u001b[39m, \u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m31.58%\u001b[39m and counterfactual cost = 1.43.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Private\u001b[39m, \u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m31.58%\u001b[39m and counterfactual cost = 1.44.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Private\u001b[39m, \u001b[31mcapital-loss = 1977\u001b[39m\u001b[0m with effectiveness \u001b[32m31.58%\u001b[39m and counterfactual cost = 1.45.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.32\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m4.55%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  State-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m10.73%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Local-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m15.37%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Private\u001b[39m\u001b[0m with effectiveness \u001b[32m17.80%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Self-emp-inc\u001b[39m\u001b[0m with effectiveness \u001b[32m31.95%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Federal-gov\u001b[39m\u001b[0m with effectiveness \u001b[32m40.24%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Private\u001b[39m, \u001b[31mcapital-loss = 1887\u001b[39m\u001b[0m with effectiveness \u001b[32m70.73%\u001b[39m and counterfactual cost = 1.43.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Private\u001b[39m, \u001b[31mcapital-loss = 1902\u001b[39m\u001b[0m with effectiveness \u001b[32m70.73%\u001b[39m and counterfactual cost = 1.44.\n",
      "\t\tMake \u001b[1m\u001b[31mWorkclass =  Private\u001b[39m, \u001b[31mcapital-loss = 1977\u001b[39m\u001b[0m with effectiveness \u001b[32m73.17%\u001b[39m and counterfactual cost = 1.45.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.73\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Effectiveness within Budget (Micro). Unfairness score = 0.416.\u001b[39m\n",
      "If \u001b[1mage = (34.0, 41.0], capital-loss = 0, occupation =  Craft-repair, relationship =  Married\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1m Non-White\u001b[0m', \u001b[34m1.03%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m5.56%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Tech-support\u001b[39m\u001b[0m with effectiveness \u001b[32m5.56%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m11.11%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m11.11%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m11.11%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m11.11%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m11.11%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m11.11%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m11.11%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Tech-support\u001b[39m\u001b[0m with effectiveness \u001b[32m11.11%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m27.78%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m27.78%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.28\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1m White\u001b[0m', \u001b[34m1.91%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m2.33%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m\u001b[0m with effectiveness \u001b[32m2.33%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m\u001b[0m with effectiveness \u001b[32m3.49%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m13.95%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Tech-support\u001b[39m\u001b[0m with effectiveness \u001b[32m18.60%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m19.77%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 1.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Adm-clerical\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Sales\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Tech-support\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Prof-specialty\u001b[39m\u001b[0m with effectiveness \u001b[32m43.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (50.0, 90.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m47.09%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mage = (41.0, 50.0]\u001b[39m, \u001b[31moccupation =  Exec-managerial\u001b[39m\u001b[0m with effectiveness \u001b[32m69.19%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.69\u001b[39m\n",
      "\t\u001b[35mBias against  Non-White due to Equal Effectiveness within Budget (Micro). Unfairness score = 0.414.\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=[\" Non-White\", \" White\"],\n",
    "    effectiveness_thresholds=[0.3, 0.7],\n",
    "    cost_budgets=budgets,\n",
    "    params=params\n",
    ")\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=[\" White\", \" Non-White\"], 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=[\" White\", \" Non-White\"])\n",
    "diff_real_val, _, = get_diff_real_diff_drop(df, diff, sensitive_attribute_vals=[\" White\", \" Non-White\"])\n",
    "analysis_df,rank_analysis_df = get_analysis_dfs(comb_df,diff_real_val, rev_bias_metrics, ranked,percentage=0.1, sensitive_attribute_vals=[\"White\", \"Non-White\"])\n"
   ]
  },
  {
   "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>capital-loss = 0</th>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0000</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>7523.0</td>\n",
       "      <td>0.000156</td>\n",
       "      <td>Non-White</td>\n",
       "      <td>4615.0</td>\n",
       "      <td>0.114881</td>\n",
       "      <td>Non-White</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>capital-gain = 0</th>\n",
       "      <td>32.0</td>\n",
       "      <td>0.0251</td>\n",
       "      <td>Non-White</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>9.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>Non-White</td>\n",
       "      <td>Fair</td>\n",
       "      <td>...</td>\n",
       "      <td>Non-White</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>5115.0</td>\n",
       "      <td>0.063698</td>\n",
       "      <td>Non-White</td>\n",
       "      <td>3307.0</td>\n",
       "      <td>0.143342</td>\n",
       "      <td>Non-White</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>capital-gain = 0, capital-loss = 0</th>\n",
       "      <td>32.0</td>\n",
       "      <td>0.0251</td>\n",
       "      <td>Non-White</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>9.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>Non-White</td>\n",
       "      <td>Fair</td>\n",
       "      <td>...</td>\n",
       "      <td>Non-White</td>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Fair</td>\n",
       "      <td>5108.0</td>\n",
       "      <td>0.064657</td>\n",
       "      <td>Non-White</td>\n",
       "      <td>3309.0</td>\n",
       "      <td>0.143281</td>\n",
       "      <td>Non-White</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>capital-loss = 0, native-country =  United-States</th>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0000</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>7521.0</td>\n",
       "      <td>0.000160</td>\n",
       "      <td>White</td>\n",
       "      <td>4027.0</td>\n",
       "      <td>0.127129</td>\n",
       "      <td>Non-White</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Workclass =  Private</th>\n",
       "      <td>Fair</td>\n",
       "      <td>0.0000</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.000000</td>\n",
       "      <td>Fair</td>\n",
       "      <td>8820.0</td>\n",
       "      <td>0.043964</td>\n",
       "      <td>Non-White</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 36 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                  (Equal Cost of Effectiveness(Macro), 0.3)  \\\n",
       "                                                                                       rank   \n",
       "subgroup                                                                                      \n",
       "capital-loss = 0                                                                       Fair   \n",
       "capital-gain = 0                                                                       32.0   \n",
       "capital-gain = 0, capital-loss = 0                                                     32.0   \n",
       "capital-loss = 0, native-country =  United-States                                      Fair   \n",
       "Workclass =  Private                                                                   Fair   \n",
       "\n",
       "                                                                        \\\n",
       "                                                    score bias against   \n",
       "subgroup                                                                 \n",
       "capital-loss = 0                                   0.0000         Fair   \n",
       "capital-gain = 0                                   0.0251    Non-White   \n",
       "capital-gain = 0, capital-loss = 0                 0.0251    Non-White   \n",
       "capital-loss = 0, native-country =  United-States  0.0000         Fair   \n",
       "Workclass =  Private                               0.0000         Fair   \n",
       "\n",
       "                                                  (Equal Cost of Effectiveness(Macro), 0.7)  \\\n",
       "                                                                                       rank   \n",
       "subgroup                                                                                      \n",
       "capital-loss = 0                                                                       Fair   \n",
       "capital-gain = 0                                                                       Fair   \n",
       "capital-gain = 0, capital-loss = 0                                                     Fair   \n",
       "capital-loss = 0, native-country =  United-States                                      Fair   \n",
       "Workclass =  Private                                                                   Fair   \n",
       "\n",
       "                                                                      \\\n",
       "                                                  score bias against   \n",
       "subgroup                                                               \n",
       "capital-loss = 0                                    0.0         Fair   \n",
       "capital-gain = 0                                    0.0         Fair   \n",
       "capital-gain = 0, capital-loss = 0                  0.0         Fair   \n",
       "capital-loss = 0, native-country =  United-States   0.0         Fair   \n",
       "Workclass =  Private                                0.0         Fair   \n",
       "\n",
       "                                                  (Equal Choice for Recourse, 0.3)  \\\n",
       "                                                                              rank   \n",
       "subgroup                                                                             \n",
       "capital-loss = 0                                                              Fair   \n",
       "capital-gain = 0                                                               9.0   \n",
       "capital-gain = 0, capital-loss = 0                                             9.0   \n",
       "capital-loss = 0, native-country =  United-States                             Fair   \n",
       "Workclass =  Private                                                          Fair   \n",
       "\n",
       "                                                                      \\\n",
       "                                                  score bias against   \n",
       "subgroup                                                               \n",
       "capital-loss = 0                                    0.0         Fair   \n",
       "capital-gain = 0                                    2.0    Non-White   \n",
       "capital-gain = 0, capital-loss = 0                  2.0    Non-White   \n",
       "capital-loss = 0, native-country =  United-States   0.0         Fair   \n",
       "Workclass =  Private                                0.0         Fair   \n",
       "\n",
       "                                                  (Equal Choice for Recourse, 0.7)  \\\n",
       "                                                                              rank   \n",
       "subgroup                                                                             \n",
       "capital-loss = 0                                                              Fair   \n",
       "capital-gain = 0                                                              Fair   \n",
       "capital-gain = 0, capital-loss = 0                                            Fair   \n",
       "capital-loss = 0, native-country =  United-States                             Fair   \n",
       "Workclass =  Private                                                          Fair   \n",
       "\n",
       "                                                   ...  \\\n",
       "                                                   ...   \n",
       "subgroup                                           ...   \n",
       "capital-loss = 0                                   ...   \n",
       "capital-gain = 0                                   ...   \n",
       "capital-gain = 0, capital-loss = 0                 ...   \n",
       "capital-loss = 0, native-country =  United-States  ...   \n",
       "Workclass =  Private                               ...   \n",
       "\n",
       "                                                  (Equal Cost of Effectiveness(Micro), 0.3)  \\\n",
       "                                                                               bias against   \n",
       "subgroup                                                                                      \n",
       "capital-loss = 0                                                                       Fair   \n",
       "capital-gain = 0                                                                  Non-White   \n",
       "capital-gain = 0, capital-loss = 0                                                Non-White   \n",
       "capital-loss = 0, native-country =  United-States                                      Fair   \n",
       "Workclass =  Private                                                                   Fair   \n",
       "\n",
       "                                                  (Equal Cost of Effectiveness(Micro), 0.7)  \\\n",
       "                                                                                       rank   \n",
       "subgroup                                                                                      \n",
       "capital-loss = 0                                                                       Fair   \n",
       "capital-gain = 0                                                                       Fair   \n",
       "capital-gain = 0, capital-loss = 0                                                     Fair   \n",
       "capital-loss = 0, native-country =  United-States                                      Fair   \n",
       "Workclass =  Private                                                                   Fair   \n",
       "\n",
       "                                                                      \\\n",
       "                                                  score bias against   \n",
       "subgroup                                                               \n",
       "capital-loss = 0                                    0.0         Fair   \n",
       "capital-gain = 0                                    0.0         Fair   \n",
       "capital-gain = 0, capital-loss = 0                  0.0         Fair   \n",
       "capital-loss = 0, native-country =  United-States   0.0         Fair   \n",
       "Workclass =  Private                                0.0         Fair   \n",
       "\n",
       "                                                  Equal(Conditional) Mean Recourse  \\\n",
       "                                                                              rank   \n",
       "subgroup                                                                             \n",
       "capital-loss = 0                                                            7523.0   \n",
       "capital-gain = 0                                                            5115.0   \n",
       "capital-gain = 0, capital-loss = 0                                          5108.0   \n",
       "capital-loss = 0, native-country =  United-States                           7521.0   \n",
       "Workclass =  Private                                                          Fair   \n",
       "\n",
       "                                                                          \\\n",
       "                                                      score bias against   \n",
       "subgroup                                                                   \n",
       "capital-loss = 0                                   0.000156    Non-White   \n",
       "capital-gain = 0                                   0.063698    Non-White   \n",
       "capital-gain = 0, capital-loss = 0                 0.064657    Non-White   \n",
       "capital-loss = 0, native-country =  United-States  0.000160        White   \n",
       "Workclass =  Private                               0.000000         Fair   \n",
       "\n",
       "                                                  Fair Effectiveness-Cost Trade-Off  \\\n",
       "                                                                               rank   \n",
       "subgroup                                                                              \n",
       "capital-loss = 0                                                             4615.0   \n",
       "capital-gain = 0                                                             3307.0   \n",
       "capital-gain = 0, capital-loss = 0                                           3309.0   \n",
       "capital-loss = 0, native-country =  United-States                            4027.0   \n",
       "Workclass =  Private                                                         8820.0   \n",
       "\n",
       "                                                                          \n",
       "                                                      score bias against  \n",
       "subgroup                                                                  \n",
       "capital-loss = 0                                   0.114881    Non-White  \n",
       "capital-gain = 0                                   0.143342    Non-White  \n",
       "capital-gain = 0, capital-loss = 0                 0.143281    Non-White  \n",
       "capital-loss = 0, native-country =  United-States  0.127129    Non-White  \n",
       "Workclass =  Private                               0.043964    Non-White  \n",
       "\n",
       "[5 rows x 36 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>White bias against Count</th>\n",
       "      <th>Non-White bias against Count</th>\n",
       "      <th>Top 10% White bias against Count</th>\n",
       "      <th>Top 10% Non-White bias against Count</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>(Equal Cost of Effectiveness(Macro), 0.3)</th>\n",
       "      <td>1731</td>\n",
       "      <td>148</td>\n",
       "      <td>2802</td>\n",
       "      <td>0</td>\n",
       "      <td>295</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Cost of Effectiveness(Macro), 0.7)</th>\n",
       "      <td>325</td>\n",
       "      <td>58</td>\n",
       "      <td>526</td>\n",
       "      <td>7</td>\n",
       "      <td>51</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Choice for Recourse, 0.3)</th>\n",
       "      <td>1</td>\n",
       "      <td>215</td>\n",
       "      <td>3718</td>\n",
       "      <td>2</td>\n",
       "      <td>391</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Choice for Recourse, 0.7)</th>\n",
       "      <td>2</td>\n",
       "      <td>73</td>\n",
       "      <td>628</td>\n",
       "      <td>10</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Equal Effectiveness</th>\n",
       "      <td>1</td>\n",
       "      <td>2512</td>\n",
       "      <td>11884</td>\n",
       "      <td>6</td>\n",
       "      <td>1433</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Effectiveness within Budget, 1.150241502415024)</th>\n",
       "      <td>1</td>\n",
       "      <td>54</td>\n",
       "      <td>189</td>\n",
       "      <td>0</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Effectiveness within Budget, 10.072980729807298)</th>\n",
       "      <td>1</td>\n",
       "      <td>2227</td>\n",
       "      <td>10316</td>\n",
       "      <td>3</td>\n",
       "      <td>1251</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Effectiveness within Budget, 21.0)</th>\n",
       "      <td>1</td>\n",
       "      <td>2490</td>\n",
       "      <td>11744</td>\n",
       "      <td>0</td>\n",
       "      <td>1423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Cost of Effectiveness(Micro), 0.3)</th>\n",
       "      <td>1720</td>\n",
       "      <td>149</td>\n",
       "      <td>2794</td>\n",
       "      <td>0</td>\n",
       "      <td>294</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Cost of Effectiveness(Micro), 0.7)</th>\n",
       "      <td>325</td>\n",
       "      <td>58</td>\n",
       "      <td>522</td>\n",
       "      <td>7</td>\n",
       "      <td>51</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Equal(Conditional) Mean Recourse</th>\n",
       "      <td>2545</td>\n",
       "      <td>3914</td>\n",
       "      <td>9819</td>\n",
       "      <td>53</td>\n",
       "      <td>1320</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Fair Effectiveness-Cost Trade-Off, value)</th>\n",
       "      <td>2</td>\n",
       "      <td>2272</td>\n",
       "      <td>14389</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Total Count</th>\n",
       "      <td>6655</td>\n",
       "      <td>14170</td>\n",
       "      <td>69331</td>\n",
       "      <td>88</td>\n",
       "      <td>6593</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                    Rank = 1 Count  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                     1731   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                      325   \n",
       "(Equal Choice for Recourse, 0.3)                                 1   \n",
       "(Equal Choice for Recourse, 0.7)                                 2   \n",
       "Equal Effectiveness                                              1   \n",
       "(Equal Effectiveness within Budget, 1.150241502...               1   \n",
       "(Equal Effectiveness within Budget, 10.07298072...               1   \n",
       "(Equal Effectiveness within Budget, 21.0)                        1   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                     1720   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                      325   \n",
       "Equal(Conditional) Mean Recourse                              2545   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                       2   \n",
       "Total Count                                                   6655   \n",
       "\n",
       "                                                    White bias against Count  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                148   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                 58   \n",
       "(Equal Choice for Recourse, 0.3)                                         215   \n",
       "(Equal Choice for Recourse, 0.7)                                          73   \n",
       "Equal Effectiveness                                                     2512   \n",
       "(Equal Effectiveness within Budget, 1.150241502...                        54   \n",
       "(Equal Effectiveness within Budget, 10.07298072...                      2227   \n",
       "(Equal Effectiveness within Budget, 21.0)                               2490   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                149   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                 58   \n",
       "Equal(Conditional) Mean Recourse                                        3914   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                              2272   \n",
       "Total Count                                                            14170   \n",
       "\n",
       "                                                    Non-White bias against Count  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                   2802   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                    526   \n",
       "(Equal Choice for Recourse, 0.3)                                            3718   \n",
       "(Equal Choice for Recourse, 0.7)                                             628   \n",
       "Equal Effectiveness                                                        11884   \n",
       "(Equal Effectiveness within Budget, 1.150241502...                           189   \n",
       "(Equal Effectiveness within Budget, 10.07298072...                         10316   \n",
       "(Equal Effectiveness within Budget, 21.0)                                  11744   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                   2794   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                    522   \n",
       "Equal(Conditional) Mean Recourse                                            9819   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                 14389   \n",
       "Total Count                                                                69331   \n",
       "\n",
       "                                                    Top 10% White bias against Count  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                          0   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                          7   \n",
       "(Equal Choice for Recourse, 0.3)                                                   2   \n",
       "(Equal Choice for Recourse, 0.7)                                                  10   \n",
       "Equal Effectiveness                                                                6   \n",
       "(Equal Effectiveness within Budget, 1.150241502...                                 0   \n",
       "(Equal Effectiveness within Budget, 10.07298072...                                 3   \n",
       "(Equal Effectiveness within Budget, 21.0)                                          0   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                          0   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                          7   \n",
       "Equal(Conditional) Mean Recourse                                                  53   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                         0   \n",
       "Total Count                                                                       88   \n",
       "\n",
       "                                                    Top 10% Non-White bias against Count  \n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                            295  \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                             51  \n",
       "(Equal Choice for Recourse, 0.3)                                                     391  \n",
       "(Equal Choice for Recourse, 0.7)                                                      60  \n",
       "Equal Effectiveness                                                                 1433  \n",
       "(Equal Effectiveness within Budget, 1.150241502...                                    24  \n",
       "(Equal Effectiveness within Budget, 10.07298072...                                  1251  \n",
       "(Equal Effectiveness within Budget, 21.0)                                           1423  \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                            294  \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                             51  \n",
       "Equal(Conditional) Mean Recourse                                                    1320  \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                             0  \n",
       "Total Count                                                                         6593  "
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "analysis_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "9186114c",
   "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.150241502415024)</th>\n",
       "      <th>(Equal Effectiveness within Budget, 10.072980729807298)</th>\n",
       "      <th>(Equal Effectiveness within Budget, 21.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>1.000</td>\n",
       "      <td>0.845</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.162</td>\n",
       "      <td>0.996</td>\n",
       "      <td>0.283</td>\n",
       "      <td>0.177</td>\n",
       "      <td>0.026</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0.448</td>\n",
       "      <td>0.194</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Cost of Effectiveness(Macro), 0.7)</th>\n",
       "      <td>0.700</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.900</td>\n",
       "      <td>0.829</td>\n",
       "      <td>0.147</td>\n",
       "      <td>0.973</td>\n",
       "      <td>0.315</td>\n",
       "      <td>0.169</td>\n",
       "      <td>0.698</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.421</td>\n",
       "      <td>0.120</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Choice for Recourse, 0.3)</th>\n",
       "      <td>0.419</td>\n",
       "      <td>1.000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.000</td>\n",
       "      <td>1.000</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.030</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.419</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0.783</td>\n",
       "      <td>0.073</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Choice for Recourse, 0.7)</th>\n",
       "      <td>1.000</td>\n",
       "      <td>0.095</td>\n",
       "      <td>0.909</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.644</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.003</td>\n",
       "      <td>0.328</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.041</td>\n",
       "      <td>0.011</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Equal Effectiveness</th>\n",
       "      <td>0.023</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.909</td>\n",
       "      <td>1.000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.010</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0.023</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Effectiveness within Budget, 1.150241502415024)</th>\n",
       "      <td>1.000</td>\n",
       "      <td>0.048</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.857</td>\n",
       "      <td>0.069</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.047</td>\n",
       "      <td>0.070</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.05</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.102</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Effectiveness within Budget, 10.072980729807298)</th>\n",
       "      <td>0.395</td>\n",
       "      <td>0.048</td>\n",
       "      <td>0.818</td>\n",
       "      <td>0.571</td>\n",
       "      <td>0.001</td>\n",
       "      <td>1.000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.001</td>\n",
       "      <td>0.395</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.612</td>\n",
       "      <td>0.002</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Effectiveness within Budget, 21.0)</th>\n",
       "      <td>0.023</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.909</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.000</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.010</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.023</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Cost of Effectiveness(Micro), 0.3)</th>\n",
       "      <td>0.023</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.845</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.162</td>\n",
       "      <td>0.996</td>\n",
       "      <td>0.284</td>\n",
       "      <td>0.177</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0.449</td>\n",
       "      <td>0.195</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Equal Cost of Effectiveness(Micro), 0.7)</th>\n",
       "      <td>0.700</td>\n",
       "      <td>0.048</td>\n",
       "      <td>0.900</td>\n",
       "      <td>0.829</td>\n",
       "      <td>0.147</td>\n",
       "      <td>0.973</td>\n",
       "      <td>0.315</td>\n",
       "      <td>0.169</td>\n",
       "      <td>0.698</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.421</td>\n",
       "      <td>0.120</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Equal(Conditional) Mean Recourse</th>\n",
       "      <td>0.979</td>\n",
       "      <td>1.000</td>\n",
       "      <td>1.000</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.628</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.778</td>\n",
       "      <td>0.633</td>\n",
       "      <td>0.979</td>\n",
       "      <td>1.00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.721</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>(Fair Effectiveness-Cost Trade-Off, value)</th>\n",
       "      <td>0.023</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.818</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.001</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.012</td>\n",
       "      <td>0.001</td>\n",
       "      <td>0.023</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0.003</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.700   \n",
       "(Equal Choice for Recourse, 0.3)                                                        0.419   \n",
       "(Equal Choice for Recourse, 0.7)                                                        1.000   \n",
       "Equal Effectiveness                                                                     0.023   \n",
       "(Equal Effectiveness within Budget, 1.150241502...                                      1.000   \n",
       "(Equal Effectiveness within Budget, 10.07298072...                                      0.395   \n",
       "(Equal Effectiveness within Budget, 21.0)                                               0.023   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                               0.023   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                               0.700   \n",
       "Equal(Conditional) Mean Recourse                                                        0.979   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                              0.023   \n",
       "\n",
       "                                                    (Equal Cost of Effectiveness(Macro), 0.7)  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                               1.000   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                                 NaN   \n",
       "(Equal Choice for Recourse, 0.3)                                                        1.000   \n",
       "(Equal Choice for Recourse, 0.7)                                                        0.095   \n",
       "Equal Effectiveness                                                                     1.000   \n",
       "(Equal Effectiveness within Budget, 1.150241502...                                      0.048   \n",
       "(Equal Effectiveness within Budget, 10.07298072...                                      0.048   \n",
       "(Equal Effectiveness within Budget, 21.0)                                               1.000   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                               1.000   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                               0.048   \n",
       "Equal(Conditional) Mean Recourse                                                        1.000   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                              1.000   \n",
       "\n",
       "                                                    (Equal Choice for Recourse, 0.3)  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                      0.845   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                      0.900   \n",
       "(Equal Choice for Recourse, 0.3)                                                 NaN   \n",
       "(Equal Choice for Recourse, 0.7)                                               0.909   \n",
       "Equal Effectiveness                                                            0.909   \n",
       "(Equal Effectiveness within Budget, 1.150241502...                             1.000   \n",
       "(Equal Effectiveness within Budget, 10.07298072...                             0.818   \n",
       "(Equal Effectiveness within Budget, 21.0)                                      0.909   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                      0.845   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                      0.900   \n",
       "Equal(Conditional) Mean Recourse                                               1.000   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                     0.818   \n",
       "\n",
       "                                                    (Equal Choice for Recourse, 0.7)  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                      1.000   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                      0.829   \n",
       "(Equal Choice for Recourse, 0.3)                                               1.000   \n",
       "(Equal Choice for Recourse, 0.7)                                                 NaN   \n",
       "Equal Effectiveness                                                            1.000   \n",
       "(Equal Effectiveness within Budget, 1.150241502...                             0.857   \n",
       "(Equal Effectiveness within Budget, 10.07298072...                             0.571   \n",
       "(Equal Effectiveness within Budget, 21.0)                                      1.000   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                      1.000   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                      0.829   \n",
       "Equal(Conditional) Mean Recourse                                               1.000   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                     1.000   \n",
       "\n",
       "                                                    Equal Effectiveness  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                         0.162   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                         0.147   \n",
       "(Equal Choice for Recourse, 0.3)                                  1.000   \n",
       "(Equal Choice for Recourse, 0.7)                                  0.644   \n",
       "Equal Effectiveness                                                 NaN   \n",
       "(Equal Effectiveness within Budget, 1.150241502...                0.069   \n",
       "(Equal Effectiveness within Budget, 10.07298072...                0.001   \n",
       "(Equal Effectiveness within Budget, 21.0)                         0.000   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                         0.162   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                         0.147   \n",
       "Equal(Conditional) Mean Recourse                                  0.628   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                        0.001   \n",
       "\n",
       "                                                    (Equal Effectiveness within Budget, 1.150241502415024)  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                                       0.996        \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                                       0.973        \n",
       "(Equal Choice for Recourse, 0.3)                                                                1.000        \n",
       "(Equal Choice for Recourse, 0.7)                                                                1.000        \n",
       "Equal Effectiveness                                                                             1.000        \n",
       "(Equal Effectiveness within Budget, 1.150241502...                                                NaN        \n",
       "(Equal Effectiveness within Budget, 10.07298072...                                              1.000        \n",
       "(Equal Effectiveness within Budget, 21.0)                                                       1.000        \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                                       0.996        \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                                       0.973        \n",
       "Equal(Conditional) Mean Recourse                                                                1.000        \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                                      1.000        \n",
       "\n",
       "                                                    (Equal Effectiveness within Budget, 10.072980729807298)  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                                       0.283         \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                                       0.315         \n",
       "(Equal Choice for Recourse, 0.3)                                                                0.030         \n",
       "(Equal Choice for Recourse, 0.7)                                                                0.003         \n",
       "Equal Effectiveness                                                                             0.010         \n",
       "(Equal Effectiveness within Budget, 1.150241502...                                              0.047         \n",
       "(Equal Effectiveness within Budget, 10.07298072...                                                NaN         \n",
       "(Equal Effectiveness within Budget, 21.0)                                                       0.010         \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                                       0.284         \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                                       0.315         \n",
       "Equal(Conditional) Mean Recourse                                                                0.778         \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                                      0.012         \n",
       "\n",
       "                                                    (Equal Effectiveness within Budget, 21.0)  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                               0.177   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                               0.169   \n",
       "(Equal Choice for Recourse, 0.3)                                                        1.000   \n",
       "(Equal Choice for Recourse, 0.7)                                                        0.328   \n",
       "Equal Effectiveness                                                                     0.000   \n",
       "(Equal Effectiveness within Budget, 1.150241502...                                      0.070   \n",
       "(Equal Effectiveness within Budget, 10.07298072...                                      0.001   \n",
       "(Equal Effectiveness within Budget, 21.0)                                                 NaN   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                               0.177   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                               0.169   \n",
       "Equal(Conditional) Mean Recourse                                                        0.633   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                              0.001   \n",
       "\n",
       "                                                    (Equal Cost of Effectiveness(Micro), 0.3)  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                               0.026   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                               0.698   \n",
       "(Equal Choice for Recourse, 0.3)                                                        0.419   \n",
       "(Equal Choice for Recourse, 0.7)                                                        1.000   \n",
       "Equal Effectiveness                                                                     0.023   \n",
       "(Equal Effectiveness within Budget, 1.150241502...                                      1.000   \n",
       "(Equal Effectiveness within Budget, 10.07298072...                                      0.395   \n",
       "(Equal Effectiveness within Budget, 21.0)                                               0.023   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                                 NaN   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                               0.698   \n",
       "Equal(Conditional) Mean Recourse                                                        0.979   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                              0.023   \n",
       "\n",
       "                                                    (Equal Cost of Effectiveness(Micro), 0.7)  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                                1.00   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                                0.05   \n",
       "(Equal Choice for Recourse, 0.3)                                                         1.00   \n",
       "(Equal Choice for Recourse, 0.7)                                                         0.10   \n",
       "Equal Effectiveness                                                                      1.00   \n",
       "(Equal Effectiveness within Budget, 1.150241502...                                       0.05   \n",
       "(Equal Effectiveness within Budget, 10.07298072...                                       0.05   \n",
       "(Equal Effectiveness within Budget, 21.0)                                                1.00   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                                1.00   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                                 NaN   \n",
       "Equal(Conditional) Mean Recourse                                                         1.00   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                               1.00   \n",
       "\n",
       "                                                    Equal(Conditional) Mean Recourse  \\\n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                      0.448   \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                      0.421   \n",
       "(Equal Choice for Recourse, 0.3)                                               0.783   \n",
       "(Equal Choice for Recourse, 0.7)                                               0.041   \n",
       "Equal Effectiveness                                                            0.000   \n",
       "(Equal Effectiveness within Budget, 1.150241502...                             1.000   \n",
       "(Equal Effectiveness within Budget, 10.07298072...                             0.612   \n",
       "(Equal Effectiveness within Budget, 21.0)                                      0.000   \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                      0.449   \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                      0.421   \n",
       "Equal(Conditional) Mean Recourse                                                 NaN   \n",
       "(Fair Effectiveness-Cost Trade-Off, value)                                     0.003   \n",
       "\n",
       "                                                    (Fair Effectiveness-Cost Trade-Off, value)  \n",
       "(Equal Cost of Effectiveness(Macro), 0.3)                                                0.194  \n",
       "(Equal Cost of Effectiveness(Macro), 0.7)                                                0.120  \n",
       "(Equal Choice for Recourse, 0.3)                                                         0.073  \n",
       "(Equal Choice for Recourse, 0.7)                                                         0.011  \n",
       "Equal Effectiveness                                                                      0.000  \n",
       "(Equal Effectiveness within Budget, 1.150241502...                                       0.102  \n",
       "(Equal Effectiveness within Budget, 10.07298072...                                       0.002  \n",
       "(Equal Effectiveness within Budget, 21.0)                                                0.000  \n",
       "(Equal Cost of Effectiveness(Micro), 0.3)                                                0.195  \n",
       "(Equal Cost of Effectiveness(Micro), 0.7)                                                0.120  \n",
       "Equal(Conditional) Mean Recourse                                                         0.721  \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
}
