{ "cells": [ { "cell_type": "markdown", "id": "f1104795", "metadata": {}, "source": [ "***\n", "# Building and Explaining a Classifier using AutoMLx\n", "
by the Oracle AutoMLx Team
\n", "\n", "***" ] }, { "cell_type": "markdown", "id": "43086674", "metadata": {}, "source": [ "Classification Demo Notebook.\n", "\n", "Copyright © 2025, Oracle and/or its affiliates.\n", "\n", "Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/" ] }, { "cell_type": "markdown", "id": "d93cdc1d", "metadata": {}, "source": [ "## Overview of this Notebook\n", "\n", "In this notebook we will build a classifier using the Oracle AutoMLx tool for the public Census Income dataset. The dataset is a binary classification dataset, and more details about the dataset can be found at https://archive.ics.uci.edu/ml/datasets/Adult.\n", "We explore the various options provided by the Oracle AutoMLx tool, allowing the user to exercise control over the AutoMLx training process. We then evaluate the different models trained by AutoMLx. Finally we provide an overview of the possibilities that Oracle AutoMLx offers for explaining the predictions of the tuned model.\n", "\n", "---\n", "## Prerequisites\n", "\n", " - Experience level: Novice (Python and Machine Learning)\n", " - Professional experience: Some industry experience\n", "---\n", "\n", "## Business Use\n", "\n", "Data analytics and modeling problems using Machine Learning (ML) are becoming popular and often rely on data science expertise to build accurate ML models. Such modeling tasks primarily involve the following steps:\n", "- Preprocess dataset (clean, impute, engineer features, normalize).\n", "- Pick an appropriate model for the given dataset and prediction task at hand.\n", "- Tune the chosen model’s hyperparameters for the given dataset.\n", "\n", "All of these steps are significantly time consuming and heavily rely on data scientist expertise. Unfortunately, to make this problem harder, the best feature subset, model, and hyperparameter choice widely varies with the dataset and the prediction task. Hence, there is no one-size-fits-all solution to achieve reasonably good model performance. Using a simple Python API, AutoML can quickly jump-start the datascience process with an accurately-tuned model and appropriate features for a given prediction task.\n", "\n", "## Table of Contents\n", "\n", "- Setup\n", "- Load the Census Income dataset\n", "- AutoML\n", " - Setting the execution engine\n", " - Create an Instance of Oracle AutoMLx\n", " - Train a Model using AutoMLx\n", " - Analyze the AutoMLx optimization process \n", " - Algorithm Selection\n", " - Adaptive Sampling\n", " - Feature Selection\n", " - Hyperparameter Tuning\n", " - Confusion Matrix\n", " - Advanced AutoMLx Configuration \n", "- Machine Learning Explainability (MLX)\n", " - Initialize an MLExplainer\n", " - Model Explanations (Global Feature Importance)\n", " - Feature Dependence Explanations (PDP + ICE)\n", " - Prediction Explanations (Local Feature Importance)\n", " - Aggregate Local Feature Importance\n", " - Interactive What-If Explainers\n", " - Counterfactual Explanations\n", " - Advanced Feature Importance Options\n", " - Configure prediction explanation\n", " - Explain the model or explain the world\n", " - Advanced Feature Dependence Options (ALE)\n", "- References" ] }, { "cell_type": "markdown", "id": "35d7f621", "metadata": {}, "source": [ "\n", "## Setup\n", "\n", "Basic setup for the Notebook." ] }, { "cell_type": "code", "execution_count": 1, "id": "adfa3035", "metadata": { "execution": { "iopub.execute_input": "2025-05-22T12:02:39.008334Z", "iopub.status.busy": "2025-05-22T12:02:39.008133Z", "iopub.status.idle": "2025-05-22T12:02:39.570041Z", "shell.execute_reply": "2025-05-22T12:02:39.569364Z" } }, "outputs": [], "source": [ "\n", "%matplotlib inline\n", "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "markdown", "id": "f630157b", "metadata": {}, "source": [ "Load the required modules." ] }, { "cell_type": "code", "execution_count": 2, "id": "2921eeaf", "metadata": { "execution": { "iopub.execute_input": "2025-05-22T12:02:39.572469Z", "iopub.status.busy": "2025-05-22T12:02:39.571858Z", "iopub.status.idle": "2025-05-22T12:02:42.135111Z", "shell.execute_reply": "2025-05-22T12:02:42.134411Z" } }, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import plotly.express as px\n", "import plotly.figure_factory as ff\n", "from sklearn.metrics import roc_auc_score, confusion_matrix\n", "from sklearn.linear_model import LogisticRegression\n", "from sklearn.compose import make_column_selector as selector\n", "from sklearn.impute import SimpleImputer\n", "from sklearn.preprocessing import StandardScaler, OneHotEncoder\n", "from sklearn.compose import ColumnTransformer\n", "from sklearn.pipeline import Pipeline\n", "from sklearn.datasets import fetch_openml\n", "from sklearn.model_selection import train_test_split\n", "from sklearn.pipeline import Pipeline\n", "from sklearn.impute import SimpleImputer\n", "from sklearn.preprocessing import StandardScaler, OneHotEncoder\n", "from sklearn.compose import ColumnTransformer\n", "from sklearn.linear_model import LogisticRegression\n", "from sklearn.compose import make_column_selector as selector\n", "import time\n", "import datetime\n", "# Settings for plots\n", "plt.rcParams['figure.figsize'] = [10, 7]\n", "plt.rcParams['font.size'] = 15\n", "\n", "import automlx\n", "from automlx import init" ] }, { "cell_type": "markdown", "id": "fdf971f5", "metadata": {}, "source": [ "\n", "## Load the Census Income dataset\n", "We start by reading in the dataset from OpenML." ] }, { "cell_type": "code", "execution_count": 3, "id": "b9c8216c", "metadata": { "execution": { "iopub.execute_input": "2025-05-22T12:02:42.137819Z", "iopub.status.busy": "2025-05-22T12:02:42.137008Z", "iopub.status.idle": "2025-05-22T12:02:43.042874Z", "shell.execute_reply": "2025-05-22T12:02:43.042168Z" } }, "outputs": [], "source": [ "dataset = fetch_openml(name='adult',version=1, as_frame=True)\n", "df, y = dataset.data, dataset.target" ] }, { "cell_type": "markdown", "id": "65edfd2f", "metadata": {}, "source": [ "Lets look at a few of the values in the data" ] }, { "cell_type": "code", "execution_count": 4, "id": "f2f8c029", "metadata": { "execution": { "iopub.execute_input": "2025-05-22T12:02:43.045153Z", "iopub.status.busy": "2025-05-22T12:02:43.044587Z", "iopub.status.idle": "2025-05-22T12:02:43.220252Z", "shell.execute_reply": "2025-05-22T12:02:43.219513Z" } }, "outputs": [ { "data": { "text/html": [ "\n", " | age | \n", "workclass | \n", "fnlwgt | \n", "education | \n", "education-num | \n", "marital-status | \n", "occupation | \n", "relationship | \n", "race | \n", "sex | \n", "capitalgain | \n", "capitalloss | \n", "hoursperweek | \n", "native-country | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "2 | \n", "State-gov | \n", "77516.0 | \n", "Bachelors | \n", "13.0 | \n", "Never-married | \n", "Adm-clerical | \n", "Not-in-family | \n", "White | \n", "Male | \n", "1 | \n", "0 | \n", "2 | \n", "United-States | \n", "
1 | \n", "3 | \n", "Self-emp-not-inc | \n", "83311.0 | \n", "Bachelors | \n", "13.0 | \n", "Married-civ-spouse | \n", "Exec-managerial | \n", "Husband | \n", "White | \n", "Male | \n", "0 | \n", "0 | \n", "0 | \n", "United-States | \n", "
2 | \n", "2 | \n", "Private | \n", "215646.0 | \n", "HS-grad | \n", "9.0 | \n", "Divorced | \n", "Handlers-cleaners | \n", "Not-in-family | \n", "White | \n", "Male | \n", "0 | \n", "0 | \n", "2 | \n", "United-States | \n", "
3 | \n", "3 | \n", "Private | \n", "234721.0 | \n", "11th | \n", "7.0 | \n", "Married-civ-spouse | \n", "Handlers-cleaners | \n", "Husband | \n", "Black | \n", "Male | \n", "0 | \n", "0 | \n", "2 | \n", "United-States | \n", "
4 | \n", "1 | \n", "Private | \n", "338409.0 | \n", "Bachelors | \n", "13.0 | \n", "Married-civ-spouse | \n", "Prof-specialty | \n", "Wife | \n", "Black | \n", "Female | \n", "0 | \n", "0 | \n", "2 | \n", "Cuba | \n", "
\n", " | age | \n", "workclass | \n", "fnlwgt | \n", "education | \n", "education-num | \n", "marital-status | \n", "occupation | \n", "relationship | \n", "race | \n", "sex | \n", "capitalgain | \n", "capitalloss | \n", "hoursperweek | \n", "native-country | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Data type | \n", "category | \n", "category | \n", "float64 | \n", "category | \n", "float64 | \n", "category | \n", "category | \n", "category | \n", "category | \n", "category | \n", "category | \n", "category | \n", "category | \n", "category | \n", "
\n", " | age | \n", "workclass | \n", "fnlwgt | \n", "education | \n", "education-num | \n", "marital-status | \n", "occupation | \n", "relationship | \n", "race | \n", "sex | \n", "capitalgain | \n", "capitalloss | \n", "hoursperweek | \n", "native-country | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
% missing values | \n", "0.0 | \n", "5.730724 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "5.751198 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "1.754637 | \n", "
\n", " |
---|
(34189, 14) | \n", "
None | \n", "
KFoldSplit(Shuffle=True, Seed=7, folds=5, stratify by=target) | \n", "
neg_log_loss | \n", "
XGBClassifier | \n", "
{'learning_rate': 0.1, 'min_child_weight': 1, 'max_depth': 3, 'reg_alpha': 0, 'booster': 'gbtree', 'reg_lambda': 1, 'n_estimators': 275, 'use_label_encoder': False} | \n", "
24.4.1 | \n", "
3.9.21 (main, Dec 11 2024, 16:24:11) \\n[GCC 11.2.0] | \n", "
Step | \n", "# Samples | \n", "# Features | \n", "Algorithm | \n", "Hyperparameters | \n", "Score (neg_log_loss) | \n", "Runtime (Seconds) | \n", "Memory Usage (GB) | \n", "Finished | \n", "
---|---|---|---|---|---|---|---|---|
Model Selection | \n", "27352 | \n", "15 | \n", "XGBClassifier | \n", "{'learning_rate': 0.1, 'min_child_weight': 1, 'max_depth': 3, 'reg_alpha': 0, 'booster': 'gbtree', 'reg_lambda': 1, 'n_estimators': 100, 'use_label_encoder': False} | \n", "-0.3086 | \n", "5.2912 | \n", "0.3548 | \n", "Thu May 22 05:03:08 2025 | \n", "
Model Selection | \n", "27351 | \n", "15 | \n", "CatBoostClassifier | \n", "{'iterations': 235, 'learning_rate': 0.787168, 'leaf_estimation_method': 'Newton', 'colsample_bylevel': 0.096865, 'depth': 3, 'l2_leaf_reg': 2.567326, 'feature_border_type': 'UniformAndQuantiles', 'model_size_reg': 3.85132, 'leaf_estimation_iterations': 1, 'boosting_type': 'Plain', 'bootstrap_type': 'MVS', 'auto_class_weights': 'SqrtBalanced', 'allow_writing_files': False, 'allow_const_label': True} | \n", "-0.3237 | \n", "4.8780 | \n", "0.3289 | \n", "Thu May 22 05:03:03 2025 | \n", "
Model Selection | \n", "27352 | \n", "15 | \n", "RandomForestClassifier | \n", "{'n_estimators': 100, 'min_samples_split': 0.00125, 'min_samples_leaf': 0.000625, 'max_features': 0.777777778, 'class_weight': 'balanced'} | \n", "-0.3698 | \n", "16.6020 | \n", "0.3785 | \n", "Thu May 22 05:03:08 2025 | \n", "
Model Selection | \n", "27352 | \n", "15 | \n", "ExtraTreesClassifier | \n", "{'n_estimators': 100, 'min_samples_split': 0.00125, 'min_samples_leaf': 0.000625, 'max_features': 0.777777778, 'class_weight': 'balanced', 'criterion': 'gini'} | \n", "-0.3767 | \n", "10.4325 | \n", "0.3002 | \n", "Thu May 22 05:03:05 2025 | \n", "
Model Selection | \n", "27351 | \n", "15 | \n", "LogisticRegressionClassifier | \n", "{'C': 1.0, 'solver': 'liblinear', 'class_weight': 'balanced'} | \n", "-0.3974 | \n", "1.0157 | \n", "0.3178 | \n", "Thu May 22 05:03:07 2025 | \n", "
Model Selection | \n", "27351 | \n", "15 | \n", "LGBMClassifier | \n", "{'num_leaves': 31, 'boosting_type': 'gbdt', 'learning_rate': 0.1, 'min_child_weight': 0.001, 'max_depth': -1, 'reg_alpha': 0, 'reg_lambda': 1, 'n_estimators': 100, 'class_weight': 'balanced'} | \n", "-0.5487 | \n", "4.5249 | \n", "0.3552 | \n", "Thu May 22 05:03:04 2025 | \n", "
Model Selection | \n", "27351 | \n", "15 | \n", "DecisionTreeClassifier | \n", "{'min_samples_split': 0.00125, 'min_samples_leaf': 0.000625, 'max_features': 1.0, 'class_weight': None} | \n", "-0.7416 | \n", "1.8000 | \n", "0.2755 | \n", "Thu May 22 05:03:03 2025 | \n", "
Model Selection | \n", "27351 | \n", "15 | \n", "TorchMLPClassifier | \n", "{'optimizer_class': 'Adam', 'shuffle_dataset_each_epoch': True, 'optimizer_params': {}, 'criterion_class': None, 'criterion_params': {}, 'scheduler_class': None, 'scheduler_params': {}, 'batch_size': 128, 'lr': 0.001, 'epochs': 18, 'input_transform': 'auto', 'tensorboard_dir': None, 'use_tqdm': None, 'prediction_batch_size': 128, 'prediction_input_transform': 'auto', 'shuffling_buffer_size': None, 'depth': 4, 'num_logits': 1000, 'div_factor': 2, 'activation': 'ReLU', 'dropout': 0.1} | \n", "-0.833 | \n", "218.7919 | \n", "0.6396 | \n", "Thu May 22 05:03:49 2025 | \n", "
Model Selection | \n", "27352 | \n", "15 | \n", "GaussianNB | \n", "{} | \n", "-0.9457 | \n", "0.5367 | \n", "0.3274 | \n", "Thu May 22 05:03:03 2025 | \n", "
Adaptive Sampling | \n", "27352 | \n", "15 | \n", "AdaptiveSamplingStage_XGBClassifier | \n", "{'learning_rate': 0.1, 'min_child_weight': 1, 'max_depth': 3, 'reg_alpha': 0, 'booster': 'gbtree', 'reg_lambda': 1, 'n_estimators': 100, 'use_label_encoder': False} | \n", "-0.3086 | \n", "7.9914 | \n", "0.5999 | \n", "Thu May 22 05:03:55 2025 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
Model Tuning | \n", "27351 | \n", "15 | \n", "XGBClassifier | \n", "{'learning_rate': 0.0001, 'min_child_weight': 16, 'max_depth': 2, 'reg_alpha': 0, 'booster': 'gbtree', 'reg_lambda': 0, 'n_estimators': 50, 'use_label_encoder': False} | \n", "-0.6906 | \n", "3.7100 | \n", "0.3506 | \n", "Thu May 22 05:04:33 2025 | \n", "
Model Tuning | \n", "27352 | \n", "15 | \n", "XGBClassifier | \n", "{'learning_rate': 0.0001, 'min_child_weight': 2, 'max_depth': 2, 'reg_alpha': 0, 'booster': 'gbtree', 'reg_lambda': 0, 'n_estimators': 50, 'use_label_encoder': False} | \n", "-0.6906 | \n", "3.6775 | \n", "0.4014 | \n", "Thu May 22 05:04:32 2025 | \n", "
Model Tuning | \n", "27352 | \n", "15 | \n", "XGBClassifier | \n", "{'learning_rate': 0.0001, 'min_child_weight': 0, 'max_depth': 2, 'reg_alpha': 0, 'booster': 'gbtree', 'reg_lambda': 0.01778279410038923, 'n_estimators': 50, 'use_label_encoder': False} | \n", "-0.6906 | \n", "3.9077 | \n", "0.6185 | \n", "Thu May 22 05:04:37 2025 | \n", "
Model Tuning | \n", "27352 | \n", "15 | \n", "XGBClassifier | \n", "{'learning_rate': 0.0001, 'min_child_weight': 0, 'max_depth': 2, 'reg_alpha': 0, 'booster': 'gbtree', 'reg_lambda': 0.01878279410038923, 'n_estimators': 50, 'use_label_encoder': False} | \n", "-0.6906 | \n", "3.7050 | \n", "0.6047 | \n", "Thu May 22 05:04:37 2025 | \n", "
Model Tuning | \n", "27352 | \n", "15 | \n", "XGBClassifier | \n", "{'learning_rate': 0.0001, 'min_child_weight': 0, 'max_depth': 2, 'reg_alpha': 0.2249365300761397, 'booster': 'gbtree', 'reg_lambda': 0, 'n_estimators': 50, 'use_label_encoder': False} | \n", "-0.6906 | \n", "3.7681 | \n", "0.6185 | \n", "Thu May 22 05:04:36 2025 | \n", "
Model Tuning | \n", "27352 | \n", "15 | \n", "XGBClassifier | \n", "{'learning_rate': 0.0001, 'min_child_weight': 0, 'max_depth': 2, 'reg_alpha': 0.2249765300761397, 'booster': 'gbtree', 'reg_lambda': 0, 'n_estimators': 50, 'use_label_encoder': False} | \n", "-0.6906 | \n", "3.8497 | \n", "0.3820 | \n", "Thu May 22 05:04:36 2025 | \n", "
Model Tuning | \n", "27352 | \n", "15 | \n", "XGBClassifier | \n", "{'learning_rate': 0.0001, 'min_child_weight': 0, 'max_depth': 2, 'reg_alpha': 0, 'booster': 'gbtree', 'reg_lambda': 1, 'n_estimators': 50, 'use_label_encoder': False} | \n", "-0.6906 | \n", "3.7144 | \n", "0.6162 | \n", "Thu May 22 05:04:37 2025 | \n", "
Model Tuning | \n", "27352 | \n", "15 | \n", "XGBClassifier | \n", "{'learning_rate': 0.0001, 'min_child_weight': 0, 'max_depth': 2, 'reg_alpha': 0, 'booster': 'gbtree', 'reg_lambda': 1.001, 'n_estimators': 50, 'use_label_encoder': False} | \n", "-0.6906 | \n", "3.5767 | \n", "0.6125 | \n", "Thu May 22 05:04:37 2025 | \n", "
Model Tuning | \n", "27352 | \n", "15 | \n", "XGBClassifier | \n", "{'learning_rate': 0.0001, 'min_child_weight': 0, 'max_depth': 2, 'reg_alpha': 0, 'booster': 'gbtree', 'reg_lambda': 5.623413251903491, 'n_estimators': 50, 'use_label_encoder': False} | \n", "-0.6906 | \n", "3.5978 | \n", "0.6483 | \n", "Thu May 22 05:04:37 2025 | \n", "
Model Tuning | \n", "27352 | \n", "15 | \n", "XGBClassifier | \n", "{'learning_rate': 0.0001, 'min_child_weight': 0, 'max_depth': 2, 'reg_alpha': 0, 'booster': 'gbtree', 'reg_lambda': 5.6244132519034915, 'n_estimators': 50, 'use_label_encoder': False} | \n", "-0.6906 | \n", "3.7512 | \n", "0.6047 | \n", "Thu May 22 05:04:38 2025 | \n", "
\n", " | feature | \n", "attribution | \n", "upper_bound | \n", "lower_bound | \n", "
---|---|---|---|---|
0 | \n", "capitalgain | \n", "0.073281 | \n", "0.083655 | \n", "0.062907 | \n", "
1 | \n", "age | \n", "0.000846 | \n", "0.001951 | \n", "-0.000259 | \n", "
2 | \n", "capitalloss | \n", "0.000475 | \n", "0.002982 | \n", "-0.002031 | \n", "
3 | \n", "fnlwgt | \n", "0.000280 | \n", "0.001719 | \n", "-0.001159 | \n", "
4 | \n", "occupation | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
5 | \n", "race | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
6 | \n", "sex | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
7 | \n", "marital-status | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
8 | \n", "relationship | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
9 | \n", "workclass | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
10 | \n", "native-country | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
11 | \n", "education | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
12 | \n", "hoursperweek | \n", "-0.000006 | \n", "0.001626 | \n", "-0.001638 | \n", "
13 | \n", "education-num | \n", "-0.000169 | \n", "0.000467 | \n", "-0.000805 | \n", "
\n | age | \nworkclass | \nfnlwgt | \neducation | \neducation-num | \nmarital-status | \noccupation | \nrelationship | \nrace | \nsex | \ncapitalgain | \ncapitalloss | \nhoursperweek | \nnative-country | \n
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n2 | \n5 | \n83411.0 | \n9 | \n13.0 | \n2 | \n11 | \n0 | \n4 | \n1 | \n0 | \n4 | \n2 | \n38 | \n
1 | \n1 | \n3 | \n202822.0 | \n12 | \n14.0 | \n4 | \n12 | \n4 | \n2 | \n0 | \n0 | \n0 | \n2 | \n-1 | \n
2 | \n1 | \n3 | \n149531.0 | \n15 | \n10.0 | \n2 | \n11 | \n0 | \n4 | \n1 | \n0 | \n0 | \n2 | \n38 | \n
3 | \n0 | \n3 | \n115244.0 | \n7 | \n12.0 | \n2 | \n9 | \n5 | \n4 | \n0 | \n0 | \n0 | \n2 | \n38 | \n
4 | \n3 | \n3 | \n205504.0 | \n11 | \n9.0 | \n0 | \n6 | \n1 | \n4 | \n1 | \n0 | \n0 | \n0 | \n38 | \n
5 | \n2 | \n1 | \n254134.0 | \n7 | \n12.0 | \n0 | \n12 | \n1 | \n2 | \n1 | \n0 | \n0 | \n2 | \n38 | \n
6 | \n4 | \n3 | \n392160.0 | \n11 | \n9.0 | \n6 | \n11 | \n4 | \n4 | \n0 | \n0 | \n0 | \n1 | \n25 | \n
7 | \n2 | \n3 | \n103925.0 | \n11 | \n9.0 | \n4 | \n0 | \n4 | \n4 | \n0 | \n0 | \n0 | \n1 | \n38 | \n
8 | \n1 | \n3 | \n236396.0 | \n9 | \n13.0 | \n2 | \n11 | \n0 | \n4 | \n1 | \n0 | \n3 | \n3 | \n38 | \n
9 | \n2 | \n3 | \n126675.0 | \n11 | \n9.0 | \n4 | \n2 | \n1 | \n4 | \n1 | \n0 | \n0 | \n2 | \n38 | \n
\n | Prediction (True value: 0) | \n
---|---|
Original Sample | \n0 | \n
Modified Sample | \n0 | \n
\n | age | \nworkclass | \nfnlwgt | \neducation | \neducation-num | \nmarital-status | \noccupation | \nrelationship | \nrace | \nsex | \ncapitalgain | \ncapitalloss | \nhoursperweek | \nnative-country | \n
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Original Sample | \n2 | \nPrivate | \n151856.0 | \nHS-grad | \n9.0 | \nMarried-civ-spouse | \nProtective-serv | \nHusband | \nWhite | \nMale | \n0 | \n0 | \n2 | \nUnited-States | \n
Modified Sample | \n2 | \nPrivate | \n151856.0 | \nHS-grad | \n9.0 | \nMarried-civ-spouse | \nProtective-serv | \nHusband | \nWhite | \nMale | \n0 | \n0 | \n2 | \nUnited-States | \n
\n | age | \nworkclass | \nfnlwgt | \neducation | \neducation-num | \nmarital-status | \noccupation | \nrelationship | \nrace | \nsex | \ncapitalgain | \ncapitalloss | \nhoursperweek | \nnative-country | \n
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Original Sample | \n2 | \nPrivate | \n151856.0 | \nHS-grad | \n9.0 | \nMarried-civ-spouse | \nProtective-serv | \nHusband | \nWhite | \nMale | \n0 | \n0 | \n2 | \nUnited-States | \n
Modified Sample | \n2 | \nPrivate | \n151855.9998765774 | \nMasters | \n9.000070813837981 | \nMarried-civ-spouse | \nProtective-serv | \nHusband | \nWhite | \nMale | \n0 | \n0 | \n2 | \nUnited-States | \n
\n | Prediction (True value: 0) | \n
---|---|
Original Sample | \n0 | \n
Modified Sample | \n1 | \n