{ "cells": [ { "cell_type": "markdown", "id": "00f3548a", "metadata": {}, "source": [ "***\n", "# Building and Explaining an Anomaly Detector using AutoMLx - Experimental\n", "
by the Oracle AutoMLx Team
\n", "\n", "***" ] }, { "cell_type": "markdown", "id": "b1ba63d9", "metadata": {}, "source": [ "Anomaly Detection 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": "1b54cad5", "metadata": {}, "source": [ "## Overview of this Notebook\n", "\n", "In this notebook we will build an anomaly detection model using the experimental, fully unsupervised anomaly detection pipeline in Oracle AutoMLx for the public Credit Card Fraud dataset. The dataset is a binary anomaly detection dataset, and more details about the dataset can be found at https://www.openml.org/d/1597.\n", "We explore the various options provided by the Oracle AutoMLx tool, allowing the user to control the AutoML training process. We then evaluate the different models trained by AutoML. Finally we provide an overview of the possibilities that Oracle AutoMLx provides 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", "\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 Credit Card dataset\n", "- AutoML\n", " - Setting the execution engine\n", " - Create an Instance of AutoMLx\n", " - Train a Model using AutoMLx\n", " - Analyze the AutoMLx optimization process \n", " - Algorithm Selection\n", " - Hyperparameter Tuning\n", " - Specify a Time Budget to AutoML\n", "- Machine Learning Explainability (MLX)\n", " - Initialize an MLExplainer\n", " - Model Explanations (Global Feature Importance)\n", " - Feature Dependence Explanations\n", " - Prediction Explanations (Local Feature Importance)\n", " - Interactive What-If Explanations\n", " - Counterfactual Explanations\n", " - Aggregate Local Feature Importance & Local Feature Importance Built-in Sampling\n", " - Advanced Feature Importance Options\n", " - Change the number of iterations\n", " - Include the effects of feature interactions (with Shapley feature importance)\n", " - Advanced Feature Dependence Options (ALE)\n", "- References" ] }, { "cell_type": "markdown", "id": "ed5d41ec", "metadata": {}, "source": [ "\n", "## Setup\n", "\n", "Basic setup for the Notebook." ] }, { "cell_type": "code", "execution_count": 1, "id": "124c551f", "metadata": { "execution": { "iopub.execute_input": "2025-04-25T09:59:34.026432Z", "iopub.status.busy": "2025-04-25T09:59:34.026094Z", "iopub.status.idle": "2025-04-25T09:59:44.508269Z", "shell.execute_reply": "2025-04-25T09:59:44.507603Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Collecting rdata==0.9\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ " Using cached rdata-0.9-py3-none-any.whl.metadata (1.1 kB)\r\n", "Requirement already satisfied: numpy in /scratch_user/olautoml/.conda/envs/pipeline-run-3.9.19-releasev252/lib/python3.9/site-packages (from rdata==0.9) (1.26.4)\r\n", "Requirement already satisfied: xarray in /scratch_user/olautoml/.conda/envs/pipeline-run-3.9.19-releasev252/lib/python3.9/site-packages (from rdata==0.9) (2024.7.0)\r\n", "Requirement already satisfied: pandas in /scratch_user/olautoml/.conda/envs/pipeline-run-3.9.19-releasev252/lib/python3.9/site-packages (from rdata==0.9) (2.2.2)\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Requirement already satisfied: python-dateutil>=2.8.2 in /scratch_user/olautoml/.conda/envs/pipeline-run-3.9.19-releasev252/lib/python3.9/site-packages (from pandas->rdata==0.9) (2.9.0.post0)\r\n", "Requirement already satisfied: pytz>=2020.1 in /scratch_user/olautoml/.conda/envs/pipeline-run-3.9.19-releasev252/lib/python3.9/site-packages (from pandas->rdata==0.9) (2025.2)\r\n", "Requirement already satisfied: tzdata>=2022.7 in /scratch_user/olautoml/.conda/envs/pipeline-run-3.9.19-releasev252/lib/python3.9/site-packages (from pandas->rdata==0.9) (2025.2)\r\n", "Requirement already satisfied: packaging>=23.1 in /scratch_user/olautoml/.conda/envs/pipeline-run-3.9.19-releasev252/lib/python3.9/site-packages (from xarray->rdata==0.9) (25.0)\r\n", "Requirement already satisfied: six>=1.5 in /scratch_user/olautoml/.conda/envs/pipeline-run-3.9.19-releasev252/lib/python3.9/site-packages (from python-dateutil>=2.8.2->pandas->rdata==0.9) (1.17.0)\r\n", "Using cached rdata-0.9-py3-none-any.whl (19 kB)\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Installing collected packages: rdata\r\n", " Attempting uninstall: rdata\r\n", " Found existing installation: rdata 0.11.2\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ " Uninstalling rdata-0.11.2:\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ " Successfully uninstalled rdata-0.11.2\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Successfully installed rdata-0.9\r\n" ] } ], "source": [ "! pip install rdata==0.9\n", "\n", "%matplotlib inline\n", "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "markdown", "id": "67e80ff5", "metadata": {}, "source": [ "Load the required modules." ] }, { "cell_type": "code", "execution_count": 2, "id": "09821a36", "metadata": { "execution": { "iopub.execute_input": "2025-04-25T09:59:44.510808Z", "iopub.status.busy": "2025-04-25T09:59:44.510323Z", "iopub.status.idle": "2025-04-25T10:00:26.554123Z", "shell.execute_reply": "2025-04-25T10:00:26.553486Z" } }, "outputs": [], "source": [ "import urllib\n", "import rdata\n", "import pandas as pd\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "\n", "import plotly.figure_factory as ff\n", "import plotly.express as px\n", "from sklearn.metrics import f1_score, confusion_matrix\n", "from sklearn.model_selection import train_test_split\n", "from pyod.models.iforest import IForest\n", "import time\n", "import datetime\n", "\n", "# Settings for plots\n", "plt.rcParams['figure.figsize'] = [10, 7]\n", "plt.rcParams['font.size'] = 15\n", "import automlx\n", "from automlx import init" ] }, { "cell_type": "markdown", "id": "cfe2a223", "metadata": {}, "source": [ "\n", "## Load the Credit Card Fraud Dataset\n", "We start by retrieving and reading in the dataset from provided URL." ] }, { "cell_type": "code", "execution_count": 3, "id": "0f03efa0", "metadata": { "execution": { "iopub.execute_input": "2025-04-25T10:00:26.557270Z", "iopub.status.busy": "2025-04-25T10:00:26.556221Z", "iopub.status.idle": "2025-04-25T10:00:49.388257Z", "shell.execute_reply": "2025-04-25T10:00:49.387666Z" } }, "outputs": [], "source": [ "url = \"http://www.ulb.ac.be/di/map/adalpozz/data/creditcard.Rdata\"\n", "dst_path = \"./creditcard.Rdata\"\n", "\n", "with open(dst_path, 'wb') as fout:\n", " fout.write(urllib.request.urlopen(url).read())\n", "parsed_res = rdata.parser.parse_file(dst_path)\n", "res = rdata.conversion.convert(parsed_res)\n", "dataset = res['creditcard'].reset_index(drop=True).drop(['Time'], axis=1)" ] }, { "cell_type": "markdown", "id": "52d15861", "metadata": {}, "source": [ "In this case, the target is identified by the `Class` column." ] }, { "cell_type": "code", "execution_count": 4, "id": "3f3dc853", "metadata": { "execution": { "iopub.execute_input": "2025-04-25T10:00:49.390778Z", "iopub.status.busy": "2025-04-25T10:00:49.390321Z", "iopub.status.idle": "2025-04-25T10:00:49.978757Z", "shell.execute_reply": "2025-04-25T10:00:49.978272Z" } }, "outputs": [], "source": [ "y = dataset.loc[:, 'Class']" ] }, { "cell_type": "markdown", "id": "34f93770", "metadata": {}, "source": [ "We reduce the total number of features to 20 to have a reasonable training time for this demonstration." ] }, { "cell_type": "code", "execution_count": 5, "id": "a461a8de", "metadata": { "execution": { "iopub.execute_input": "2025-04-25T10:00:49.980843Z", "iopub.status.busy": "2025-04-25T10:00:49.980499Z", "iopub.status.idle": "2025-04-25T10:00:50.026498Z", "shell.execute_reply": "2025-04-25T10:00:50.025899Z" } }, "outputs": [], "source": [ "df = dataset.iloc[:, :20]" ] }, { "cell_type": "markdown", "id": "cc0825a0", "metadata": {}, "source": [ "Since the dataset is not split into training and validation sets by default, we now split it into training (60%) and test (40%) datasets. The training set will be used to create a Machine Learning model using AutoML, and the test set will be used to evaluate the model's performance on unseen data." ] }, { "cell_type": "code", "execution_count": 6, "id": "a5e4d1ce", "metadata": { "execution": { "iopub.execute_input": "2025-04-25T10:00:50.028702Z", "iopub.status.busy": "2025-04-25T10:00:50.028386Z", "iopub.status.idle": "2025-04-25T10:00:50.356653Z", "shell.execute_reply": "2025-04-25T10:00:50.356037Z" } }, "outputs": [ { "data": { "text/plain": [ "((170884, 20), (56962, 20))" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "X_train, X_test, y_train, y_test = train_test_split(df, y, train_size=0.6, random_state=0, stratify=y)\n", "X_valid, X_test, y_valid, y_test = train_test_split(X_test, y_test, train_size=0.5, random_state=0, stratify=y_test)\n", "\n", "X_train.shape, X_test.shape" ] }, { "cell_type": "markdown", "id": "0a1599c9", "metadata": {}, "source": [ "Again to keep the training time reasonable, we also downsample to use 5% of the total training set." ] }, { "cell_type": "code", "execution_count": 7, "id": "039a183b", "metadata": { "execution": { "iopub.execute_input": "2025-04-25T10:00:50.358715Z", "iopub.status.busy": "2025-04-25T10:00:50.358271Z", "iopub.status.idle": "2025-04-25T10:00:50.713308Z", "shell.execute_reply": "2025-04-25T10:00:50.712736Z" } }, "outputs": [ { "data": { "text/plain": [ "(8544, 20)" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "X_train, _, y_train, _ = train_test_split(X_train, y_train, train_size=0.05, random_state=0, stratify=y_train)\n", "\n", "X_train.shape" ] }, { "cell_type": "markdown", "id": "85655da0", "metadata": {}, "source": [ "We also need to reset the indexes after our downsampling." ] }, { "cell_type": "code", "execution_count": 8, "id": "0503cae9", "metadata": { "execution": { "iopub.execute_input": "2025-04-25T10:00:50.715240Z", "iopub.status.busy": "2025-04-25T10:00:50.714914Z", "iopub.status.idle": "2025-04-25T10:00:50.805439Z", "shell.execute_reply": "2025-04-25T10:00:50.804947Z" } }, "outputs": [], "source": [ "X_train.reset_index(drop=True, inplace=True)\n", "y_train.reset_index(drop=True, inplace=True)" ] }, { "cell_type": "markdown", "id": "98732c51", "metadata": {}, "source": [ "Lets look at a few of the samples in the training dataset." ] }, { "cell_type": "code", "execution_count": 9, "id": "7ae1ab1b", "metadata": { "execution": { "iopub.execute_input": "2025-04-25T10:00:50.807262Z", "iopub.status.busy": "2025-04-25T10:00:50.806947Z", "iopub.status.idle": "2025-04-25T10:00:50.973830Z", "shell.execute_reply": "2025-04-25T10:00:50.973303Z" } }, "outputs": [ { "data": { "text/html": [ "\n", " | V1 | \n", "V2 | \n", "V3 | \n", "V4 | \n", "V5 | \n", "V6 | \n", "V7 | \n", "V8 | \n", "V9 | \n", "V10 | \n", "V11 | \n", "V12 | \n", "V13 | \n", "V14 | \n", "V15 | \n", "V16 | \n", "V17 | \n", "V18 | \n", "V19 | \n", "V20 | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "-0.716073 | \n", "0.225322 | \n", "3.761183 | \n", "3.207240 | \n", "-0.495804 | \n", "1.865745 | \n", "-0.678000 | \n", "0.458706 | \n", "-0.009656 | \n", "0.484059 | \n", "0.026032 | \n", "1.070390 | \n", "0.905135 | \n", "-1.490118 | \n", "-1.857273 | \n", "-0.478333 | \n", "0.224669 | \n", "0.763987 | \n", "1.715066 | \n", "0.421615 | \n", "
1 | \n", "-0.287669 | \n", "1.355348 | \n", "0.607857 | \n", "0.564008 | \n", "0.823146 | \n", "-0.623391 | \n", "0.846476 | \n", "-0.026066 | \n", "-0.968745 | \n", "-0.953380 | \n", "1.469807 | \n", "0.470426 | \n", "0.426923 | \n", "-1.388217 | \n", "0.138532 | \n", "0.771883 | \n", "0.503981 | \n", "1.289862 | \n", "-0.073898 | \n", "0.021523 | \n", "
2 | \n", "-1.360701 | \n", "0.068936 | \n", "1.547622 | \n", "0.968746 | \n", "-2.539901 | \n", "1.505830 | \n", "2.200844 | \n", "-0.087798 | \n", "1.034511 | \n", "-0.918203 | \n", "-0.866630 | \n", "0.289333 | \n", "-1.194264 | \n", "-0.939673 | \n", "-2.124787 | \n", "-0.923653 | \n", "0.630370 | \n", "-1.355050 | \n", "-0.591845 | \n", "-0.520554 | \n", "
3 | \n", "-1.167623 | \n", "-0.206586 | \n", "1.155390 | \n", "-1.460830 | \n", "-1.248562 | \n", "-0.637028 | \n", "0.015802 | \n", "0.154537 | \n", "-3.190664 | \n", "0.822285 | \n", "0.061631 | \n", "-0.513346 | \n", "1.103738 | \n", "0.029712 | \n", "0.751646 | \n", "-1.206843 | \n", "1.420112 | \n", "-0.898657 | \n", "0.463735 | \n", "-0.318270 | \n", "
4 | \n", "-0.771096 | \n", "-0.882119 | \n", "-0.583668 | \n", "-0.087184 | \n", "-1.984118 | \n", "0.750064 | \n", "1.243510 | \n", "0.479466 | \n", "0.410805 | \n", "-1.674414 | \n", "-0.841014 | \n", "-0.267114 | \n", "0.487951 | \n", "-1.263536 | \n", "1.160706 | \n", "1.723230 | \n", "-0.083639 | \n", "1.335979 | \n", "-1.330248 | \n", "0.989092 | \n", "
\n", " | V1 | \n", "V2 | \n", "V3 | \n", "V4 | \n", "V5 | \n", "V6 | \n", "V7 | \n", "V8 | \n", "V9 | \n", "V10 | \n", "V11 | \n", "V12 | \n", "V13 | \n", "V14 | \n", "V15 | \n", "V16 | \n", "V17 | \n", "V18 | \n", "V19 | \n", "V20 | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Data type | \n", "float64 | \n", "float64 | \n", "float64 | \n", "float64 | \n", "float64 | \n", "float64 | \n", "float64 | \n", "float64 | \n", "float64 | \n", "float64 | \n", "float64 | \n", "float64 | \n", "float64 | \n", "float64 | \n", "float64 | \n", "float64 | \n", "float64 | \n", "float64 | \n", "float64 | \n", "float64 | \n", "
\n", " | V1 | \n", "V2 | \n", "V3 | \n", "V4 | \n", "V5 | \n", "V6 | \n", "V7 | \n", "V8 | \n", "V9 | \n", "V10 | \n", "V11 | \n", "V12 | \n", "V13 | \n", "V14 | \n", "V15 | \n", "V16 | \n", "V17 | \n", "V18 | \n", "V19 | \n", "V20 | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
% missing values | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "
\n", " |
---|
(8544, 20) | \n", "
(56961, 20) | \n", "
ManualSplit(Shuffle=True, Seed=7) | \n", "
f1 | \n", "
IsolationForestOD | \n", "
{'contamination': 0.1, 'n_estimators': 5, 'max_samples': 6, 'max_features': 0.05, 'bootstrap': False, 'behaviour': 'old'} | \n", "
25.2.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 (f1) | \n", "All Metrics | \n", "Runtime (Seconds) | \n", "Memory Usage (GB) | \n", "Finished | \n", "
---|---|---|---|---|---|---|---|---|---|
Model Selection | \n", "8544 | \n", "20 | \n", "IsolationForestOD | \n", "{'contamination': 0.1, 'n_estimators': 100, 'max_samples': 5, 'max_features': 1.0, 'bootstrap': False, 'behaviour': 'old'} | \n", "0.031 | \n", "{'f1': 0.031007751937984496} | \n", "1.6463 | \n", "0.3198 | \n", "Fri Apr 25 03:03:13 2025 | \n", "
Model Selection | \n", "8544 | \n", "20 | \n", "HistogramOD | \n", "{'contamination': 0.1, 'n_bins': 10, 'alpha': 0.1, 'tol': 0.5} | \n", "0.0299 | \n", "{'f1': 0.029925187032418952} | \n", "6.5625 | \n", "0.3786 | \n", "Fri Apr 25 03:03:18 2025 | \n", "
Model Selection | \n", "8544 | \n", "20 | \n", "PrincipalCompOD | \n", "{'contamination': 0.1, 'whiten': False, 'n_components': 0.9999, 'weighted': True, 'svd_solver': 'full', 'n_selected_components': None, 'copy': True, 'tol': 0.0, 'iterated_power': 'auto', 'standardization': True} | \n", "0.0293 | \n", "{'f1': 0.029301644147810516} | \n", "1.3347 | \n", "0.3462 | \n", "Fri Apr 25 03:03:13 2025 | \n", "
Model Selection | \n", "8544 | \n", "20 | \n", "AutoEncoder | \n", "{'contamination': 0.1, 'middle_layer_size': 2, 'encoder_length': 2, 'layer_size_growth': 'exponential', 'hidden_activation': 'relu', 'batch_norm': True, 'learning_rate': 0.001, 'epochs': 100, 'batch_size': 256, 'dropout_rate': 0.05, 'weight_decay': 1e-05, 'preprocessing': False, 'input_dim': 20} | \n", "0.029 | \n", "{'f1': 0.029035821366577244} | \n", "37.3068 | \n", "0.6494 | \n", "Fri Apr 25 03:03:49 2025 | \n", "
Model Selection | \n", "8544 | \n", "20 | \n", "ClusteringLocalFactorOD | \n", "{'contamination': 0.1, 'n_clusters': 9, 'alpha': 0.8, 'beta': 5, 'use_weights': False, 'clustering_estimator': None, 'check_estimator': False} | \n", "0.0284 | \n", "{'f1': 0.02841530054644809} | \n", "6.7511 | \n", "0.4133 | \n", "Fri Apr 25 03:03:18 2025 | \n", "
Model Selection | \n", "8544 | \n", "20 | \n", "MinCovOD | \n", "{'contamination': 0.1, 'assume_centered': False, 'support_fraction': 0.5012289325842697, 'store_precision': True} | \n", "0.0283 | \n", "{'f1': 0.0282780676653762} | \n", "4.0895 | \n", "0.3637 | \n", "Fri Apr 25 03:03:16 2025 | \n", "
Model Selection | \n", "8544 | \n", "20 | \n", "KNearestNeighborsOD | \n", "{'contamination': 0.1, 'n_neighbors': 5, 'method': 'largest', 'radius': 1.0, 'algorithm': 'ball_tree', 'leaf_size': 30, 'metric': 'minkowski', 'p': 2, 'metric_params': None} | \n", "0.0262 | \n", "{'f1': 0.026224783861671472} | \n", "20.9862 | \n", "0.3448 | \n", "Fri Apr 25 03:03:33 2025 | \n", "
Model Selection | \n", "8544 | \n", "20 | \n", "OneClassSVMOD | \n", "{'contamination': 0.1, 'gamma': 0.5, 'kernel': 'rbf', 'nu': 0.5, 'coef0': 0, 'degree': 3, 'tol': 0.001, 'shrinking': True, 'cache_size': 200, 'max_iter': -1} | \n", "0.0136 | \n", "{'f1': 0.013550135501355014} | \n", "23.1880 | \n", "0.5145 | \n", "Fri Apr 25 03:03:35 2025 | \n", "
Model Tuning | \n", "8544 | \n", "20 | \n", "IsolationForestOD | \n", "{'contamination': 0.1, 'n_estimators': 5, 'max_samples': 6, 'max_features': 0.05, 'bootstrap': False, 'behaviour': 'old'} | \n", "0.032 | \n", "{'f1': 0.03197925669835782} | \n", "0.1362 | \n", "0.3567 | \n", "Fri Apr 25 03:03:51 2025 | \n", "
Model Tuning | \n", "8544 | \n", "20 | \n", "IsolationForestOD | \n", "{'contamination': 0.1, 'n_estimators': 101, 'max_samples': 5, 'max_features': 1.0, 'bootstrap': False, 'behaviour': 'old'} | \n", "0.0315 | \n", "{'f1': 0.03149606299212599} | \n", "0.4225 | \n", "0.6598 | \n", "Fri Apr 25 03:03:50 2025 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
Model Tuning | \n", "8544 | \n", "20 | \n", "IsolationForestOD | \n", "{'contamination': 0.1, 'n_estimators': 5, 'max_samples': 37, 'max_features': 0.05, 'bootstrap': False, 'behaviour': 'old'} | \n", "0.0237 | \n", "{'f1': 0.02370163820146393} | \n", "0.1536 | \n", "0.3488 | \n", "Fri Apr 25 03:03:51 2025 | \n", "
Model Tuning | \n", "8544 | \n", "20 | \n", "IsolationForestOD | \n", "{'contamination': 0.1, 'n_estimators': 5, 'max_samples': 36, 'max_features': 0.05, 'bootstrap': False, 'behaviour': 'old'} | \n", "0.0236 | \n", "{'f1': 0.023570190641247834} | \n", "0.1406 | \n", "0.6632 | \n", "Fri Apr 25 03:03:51 2025 | \n", "
Model Tuning | \n", "8544 | \n", "20 | \n", "IsolationForestOD | \n", "{'contamination': 0.1, 'n_estimators': 5, 'max_samples': 5, 'max_features': 1.0, 'bootstrap': False, 'behaviour': 'old'} | \n", "0.0038 | \n", "{'f1': 0.0037695207323640285} | \n", "0.1230 | \n", "0.3496 | \n", "Fri Apr 25 03:03:51 2025 | \n", "
Model Tuning | \n", "8544 | \n", "20 | \n", "IsolationForestOD | \n", "{'contamination': 0.1, 'n_estimators': 5, 'max_samples': 5, 'max_features': 0.9999905, 'bootstrap': False, 'behaviour': 'old'} | \n", "0.0012 | \n", "{'f1': 0.0011851851851851852} | \n", "0.1246 | \n", "0.6598 | \n", "Fri Apr 25 03:03:51 2025 | \n", "
Model Tuning | \n", "8544 | \n", "20 | \n", "IsolationForestOD | \n", "{'contamination': 0.1, 'n_estimators': 5, 'max_samples': 5, 'max_features': 0.05, 'bootstrap': False, 'behaviour': 'old'} | \n", "0.0012 | \n", "{'f1': 0.0011813349084465446} | \n", "0.0994 | \n", "0.3379 | \n", "Fri Apr 25 03:03:55 2025 | \n", "
Model Tuning | \n", "8544 | \n", "20 | \n", "IsolationForestOD | \n", "{'contamination': 0.1, 'n_estimators': 5, 'max_samples': 5, 'max_features': 0.05, 'bootstrap': False, 'behaviour': 'old'} | \n", "0.0012 | \n", "{'f1': 0.0011813349084465446} | \n", "0.1292 | \n", "0.3519 | \n", "Fri Apr 25 03:03:51 2025 | \n", "
Model Tuning | \n", "8544 | \n", "20 | \n", "IsolationForestOD | \n", "{'contamination': 0.1, 'n_estimators': 5, 'max_samples': 5, 'max_features': 0.050009500000000005, 'bootstrap': False, 'behaviour': 'old'} | \n", "0.0012 | \n", "{'f1': 0.0011813349084465446} | \n", "0.1274 | \n", "0.3477 | \n", "Fri Apr 25 03:03:50 2025 | \n", "
Model Tuning | \n", "8544 | \n", "20 | \n", "IsolationForestOD | \n", "{'contamination': 0.1, 'n_estimators': 5, 'max_samples': 5, 'max_features': 0.05001900000000001, 'bootstrap': False, 'behaviour': 'old'} | \n", "0.0012 | \n", "{'f1': 0.0011813349084465446} | \n", "0.1151 | \n", "0.3501 | \n", "Fri Apr 25 03:03:50 2025 | \n", "
Model Tuning | \n", "8544 | \n", "20 | \n", "IsolationForestOD | \n", "{'contamination': 0.1, 'n_estimators': 5, 'max_samples': 5, 'max_features': 0.472893264264607, 'bootstrap': False, 'behaviour': 'old'} | \n", "0.0005 | \n", "{'f1': 0.00046838407494145194} | \n", "0.1258 | \n", "0.3477 | \n", "Fri Apr 25 03:03:50 2025 | \n", "
Model Tuning | \n", "8544 | \n", "20 | \n", "IsolationForestOD | \n", "{'contamination': 0.1, 'n_estimators': 5, 'max_samples': 5, 'max_features': 0.472902764264607, 'bootstrap': False, 'behaviour': 'old'} | \n", "0.0005 | \n", "{'f1': 0.00046838407494145194} | \n", "0.1166 | \n", "0.3585 | \n", "Fri Apr 25 03:03:50 2025 | \n", "
\n", " | Feature | \n", "Attribution | \n", "Lower Bound | \n", "Upper Bound | \n", "
---|---|---|---|---|
0 | \n", "V19 | \n", "0.062594 | \n", "0.058448 | \n", "0.066740 | \n", "
1 | \n", "V8 | \n", "0.047495 | \n", "0.042024 | \n", "0.052967 | \n", "
2 | \n", "V4 | \n", "0.035441 | \n", "0.030222 | \n", "0.040659 | \n", "
3 | \n", "V3 | \n", "0.030964 | \n", "0.028117 | \n", "0.033810 | \n", "
4 | \n", "V14 | \n", "0.013733 | \n", "0.011846 | \n", "0.015620 | \n", "
12 | \n", "V11 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
18 | \n", "V18 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
17 | \n", "V17 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
16 | \n", "V16 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
15 | \n", "V15 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
14 | \n", "V13 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
13 | \n", "V12 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
10 | \n", "V9 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
11 | \n", "V10 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
9 | \n", "V7 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
8 | \n", "V6 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
7 | \n", "V5 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
6 | \n", "V2 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
5 | \n", "V1 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
19 | \n", "V20 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
\n | Prediction (True value: 0) | \n
---|---|
Original Sample | \nNormal | \n
Modified Sample | \nNormal | \n
\n | V1 | \nV2 | \nV3 | \nV4 | \nV5 | \nV6 | \nV7 | \nV8 | \nV9 | \nV10 | \nV11 | \nV12 | \nV13 | \nV14 | \nV15 | \nV16 | \nV17 | \nV18 | \nV19 | \nV20 | \n
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Original Sample | \n-0.814601292682208 | \n0.8527854763983154 | \n1.0423288727328561 | \n-2.2223952125512327 | \n0.28871233525783424 | \n-0.8395058532520351 | \n0.9928911115798961 | \n-0.20909651374437896 | \n0.7806740947971558 | \n-0.6137903575618552 | \n1.8301436434282867 | \n1.1944318873587512 | \n-0.12699362950573215 | \n0.16516219940938834 | \n0.4184581901658031 | \n-0.7801235968866925 | \n-0.4978313765414018 | \n-0.028500870424174533 | \n-0.27366085753472397 | \n0.12669591871187177 | \n
Modified Sample | \n-0.814601292682208 | \n0.8527854763983154 | \n1.0423288727328561 | \n-2.2223952125512327 | \n0.28871233525783424 | \n-0.8395058532520351 | \n0.9928911115798961 | \n-0.20909651374437896 | \n0.7806740947971558 | \n-0.6137903575618552 | \n1.8301436434282867 | \n1.1944318873587512 | \n-0.12699362950573215 | \n0.16516219940938834 | \n0.4184581901658031 | \n-0.7801235968866925 | \n-0.4978313765414018 | \n-0.028500870424174533 | \n-0.27366085753472397 | \n0.12669591871187177 | \n
\n | V1 | \nV2 | \nV3 | \nV4 | \nV5 | \nV6 | \nV7 | \nV8 | \nV9 | \nV10 | \nV11 | \nV12 | \nV13 | \nV14 | \nV15 | \nV16 | \nV17 | \nV18 | \nV19 | \nV20 | \n
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n-1.029585 | \n0.934110 | \n1.570084 | \n-0.621625 | \n-0.201677 | \n0.346878 | \n0.038430 | \n0.738376 | \n-0.380538 | \n-1.062647 | \n0.688214 | \n0.463036 | \n-0.561024 | \n0.600933 | \n0.419123 | \n0.406264 | \n-0.478982 | \n0.678764 | \n0.543911 | \n-0.072558 | \n
1 | \n-0.811720 | \n0.083970 | \n1.011055 | \n-0.425081 | \n0.987052 | \n-1.144410 | \n0.172823 | \n0.165016 | \n-0.299322 | \n-0.605959 | \n0.733559 | \n-0.213538 | \n-1.498916 | \n0.106064 | \n-0.227741 | \n1.038402 | \n-0.627842 | \n0.606285 | \n-0.512754 | \n-0.058735 | \n
2 | \n1.199349 | \n0.060077 | \n0.596956 | \n1.616322 | \n-0.132110 | \n0.582179 | \n-0.427010 | \n0.220856 | \n0.033758 | \n0.429056 | \n-1.374210 | \n-0.556287 | \n-0.592753 | \n-0.035459 | \n0.390634 | \n0.595673 | \n-0.321653 | \n-0.556582 | \n-0.630337 | \n-0.151199 | \n
3 | \n-0.383702 | \n1.010729 | \n1.715144 | \n1.216177 | \n0.164226 | \n-0.328318 | \n0.656598 | \n-0.051810 | \n-0.911027 | \n-0.205600 | \n0.221844 | \n0.610597 | \n1.072159 | \n0.143022 | \n1.392635 | \n-0.713962 | \n0.211990 | \n-0.554496 | \n0.203966 | \n0.125105 | \n
4 | \n2.178778 | \n-1.475489 | \n-0.695829 | \n-1.406909 | \n-1.514003 | \n-0.940760 | \n-1.022767 | \n-0.318466 | \n-1.242250 | \n1.509030 | \n-0.847194 | \n-0.261288 | \n1.381097 | \n-0.671105 | \n-0.224314 | \n-0.543437 | \n0.423996 | \n-0.159418 | \n-0.215030 | \n-0.270839 | \n
\n | V1 | \nV2 | \nV3 | \nV4 | \nV5 | \nV6 | \nV7 | \nV8 | \nV9 | \nV10 | \nV11 | \nV12 | \nV13 | \nV14 | \nV15 | \nV16 | \nV17 | \nV18 | \nV19 | \nV20 | \n
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Original Sample | \n-0.814601292682208 | \n0.8527854763983154 | \n1.0423288727328561 | \n-2.2223952125512327 | \n0.28871233525783424 | \n-0.8395058532520351 | \n0.9928911115798961 | \n-0.20909651374437896 | \n0.7806740947971558 | \n-0.6137903575618552 | \n1.8301436434282867 | \n1.1944318873587512 | \n-0.12699362950573215 | \n0.16516219940938834 | \n0.4184581901658031 | \n-0.7801235968866925 | \n-0.4978313765414018 | \n-0.028500870424174533 | \n-0.27366085753472397 | \n0.12669591871187177 | \n
Modified Sample | \n-0.8195973075521539 | \n0.8258281811402914 | \n1.1492178989013921 | \n-2.11301493636727 | \n0.28096492348525604 | \n-0.8289637892279351 | \n0.9239569002372758 | \n0.6267308703871985 | \n0.5965079515639202 | \n-0.6253149438613781 | \n1.828519947646691 | \n1.1650589176757253 | \n-0.12427833398317614 | \n0.2479554103817461 | \n0.38310734245838746 | \n-0.6167199744600596 | \n-0.48996835884172363 | \n-0.0312665834514463 | \n-0.5662567785776434 | \n0.10517011223668252 | \n
\n | Prediction (True value: Normal) | \n
---|---|
Original Sample | \nNormal | \n
Modified Sample | \nAnomaly | \n