{
 "cells": [
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "a4164f0d",
   "metadata": {},
   "source": [
    "## Import libraries"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "50536eb3",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "from pprint import pprint\n",
    "\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.metrics import classification_report, confusion_matrix, ConfusionMatrixDisplay\n",
    "\n",
    "import os\n",
    "import sys\n",
    "module_path = os.path.abspath(os.path.join('..', '..'))\n",
    "if module_path not in sys.path:\n",
    "    sys.path.append(module_path)\n",
    "import facts\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_KStest_cumulative,print_recourse_report_cumulative\n",
    "from facts.utils import load_rules_by_if,save_rules_by_if\n",
    "from facts.utils import load_rules_by_if,save_rules_by_if\n",
    "\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "c5f58534",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pathlib import Path\n",
    "\n",
    "computed_rules_file = Path(\"..\") / \"..\" / \"Pre-computed Results\" / \"IBM_AdCampaign\" / \"rulesAdCampaign_atomic.data\"\n",
    "computed_rules_with_cumulative_file = Path(\"..\") / \"..\" / \"Pre-computed Results\" / \"IBM_AdCampaign\" / \"rulesAdCampaign_cumulative.data\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "99fb977c",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "DATAFILE = '../../../ad_campaign_data.csv' # location of dataset\n",
    "random_state = None # change to something for exactly reproducible results\n",
    "random_seed = 131313\n",
    "\n",
    "# as selected in \"tutorial_bias_advertising\" notebook\n",
    "selected_features = ['religion','politics','gender', 'parents', 'ages', 'income', 'area', 'college_educated', 'homeowner']\n",
    "cate_features = ['religion','politics','gender', 'parents', 'ages', 'income', 'area', 'college_educated']\n",
    "num_features = ['homeowner']\n",
    "\n",
    "# if not specified, set to 1\n",
    "feature_weights = {\"gender\": 1, \"parents\": 1, \"age\": 1}\n",
    "\n",
    "target_name = \"true_conversion\"\n",
    "positive_label = 1\n",
    "negative_label = 0\n",
    "\n",
    "model_train_fraction = 0.7\n",
    "learning_class_weights = {0: 0.5, 1: 265}\n",
    "\n",
    "sensitive_attribute = \"gender\"\n",
    "sensitive_alias = {\"M\": \"Male\", \"F\": \"Female\", \"Unknown\": \"Unknown\"}"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "7f50c922",
   "metadata": {},
   "source": [
    "## Load Dataset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "7ec3f668",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>religion</th>\n",
       "      <th>politics</th>\n",
       "      <th>college_educated</th>\n",
       "      <th>parents</th>\n",
       "      <th>homeowner</th>\n",
       "      <th>gender</th>\n",
       "      <th>age</th>\n",
       "      <th>income</th>\n",
       "      <th>area</th>\n",
       "      <th>true_conversion</th>\n",
       "      <th>predicted_conversion</th>\n",
       "      <th>predicted_probability</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>55-64</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.001351</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Other</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>55-64</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Urban</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.002238</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>F</td>\n",
       "      <td>55-64</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.002704</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>F</td>\n",
       "      <td>55-64</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.001967</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>F</td>\n",
       "      <td>55-64</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Urban</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.001681</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  religion politics  college_educated  parents  homeowner   gender    age  \\\n",
       "0  Unknown  Unknown                 1        1          1  Unknown  55-64   \n",
       "1    Other  Unknown                 1        1          1  Unknown  55-64   \n",
       "2  Unknown  Unknown                 1        1          1        F  55-64   \n",
       "3  Unknown  Unknown                 1        1          1        F  55-64   \n",
       "4  Unknown  Unknown                 1        1          1        F  55-64   \n",
       "\n",
       "    income     area  true_conversion  predicted_conversion  \\\n",
       "0  Unknown  Unknown                0                     0   \n",
       "1  Unknown    Urban                0                     0   \n",
       "2  Unknown  Unknown                0                     0   \n",
       "3  Unknown  Unknown                0                     0   \n",
       "4  Unknown    Urban                0                     0   \n",
       "\n",
       "   predicted_probability  \n",
       "0               0.001351  \n",
       "1               0.002238  \n",
       "2               0.002704  \n",
       "3               0.001967  \n",
       "4               0.001681  "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ad_conversion_dataset = pd.read_csv(DATAFILE)\n",
    "ad_conversion_dataset.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "17d5220d",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "ad_conversion_dataset.gender = ad_conversion_dataset.gender.map(sensitive_alias)\n",
    "ad_conversion_dataset.rename(columns = {'age':'ages'}, inplace = True)\n"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "5f1b33fa-c6c9-4770-8123-0f69f918e265",
   "metadata": {},
   "source": [
    "# Preprocessing"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "8ee07f88",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>religion</th>\n",
       "      <th>politics</th>\n",
       "      <th>gender</th>\n",
       "      <th>parents</th>\n",
       "      <th>ages</th>\n",
       "      <th>income</th>\n",
       "      <th>area</th>\n",
       "      <th>college_educated</th>\n",
       "      <th>homeowner</th>\n",
       "      <th>true_conversion</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>1</td>\n",
       "      <td>55-64</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Other</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>1</td>\n",
       "      <td>55-64</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Urban</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Female</td>\n",
       "      <td>1</td>\n",
       "      <td>55-64</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Female</td>\n",
       "      <td>1</td>\n",
       "      <td>55-64</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Female</td>\n",
       "      <td>1</td>\n",
       "      <td>55-64</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Urban</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1443135</th>\n",
       "      <td>Other</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Female</td>\n",
       "      <td>1</td>\n",
       "      <td>25-34</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1443136</th>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Female</td>\n",
       "      <td>1</td>\n",
       "      <td>55-64</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1443137</th>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>1</td>\n",
       "      <td>55-64</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1443138</th>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Female</td>\n",
       "      <td>1</td>\n",
       "      <td>55-64</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1443139</th>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Female</td>\n",
       "      <td>1</td>\n",
       "      <td>55-64</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>Unknown</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1443140 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        religion politics   gender  parents   ages   income     area  \\\n",
       "0        Unknown  Unknown  Unknown        1  55-64  Unknown  Unknown   \n",
       "1          Other  Unknown  Unknown        1  55-64  Unknown    Urban   \n",
       "2        Unknown  Unknown   Female        1  55-64  Unknown  Unknown   \n",
       "3        Unknown  Unknown   Female        1  55-64  Unknown  Unknown   \n",
       "4        Unknown  Unknown   Female        1  55-64  Unknown    Urban   \n",
       "...          ...      ...      ...      ...    ...      ...      ...   \n",
       "1443135    Other  Unknown   Female        1  25-34  Unknown  Unknown   \n",
       "1443136  Unknown  Unknown   Female        1  55-64  Unknown  Unknown   \n",
       "1443137  Unknown  Unknown  Unknown        1  55-64  Unknown  Unknown   \n",
       "1443138  Unknown  Unknown   Female        1  55-64  Unknown  Unknown   \n",
       "1443139  Unknown  Unknown   Female        1  55-64  Unknown  Unknown   \n",
       "\n",
       "         college_educated  homeowner  true_conversion  \n",
       "0                       1          1                0  \n",
       "1                       1          1                0  \n",
       "2                       1          1                0  \n",
       "3                       1          1                0  \n",
       "4                       1          1                0  \n",
       "...                   ...        ...              ...  \n",
       "1443135                 1          1                0  \n",
       "1443136                 1          0                0  \n",
       "1443137                 1          1                0  \n",
       "1443138                 1          1                0  \n",
       "1443139                 1          1                0  \n",
       "\n",
       "[1443140 rows x 10 columns]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "## keep only the columns in selected_features, plus the label column\n",
    "ad_conversion_dataset = ad_conversion_dataset[selected_features + [target_name]]\n",
    "ad_conversion_dataset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "e2d5162d",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "## train-test split\n",
    "\n",
    "X = ad_conversion_dataset.drop(target_name, axis=1)\n",
    "y = ad_conversion_dataset[target_name]\n",
    "\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y, train_size=model_train_fraction, random_state=random_seed, stratify=y)\n",
    "\n",
    "X_train = X_train.reset_index(drop=True)\n",
    "X_test = X_test.reset_index(drop=True)\n",
    "y_train = y_train.reset_index(drop=True)\n",
    "y_test = y_test.reset_index(drop=True)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "17c32fa1-337a-45e0-ae5c-914575a2cbb6",
   "metadata": {},
   "source": [
    "# Model training"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "d613bdf8",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Wall time: 32.2 s\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "c:\\Users\\Nikolas Theol\\AppData\\Local\\Programs\\Python\\Python38\\lib\\site-packages\\sklearn\\linear_model\\_logistic.py:814: ConvergenceWarning: lbfgs failed to converge (status=1):\n",
      "STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.\n",
      "\n",
      "Increase the number of iterations (max_iter) or scale the data as shown in:\n",
      "    https://scikit-learn.org/stable/modules/preprocessing.html\n",
      "Please also refer to the documentation for alternative solver options:\n",
      "    https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression\n",
      "  n_iter_i = _check_optimize_result(\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1.,\n",
       "       0., 0., 0., 1., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0.,\n",
       "       0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0.,\n",
       "       0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0.,\n",
       "       0., 0., 1., 0., 0., 1., 0., 0., 1., 0., 0., 0., 0., 0., 0.])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%%time\n",
    "\n",
    "model = customLogisticRegression(class_weight=learning_class_weights)\n",
    "model.fit(X_train, y_train, cate_columns=cate_features, target_column=target_name)\n",
    "model.predict(X_test.iloc[:100, :])"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "13d583ac",
   "metadata": {},
   "source": [
    "# Testing the model\n",
    "\n",
    "We check if the model is satisfactory."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "2fbd7b2e",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "              precision    recall  f1-score   support\n",
      "\n",
      "           0       1.00      0.89      0.94    432231\n",
      "           1       0.00      0.11      0.00       712\n",
      "\n",
      "    accuracy                           0.89    432943\n",
      "   macro avg       0.50      0.50      0.47    432943\n",
      "weighted avg       1.00      0.89      0.94    432943\n",
      "\n"
     ]
    }
   ],
   "source": [
    "positive_label = 1\n",
    "negative_label = 0\n",
    "preds_Xtest = model.predict(X_test)\n",
    "print(classification_report(y_test.map({negative_label: 0, positive_label: 1}), preds_Xtest))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "a82b48f8-408b-43a0-99fc-c21ff8a63718",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 26364 characters]",
      "text/plain": [
       "<Figure size 640x480 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "conf_matrix = confusion_matrix(y_test, preds_Xtest)\n",
    "cm_disp = ConfusionMatrixDisplay(confusion_matrix=conf_matrix)\n",
    "cm_disp.plot()\n",
    "plt.show()"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "11452631",
   "metadata": {},
   "source": [
    "# Macro Viewpoint"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "66bafa9b-95db-49c6-b116-9ebb65c13fc8",
   "metadata": {},
   "source": [
    "# Find all valid if-thens with all respective coverages and correctness, for all subgroups.\n",
    "\n",
    "**Caution!** This step takes time. Uncomment the following block if you wish to run."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "297d9256",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "# #Uncomment if you want to find new rules with different support\n",
    "\n",
    "# ifthens_coverage_correctness = valid_ifthens_with_coverage_correctness(\n",
    "#     X_test,\n",
    "#     model=model,\n",
    "#     sensitive_attribute='gender',\n",
    "#     freqitem_minsupp = 0.01,\n",
    "#     missing_subgroup_val=\"Unknown\",\n",
    "#     drop_infeasible = True,\n",
    "#     drop_above = False\n",
    "# )\n",
    "\n",
    "# print(f\"Number of if-thens: {len(ifthens_coverage_correctness)}\")\n",
    "# rules_by_if = rules2rulesbyif(ifthens_coverage_correctness)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "d16e7dca",
   "metadata": {},
   "outputs": [],
   "source": [
    "from facts.utils import load_rules_by_if, save_rules_by_if\n",
    "\n",
    "## Use this for loading rules from disk\n",
    "rules_by_if = load_rules_by_if(computed_rules_file)\n",
    "\n",
    "## Use this for saving rules on disk\n",
    "#save_rules_by_if(precomputed_rules_file, rules_by_if)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "8a13da8a-e2a3-481f-9b1b-bc1803f4eccf",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Urban, college_educated = 1, homeowner = 1, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m15.09%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m100.00%\u001b[39m.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m13.68%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "If \u001b[1mages = 55-64, area = Urban, college_educated = 1, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m15.09%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m100.00%\u001b[39m.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m13.68%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "If \u001b[1mages = 55-64, area = Rural, college_educated = 1, homeowner = 1, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m3.23%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m100.00%\u001b[39m.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m2.86%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "If \u001b[1mages = 55-64, area = Rural, college_educated = 1, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m3.23%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m100.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m100.00%\u001b[39m.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m2.86%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "If \u001b[1mages = 55-64, area = Rural, college_educated = 1, homeowner = 1, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m3.25%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m99.60%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m99.60%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m99.60%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m99.60%\u001b[39m.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m2.87%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "If \u001b[1mages = 55-64, area = Rural, college_educated = 1, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m3.25%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m99.60%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m99.60%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m99.60%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m99.60%\u001b[39m.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m2.87%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "If \u001b[1mages = 55-64, area = Rural, college_educated = 1, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m3.25%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m99.52%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m99.52%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m99.68%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m99.68%\u001b[39m.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m2.88%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "If \u001b[1mages = 55-64, area = Rural, college_educated = 1, homeowner = 1, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m3.25%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m99.52%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m99.52%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m99.68%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m99.68%\u001b[39m.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m2.88%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "If \u001b[1mages = 55-64, area = Urban, college_educated = 1, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m15.18%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m99.45%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m99.45%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m99.84%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m99.84%\u001b[39m.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m13.75%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "If \u001b[1mages = 55-64, area = Urban, college_educated = 1, homeowner = 1, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m15.18%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m99.45%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m99.45%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m99.84%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m99.84%\u001b[39m.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m13.75%\u001b[39m covered\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with correctness \u001b[32m0.00%\u001b[39m.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "K = 10\n",
    "\n",
    "# keep K ifs with maximum coverage on Females\n",
    "# TODO: the below is currently dataset dependent\n",
    "# rules_by_if_filtered = sorted(rules_by_if.items(), key=lambda e: e[1][\"F\"][0][1], reverse=True)[:K]\n",
    "\n",
    "# keep K ifs with maximum absolute difference in correctness between Males and Females.\n",
    "# TODO: the below is currently dataset dependent\n",
    "rules_by_if_filtered = sorted(rules_by_if.items(), key=lambda e: abs(e[1][\"Male\"][1][0][1]-e[1][\"Female\"][1][0][1]), reverse=True)[:K]\n",
    "\n",
    "rules_by_if_filtered = dict(rules_by_if_filtered)\n",
    "\n",
    "print(recourse_report_reverse(rules_by_if_filtered))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "49e6a012",
   "metadata": {},
   "outputs": [],
   "source": [
    "num_features = []\n",
    "cate_features = ['religion','politics', 'parents', 'ages', 'income', 'area', 'college_educated', 'homeowner']\n",
    "ord_features = []\n",
    "\n",
    "feature_weights = {'religion':5,'politics':2, 'parents':3, 'ages':10, 'income':3, 'area':2, 'college_educated':3, 'homeowner':1}\n",
    "features_with_binary_cost = cate_features\n",
    "features_with_proportional_cost = num_features\n",
    "\n",
    "\n",
    "comparators = facts.feature_change_builder(\n",
    "    X_test,\n",
    "    num_cols=features_with_proportional_cost,\n",
    "    cate_cols=features_with_binary_cost,\n",
    "    ord_cols=ord_features,\n",
    "    feature_weights=feature_weights,\n",
    "    num_normalization=False,\n",
    ")\n",
    "params = ParameterProxy(featureChanges=comparators)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "65cc1d1c",
   "metadata": {},
   "source": [
    "## Macro Viewpoint"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "b68eb89f-39e1-4143-93aa-5367b5356b40",
   "metadata": {},
   "source": [
    "### Equal Cost of Effectiveness (Macro)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "df56bb6f-2359-4108-8b03-326caf4f37a4",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mhomeowner = 1, parents = 0\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m5.74%\u001b[39m covered out of 83109\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m51.94%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m5.25%\u001b[39m covered out of 161494\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m96.52%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m4.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 3.\u001b[39m\n",
      "If \u001b[1mcollege_educated = 1, homeowner = 1, parents = 0\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m5.41%\u001b[39m covered out of 83109\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m52.13%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m4.97%\u001b[39m covered out of 161494\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m96.60%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m4.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 3.\u001b[39m\n"
     ]
    }
   ],
   "source": [
    "top_rules, subgroup_costs = facts.select_rules_subset(\n",
    "    rules_by_if,\n",
    "    metric=\"min-above-thr\",\n",
    "    sort_strategy=\"generic-sorting-ignore-exists-subgroup-empty\",\n",
    "    top_count=50,\n",
    "    filter_sequence = [\n",
    "        \"remove-contained\",\n",
    "        \"remove-below-thr\",        \n",
    "        \"remove-fair-rules\",\n",
    "        \"keep-only-min-change\"\n",
    "    ],\n",
    "    cor_threshold=0.5,\n",
    "    secondary_sorting_objectives=[\n",
    "        # \"min-group-cost\",\n",
    "        \"max-group-corr\"\n",
    "    ],\n",
    "    params=params\n",
    ")\n",
    "\n",
    "# cum_cors = facts.cum_corr_costs_all_minimal(top_rules, X_test, model, sensitive_attribute=\"sex\", params=params)\n",
    "cum_cors = dict()\n",
    "\n",
    "pop_sizes = {sg: ((X_test[\"gender\"] == sg) & (preds_Xtest == 0)).sum() for sg in X_test[\"gender\"].unique()}\n",
    "print_recourse_report(\n",
    "    top_rules,\n",
    "    population_sizes=pop_sizes,\n",
    "    subgroup_costs=subgroup_costs,\n",
    "    aggregate_cors_costs=cum_cors,\n",
    "    show_subgroup_costs=True\n",
    ")"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "1e6b8414-7b1a-4bec-92cb-1e8eae446e34",
   "metadata": {},
   "source": [
    "### Equal Choice for Recourse"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "0fbbdba8-cec7-420e-812b-925948519167",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m53.09%\u001b[39m covered out of 83109\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m85.47%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m85.47%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.52%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.52%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-4.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m48.86%\u001b[39m covered out of 161494\n",
      "\t\t\u001b[31mNo recourses for this subgroup!\u001b[39m\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 4.\u001b[39m\n",
      "If \u001b[1marea = Unknown, homeowner = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m51.81%\u001b[39m covered out of 83109\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m90.59%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.24%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.27%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m85.15%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m85.15%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.29%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.29%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-7.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m47.69%\u001b[39m covered out of 161494\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m90.10%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.61%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.61%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-3.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 4.\u001b[39m\n",
      "If \u001b[1marea = Unknown, income = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m50.65%\u001b[39m covered out of 83109\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m86.44%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m86.44%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.62%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.62%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-4.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m46.53%\u001b[39m covered out of 161494\n",
      "\t\t\u001b[31mNo recourses for this subgroup!\u001b[39m\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 4.\u001b[39m\n",
      "If \u001b[1marea = Unknown, college_educated = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m50.09%\u001b[39m covered out of 83109\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.18%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.18%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.52%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.52%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-4.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m46.06%\u001b[39m covered out of 161494\n",
      "\t\t\u001b[31mNo recourses for this subgroup!\u001b[39m\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 4.\u001b[39m\n",
      "If \u001b[1marea = Unknown, homeowner = 1, income = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m49.97%\u001b[39m covered out of 83109\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m91.73%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.38%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.41%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m86.29%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m86.29%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m99.56%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.52%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.52%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.57%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.57%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-10.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m45.94%\u001b[39m covered out of 161494\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m91.37%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.79%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.79%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m96.58%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.57%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.57%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-6.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 4.\u001b[39m\n",
      "If \u001b[1marea = Unknown, college_educated = 1, homeowner = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m48.88%\u001b[39m covered out of 83109\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m90.58%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.38%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.41%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m89.96%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m89.96%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m, \u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m90.35%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.29%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.29%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-8.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m44.97%\u001b[39m covered out of 161494\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m90.11%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.62%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.62%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m, \u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m89.97%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-4.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 4.\u001b[39m\n",
      "If \u001b[1marea = Unknown, college_educated = 1, income = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m47.76%\u001b[39m covered out of 83109\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.40%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.40%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.65%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.65%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-4.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m43.88%\u001b[39m covered out of 161494\n",
      "\t\t\u001b[31mNo recourses for this subgroup!\u001b[39m\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 4.\u001b[39m\n",
      "If \u001b[1marea = Unknown, college_educated = 1, homeowner = 1, income = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m47.13%\u001b[39m covered out of 83109\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m91.74%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.53%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.56%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.31%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.31%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m99.56%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m, \u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m91.54%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.54%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.54%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.56%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.56%\u001b[39m.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m-11.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m43.32%\u001b[39m covered out of 161494\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m91.36%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.78%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.78%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m96.85%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m, \u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m91.34%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.56%\u001b[39m.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.56%\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 Female due to Equal Effectiveness. Unfairness score = 4.\u001b[39m\n"
     ]
    }
   ],
   "source": [
    "top_rules, subgroup_costs = facts.select_rules_subset(\n",
    "    rules_by_if,\n",
    "    metric=\"num-above-thr\",\n",
    "    sort_strategy=\"generic-sorting-ignore-forall-subgroups-empty\",\n",
    "    top_count=50,\n",
    "    filter_sequence = [\n",
    "        \"remove-contained\",\n",
    "        \"remove-below-thr\",\n",
    "        # \"remove-fair-rules\"\n",
    "    ],\n",
    "    cor_threshold=0.2,\n",
    "    secondary_sorting_objectives=[\n",
    "        # \"min-group-cost\",\n",
    "        # \"max-group-corr\"\n",
    "    ],\n",
    "    params=params\n",
    ")\n",
    "\n",
    "# cum_cors = facts.cum_corr_costs_all_minimal(top_rules, X_test, model, sensitive_attribute=\"sex\", params=params)\n",
    "cum_cors = dict()\n",
    "\n",
    "pop_sizes = {sg: ((X_test[\"gender\"] == sg) & (preds_Xtest == 0)).sum() for sg in X_test[\"gender\"].unique()}\n",
    "print_recourse_report(\n",
    "    top_rules,\n",
    "    population_sizes=pop_sizes,\n",
    "    subgroup_costs=subgroup_costs,\n",
    "    aggregate_cors_costs=cum_cors,\n",
    "    show_subgroup_costs=True\n",
    ")"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "c2b16448",
   "metadata": {},
   "source": [
    "## Micro viewpoint"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "ebe41ab5",
   "metadata": {},
   "source": [
    "We start by computing the cumulative effectiveness of the actions for each subgroup and each value of the protected attribute.\n",
    "\n",
    "**Caution!** This step takes time. Uncomment the following block if you wish to run."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "ebe9eda4",
   "metadata": {},
   "outputs": [],
   "source": [
    "# rules_with_cumulative = facts.cum_corr_costs_all(rules_by_if, X_test, model, sensitive_attribute=\"gender\", params=params)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "0373f011",
   "metadata": {},
   "outputs": [],
   "source": [
    "## Use this for loading rules from disk\n",
    "rules_with_cumulative = load_rules_by_if(computed_rules_with_cumulative_file)\n",
    "\n",
    "## Use this for saving rules on disk\n",
    "# save_rules_by_if(precomputed_rules_with_cumulative_file, rules_with_cumulative)\n",
    "\n",
    "# facts.update_costs_cumulative(rules_with_cumulative, params)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "76529bde",
   "metadata": {},
   "source": [
    "### Equal (Conditional) Mean Recourse"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "40f1eabd",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, income = Unknown, parents = 0, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m2.77%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m14.23%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m14.23%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m14.23%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m14.23%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m14.23%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m9.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m2.52%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m12.62%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m3.00\u001b[39m\n",
      "\t\u001b[35mBias against Male due to Equal Effectiveness. Unfairness score = 6.004.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23316 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, parents = 0, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m2.95%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m14.28%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m14.28%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m14.28%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m14.28%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.78%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.78%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m9.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m2.67%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m12.69%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m12.69%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m12.69%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m12.69%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m12.69%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m12.69%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m12.69%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m12.69%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m12.69%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m12.69%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m3.00\u001b[39m\n",
      "\t\u001b[35mBias against Male due to Equal Effectiveness. Unfairness score = 6.0.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23748 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, parents = 0, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m3.07%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m13.70%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m16.41%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m16.41%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m16.41%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m93.64%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m93.64%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.64%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.64%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m8.89\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m2.79%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m12.16%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m13.30%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m13.30%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m13.30%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m15.19%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m15.19%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m15.19%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m15.19%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m4.02\u001b[39m\n",
      "\t\u001b[35mBias against Male due to Equal Effectiveness. Unfairness score = 4.868.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23628 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, parents = 0, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m2.90%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m13.54%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m16.32%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m16.32%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m16.32%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m16.32%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.03%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.03%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.48%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.48%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m8.90\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m2.65%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m12.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m13.10%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m13.10%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m13.10%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m13.10%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m15.05%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m15.05%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m15.07%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m15.07%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m4.06\u001b[39m\n",
      "\t\u001b[35mBias against Male due to Equal Effectiveness. Unfairness score = 4.834.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23668 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "top_rules, subgroup_costs = facts.select_rules_subset_cumulative(\n",
    "    rules_with_cumulative,\n",
    "    metric=\"fairness-of-mean-recourse-conditional\",\n",
    "    sort_strategy=\"generic-sorting-ignore-exists-subgroup-empty\",\n",
    "    top_count=10,\n",
    "    filter_sequence = [\n",
    "        \"remove-contained\",\n",
    "        # \"remove-fair-rules\"\n",
    "    ],\n",
    "    params=params\n",
    ")\n",
    "\n",
    "pop_sizes = {sg: ((X_test[\"gender\"] == sg) & (preds_Xtest == 0)).sum() for sg in X_test[\"gender\"].unique()}\n",
    "print_recourse_report_cumulative(\n",
    "    top_rules,\n",
    "    population_sizes=pop_sizes,\n",
    "    subgroup_costs=subgroup_costs,\n",
    "    show_subgroup_costs=True,\n",
    "    show_then_costs=True,\n",
    "    show_cumulative_plots=True,\n",
    "    correctness_metric=False\n",
    ")"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "02b4c1d0",
   "metadata": {},
   "source": [
    "### Equal Effectiveness"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "ae53fe09",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m43.91%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.30%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.30%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m40.49%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23304 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m41.41%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m38.17%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22716 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Urban, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m16.00%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.35%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.35%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m14.50%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24040 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, parents = 1, politics = Unknown, religion = Christianity\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m10.31%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m94.57%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m9.57%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23200 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, parents = 1, politics = Unknown, religion = Other\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m9.66%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m94.50%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m8.67%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23200 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Rural, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m3.42%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m3.03%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23888 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 0, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m2.50%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m2.32%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24024 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 0, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m2.60%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.10%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.10%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.20%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.20%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.20%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.20%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.99\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m2.44%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.30%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.30%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.30%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.30%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.03\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 0.959.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23348 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m46.07%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.26%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.26%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.26%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m93.14%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m93.14%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.58%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.58%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.99\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m42.50%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.12%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.12%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.12%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.03\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 0.953.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22960 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m43.47%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.20%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.20%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.54%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.54%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.54%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.54%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.99\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m40.06%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.03\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 0.953.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23700 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "top_rules, subgroup_costs = facts.select_rules_subset_cumulative(\n",
    "    rules_with_cumulative,\n",
    "    metric=\"total-correctness\",\n",
    "    sort_strategy=\"generic-sorting-ignore-forall-subgroups-empty\",\n",
    "    top_count=50,\n",
    "    filter_sequence = [\n",
    "        \"remove-contained\",\n",
    "        # \"remove-fair-rules\",\n",
    "        # \"keep-only-min-change\"\n",
    "    ],\n",
    "    params=params\n",
    ")\n",
    "\n",
    "pop_sizes = {sg: ((X_test[\"gender\"] == sg) & (preds_Xtest == 0)).sum() for sg in X_test[\"gender\"].unique()}\n",
    "print_recourse_report_cumulative(\n",
    "    top_rules,\n",
    "    population_sizes=pop_sizes,\n",
    "    subgroup_costs=subgroup_costs,\n",
    "    show_subgroup_costs=True,\n",
    "    show_then_costs=True,\n",
    "    show_cumulative_plots=True,\n",
    "    correctness_metric= True\n",
    ")"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "d5ebfcc6",
   "metadata": {},
   "source": [
    "### Equal Cost of Effectiveness (micro)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "57f270d5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m63.65%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m30.52%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m3.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m58.32%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m4.94%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m4.94%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m4.94%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m30.10%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m8.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 5.0.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23716 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, college_educated = 1, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m60.03%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m30.54%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m3.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m54.99%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m5.24%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m5.24%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m5.24%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m30.13%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m8.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 5.0.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25068 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mincome = Unknown, parents = 0, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m4.34%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m9.91%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m36.46%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m6.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m3.93%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m9.04%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m14.14%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m14.14%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m14.14%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m35.51%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m11.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 5.0.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25160 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mcollege_educated = 1, income = Unknown, parents = 0, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m4.07%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m9.85%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m9.85%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m36.39%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m6.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m3.72%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m8.95%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m8.95%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m14.35%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m14.35%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m14.35%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mparents = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m35.73%\u001b[39m and counterfactual cost = 11.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m11.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 5.0.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25552 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Urban, college_educated = 1, homeowner = 1, parents = 0\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m1.35%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m30.79%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m3.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m1.21%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m0.10%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mhomeowner = 0\u001b[39m, \u001b[31mparents = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m99.74%\u001b[39m and counterfactual cost = 4.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m4.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22512 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Urban, college_educated = 0, homeowner = 1, parents = 1\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m1.34%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m30.87%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m3.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m1.22%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mhomeowner = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m99.80%\u001b[39m and counterfactual cost = 4.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m4.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22484 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "top_rules, subgroup_costs = facts.select_rules_subset_cumulative(\n",
    "    rules_with_cumulative,\n",
    "    metric=\"min-above-corr\",\n",
    "    sort_strategy=\"generic-sorting-ignore-exists-subgroup-empty\",\n",
    "    top_count=50,\n",
    "    filter_sequence = [\n",
    "        \"remove-contained\",\n",
    "        \"remove-fair-rules\",\n",
    "        \"keep-cheap-rules-above-thr-cor\",\n",
    "        # \"keep-only-min-change\",\n",
    "        \n",
    "    ],\n",
    "    cor_threshold = 0.3,\n",
    "    params=params\n",
    ")\n",
    "\n",
    "pop_sizes = {sg: ((X_test[\"gender\"] == sg) & (preds_Xtest == 0)).sum() for sg in X_test[\"gender\"].unique()}\n",
    "print_recourse_report_cumulative(\n",
    "    top_rules,\n",
    "    population_sizes=pop_sizes,\n",
    "    subgroup_costs=subgroup_costs,\n",
    "    show_subgroup_costs=True,\n",
    "    show_then_costs=True,\n",
    "    show_cumulative_plots=True,\n",
    "    correctness_metric=False\n",
    ")"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "b1acc589",
   "metadata": {},
   "source": [
    "### Equal Effectiveness Within Budget"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "71b5f46c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m43.91%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.30%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.30%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m40.49%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23304 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m41.41%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m38.17%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22716 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Urban, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m16.00%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.35%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.35%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m14.50%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24040 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, parents = 1, politics = Unknown, religion = Christianity\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m10.31%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m94.57%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m9.57%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23200 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, parents = 1, politics = Unknown, religion = Other\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m9.66%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m94.50%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m8.67%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23200 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Rural, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m3.42%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m3.03%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23888 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 0, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m2.50%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m1.00\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m2.32%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 6.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.00\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 1.0.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23328 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 0, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m2.60%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.10%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.10%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.20%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.20%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.20%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.20%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.99\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m2.44%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.30%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.30%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.30%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mcollege_educated = 1\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.30%\u001b[39m and counterfactual cost = 10.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.03\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 0.959.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23348 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m46.07%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.26%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.26%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.26%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m93.14%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m93.14%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.58%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.58%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.99\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m42.50%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.12%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.12%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.12%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.03\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 0.953.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22960 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m43.47%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.20%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.20%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.54%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.54%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.54%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.54%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.99\u001b[39m\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m40.06%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\t\u001b[1mAggregate cost\u001b[0m of the above recourses = \u001b[35m0.03\u001b[39m\n",
      "\t\u001b[35mBias against Female due to Equal Effectiveness. Unfairness score = 0.953.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23700 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "top_rules, subgroup_costs = facts.select_rules_subset_cumulative(\n",
    "    rules_with_cumulative,\n",
    "    metric=\"max-upto-cost\",\n",
    "    sort_strategy=\"generic-sorting-ignore-exists-subgroup-empty\",\n",
    "    top_count=50,\n",
    "    filter_sequence = [\n",
    "        \"remove-contained\",\n",
    "        \"remove-fair-rules\",\n",
    "        \"remove-above-thr-cost\"\n",
    "        #\"remove-below-thr\",\n",
    "        #\"keep-only-min-change\",\n",
    "        \n",
    "    ],\n",
    "    cost_threshold = 10,\n",
    "    params=params\n",
    ")\n",
    "\n",
    "pop_sizes = {sg: ((X_test[\"gender\"] == sg) & (preds_Xtest == 0)).sum() for sg in X_test[\"gender\"].unique()}\n",
    "print_recourse_report_cumulative(\n",
    "    top_rules,\n",
    "    population_sizes=pop_sizes,\n",
    "    subgroup_costs=subgroup_costs,\n",
    "    show_subgroup_costs=True,\n",
    "    show_then_costs=True,\n",
    "    show_cumulative_plots=True,\n",
    "    correctness_metric = True\n",
    ")"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "e037a524",
   "metadata": {},
   "source": [
    "### Fair Effectiveness-Cost Trade-Off"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "7a3a3004",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m43.91%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.30%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.30%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m40.49%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 153.42.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23304 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m44.12%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m93.88%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m93.88%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.80%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.80%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.80%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.80%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m40.70%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 153.41.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23340 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m46.07%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.26%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.26%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.26%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m93.14%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m93.14%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.58%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.58%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m42.50%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.12%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.12%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.12%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 149.81.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22960 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m46.29%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.24%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.24%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.24%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m92.73%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m92.73%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.38%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.38%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m42.73%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.16%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.16%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.16%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.29%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.29%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.29%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.29%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 149.8.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22964 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Unknown, college_educated = 1, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m44.59%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.96%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.96%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.98%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.98%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.98%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.98%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m40.96%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.42%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.42%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.84%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.84%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.84%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.84%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 149.14.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23376 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m41.60%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.56%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.56%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.82%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.82%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.82%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.82%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m38.37%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.05%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 148.99.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22780 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m41.41%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m38.17%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 148.97.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22716 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Unknown, college_educated = 1, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m44.79%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.56%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.56%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.82%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.82%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.82%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.82%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m41.18%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.04%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.04%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.04%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.46%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.46%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.87%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.87%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.87%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.87%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 148.8.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23388 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m46.86%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.90%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.90%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.90%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m89.26%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m89.26%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.61%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.61%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.61%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.61%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m43.16%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.74%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.74%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.74%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.78%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.78%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.78%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.78%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.78%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.78%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 148.67.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22800 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, income = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m47.08%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.89%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.89%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.89%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m88.86%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m88.86%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.41%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.41%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.41%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.41%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m43.39%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.77%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.77%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.77%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.83%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.83%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.83%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.83%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.83%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.83%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 148.65.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22820 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Unknown, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m47.48%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.28%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.28%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.81%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.81%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.81%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.81%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m43.67%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.04%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.04%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.04%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.47%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.47%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.68%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.77%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.77%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.77%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 148.5.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23628 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Unknown, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m47.27%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.44%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.67%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.67%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.99%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.99%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.99%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.99%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m43.44%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.42%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.42%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.65%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.75%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.75%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.75%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 148.48.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23644 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Unknown, college_educated = 1, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m46.77%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.54%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m3.54%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.54%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.54%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m95.59%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m95.59%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m95.61%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m95.61%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m43.01%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.59%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m1.59%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.59%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.59%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.58%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.59%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m6.85%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m6.85%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 145.6.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23116 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m43.67%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.26%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m3.26%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.26%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.26%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.11%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.11%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.36%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.36%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m40.27%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.14%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m1.14%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.14%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.14%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.28%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.28%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.29%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.29%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 145.45.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22848 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m43.47%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.20%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.20%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.54%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.54%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m98.54%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m98.54%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m40.06%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.25%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 145.44.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23700 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m49.14%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.91%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.91%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.91%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m88.24%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m88.24%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m93.44%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m93.44%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m45.29%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.80%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.80%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.80%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.80%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.80%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.87%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.87%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 145.36.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22540 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m49.38%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.89%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.89%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.89%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m87.84%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m87.84%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m93.24%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m93.24%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m45.54%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.83%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.83%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.83%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.83%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.83%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.91%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.91%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 145.34.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22572 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Unknown, college_educated = 1, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m46.98%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.53%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m3.53%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.53%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.53%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m95.19%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m95.19%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m95.44%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m95.44%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m43.24%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.62%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m1.62%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.62%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.62%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.62%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.62%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m6.87%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m6.87%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 145.27.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23248 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m49.79%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.52%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.52%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.52%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.19%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.19%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m95.46%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m95.46%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m45.86%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.60%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.60%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.60%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.62%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.62%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m6.68%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m6.77%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 144.99.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23444 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m49.56%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.53%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.53%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.53%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.56%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.56%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m95.63%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m95.63%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m45.62%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.57%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.57%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.57%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.58%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.59%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m6.66%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m6.75%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 144.97.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23380 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Unknown, college_educated = 1, income = Unknown, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m47.54%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m1.24%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.24%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.24%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.80%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.80%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.82%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.82%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.82%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.82%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m43.64%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.76%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.76%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.76%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.16%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.16%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m4.37%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m4.37%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m4.37%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m4.37%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 144.57.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22940 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, income = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m44.39%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.89%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.89%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.89%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.20%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.20%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.44%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.44%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.44%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.44%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m40.90%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.82%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.82%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.82%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.82%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.82%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.82%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.82%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.82%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.82%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 144.38.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22620 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, income = Unknown, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m44.18%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.89%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.89%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.89%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.63%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.63%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.63%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.63%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.63%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.63%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m40.68%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.78%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.78%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.78%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.78%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.78%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.78%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.78%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.78%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.78%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 144.38.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22588 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Unknown, college_educated = 1, income = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m47.76%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m1.24%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.24%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.24%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.40%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.40%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.65%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.65%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.65%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.65%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m43.88%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.80%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.80%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.80%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.19%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.19%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m4.39%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m4.39%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m4.39%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m4.39%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 144.23.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22980 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Unknown, income = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m50.65%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m1.25%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.25%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.25%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m86.44%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m86.44%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.62%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.62%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.62%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.62%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m46.53%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.76%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.76%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.76%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.20%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.20%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m4.21%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m4.30%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m4.30%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m4.30%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 143.92.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23064 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Unknown, income = Unknown, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m50.41%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m1.25%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.25%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.25%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m86.82%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m86.82%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.80%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.80%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m91.80%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m91.80%\u001b[39m and counterfactual cost = 8.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m46.29%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m\u001b[0m with effectiveness \u001b[32m0.72%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.72%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.72%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.16%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.16%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m4.19%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m4.28%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m4.28%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\tMake \u001b[1m\u001b[31mincome = <100K\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m4.28%\u001b[39m and counterfactual cost = 8.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 143.91.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23024 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Unknown, college_educated = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m49.86%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m4.12%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m4.12%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m4.12%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m4.12%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.56%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.56%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.68%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.68%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m45.81%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m2.22%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m2.22%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m2.22%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m2.22%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m4.10%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m4.10%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m7.22%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m7.22%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 141.26.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22612 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m46.35%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.92%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m3.92%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.92%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.92%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m93.32%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m93.32%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m93.43%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m93.43%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m42.69%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.78%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m1.78%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.78%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.78%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.79%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.79%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.86%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.86%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 141.15.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22400 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Unknown, college_educated = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m46.57%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m3.90%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m3.90%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.90%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.90%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m92.90%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m92.90%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m93.24%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m93.24%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m42.92%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m1.81%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m1.81%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m1.81%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m1.81%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.82%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.82%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.89%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.89%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 141.15.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22452 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Unknown, college_educated = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m50.09%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m4.11%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m4.11%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m4.11%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m4.11%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.18%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.18%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.52%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.52%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m46.06%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m2.24%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mcollege_educated = 0\u001b[39m\u001b[0m with effectiveness \u001b[32m2.24%\u001b[39m and counterfactual cost = 3.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m2.24%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m2.24%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m4.13%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m4.13%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m7.24%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m7.24%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 140.93.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22644 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m53.09%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m4.11%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m4.11%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m4.11%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m85.47%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m85.47%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.52%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.52%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m48.86%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m2.23%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m2.23%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m2.23%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m4.13%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m4.13%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m7.07%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m7.16%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 140.71.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22756 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Unknown, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m52.84%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m4.12%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m4.12%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m4.12%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m85.84%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m85.84%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m90.70%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m90.70%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m48.60%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m\u001b[0m with effectiveness \u001b[32m2.20%\u001b[39m and counterfactual cost = 2.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m2.20%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m2.20%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m4.10%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Urban\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m4.10%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m7.05%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m7.14%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 140.7.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22876 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Urban, homeowner = 1, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m16.09%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m93.81%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m93.81%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.80%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.80%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m14.57%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 92.38.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24040 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Urban, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m16.09%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m93.81%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m93.81%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.80%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.80%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m14.57%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 92.38.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24040 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Urban, homeowner = 1, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m16.00%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.35%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.35%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m14.50%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 92.31.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24040 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Urban, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m16.00%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.35%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.35%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m100.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m14.50%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 92.31.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24040 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Urban, homeowner = 1, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m16.22%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m93.08%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m93.08%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.02%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.02%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m14.77%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.71%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.71%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.71%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.71%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 91.45.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24036 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Urban, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m16.22%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m93.08%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m93.08%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.02%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.02%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m14.77%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.71%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.71%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.72%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.72%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 91.44.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24036 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Urban, homeowner = 1, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m16.12%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m93.62%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m93.62%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.22%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.22%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m14.70%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.71%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.71%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.71%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.71%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 91.39.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24056 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Urban, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m16.12%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m93.62%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m93.62%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.22%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.22%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m14.70%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.71%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.71%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.71%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.71%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 91.39.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24056 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Urban, college_educated = 1, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m16.19%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m97.03%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m97.03%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m97.03%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m97.03%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m14.61%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.61%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.61%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 90.03.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23916 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Urban, college_educated = 1, homeowner = 1, income = Unknown, parents = 1, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m16.19%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m97.03%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m97.03%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m97.03%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m97.03%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m14.61%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.61%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.61%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 90.03.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23916 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Urban, homeowner = 1, income = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m17.00%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m88.77%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m88.77%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.43%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.43%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m15.40%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 89.85.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23420 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Urban, income = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m17.00%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m88.77%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m88.77%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.43%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.43%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m15.40%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 89.85.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23420 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Urban, college_educated = 1, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m16.27%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.53%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.53%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.89%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.89%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m14.68%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.59%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.59%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 89.79.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23944 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1marea = Urban, college_educated = 1, homeowner = 1, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m16.27%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.53%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.53%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m96.89%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m96.89%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m14.68%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m3.59%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m3.59%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 89.79.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23944 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Urban, homeowner = 1, income = Unknown, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m16.91%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m89.28%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m89.28%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.62%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.62%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m15.32%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 89.79.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23396 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Urban, income = Unknown, politics = Unknown, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m16.91%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m89.28%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m89.28%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m94.62%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m94.62%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m15.32%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 89.79.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23396 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Urban, college_educated = 1, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m15.18%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.45%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.45%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.84%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.84%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m13.75%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 89.76.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23904 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If \u001b[1mages = 55-64, area = Urban, college_educated = 1, homeowner = 1, income = Unknown, parents = 1, religion = Unknown\u001b[0m:\n",
      "\tProtected Subgroup '\u001b[1mMale\u001b[0m', \u001b[34m15.18%\u001b[39m covered out of 83563\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.45%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.45%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m99.84%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m99.84%\u001b[39m and counterfactual cost = 7.0.\n",
      "\tProtected Subgroup '\u001b[1mFemale\u001b[0m', \u001b[34m13.75%\u001b[39m covered out of 162105\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 5.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Other\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\tMake \u001b[1m\u001b[31marea = Rural\u001b[39m, \u001b[31mreligion = Christianity\u001b[39m\u001b[0m with effectiveness \u001b[32m0.00%\u001b[39m and counterfactual cost = 7.0.\n",
      "\t\u001b[35m Unfairness based on the Fair Effectiveness-Cost Trade-Off = 89.76.\u001b[39m\n",
      "\t\u001b[36mCumulative effectiveness plot for the above recourses:\u001b[39m\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23904 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "affected_pop_sizes = {sg: ((X_test[\"gender\"] == sg) & (preds_Xtest == 0)).sum() for sg in X_test[\"gender\"].unique()}\n",
    "\n",
    "top_rules,unfairness = facts.select_rules_subset_KStest(\n",
    "    rules_with_cumulative,\n",
    "    affected_pop_sizes,\n",
    "    top_count=50\n",
    ")\n",
    "\n",
    "print_recourse_report_KStest_cumulative(\n",
    "    top_rules,\n",
    "    population_sizes=pop_sizes,\n",
    "    unfairness = unfairness,\n",
    "    show_then_costs=True,\n",
    "    show_cumulative_plots=True\n",
    ")"
   ]
  }
 ],
 "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.8.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
