{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "reserved-pursuit",
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "from library.analysis import runExerciseForSpheredNoise\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "e28fb5bb",
   "metadata": {},
   "outputs": [],
   "source": [
    "resultList = {}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "sweet-equivalent",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "///////////////////////////////////////////\n",
      "// Running SpheredNoise on folding_abalone_17_vs_7_8_9_10\n",
      "///////////////////////////////////////////\n",
      "\n",
      "-> Shuffling data\n",
      "### Start exercise for synthetic point generator\n",
      "\n",
      "====== Step 1/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 1/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/46 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 46 points min:0.02728552729928453 max:0.41828518979280144\n",
      "-> create 1778 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22804 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 450, 6\n",
      "LR fn, tp: 9, 3\n",
      "LR f1 score: 0.286\n",
      "LR cohens kappa score: 0.270\n",
      "LR average precision score: 0.323\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 455, 1\n",
      "GB fn, tp: 11, 1\n",
      "GB f1 score: 0.143\n",
      "GB cohens kappa score: 0.137\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 12, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/46 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 46 points min:0.02728552729928453 max:0.6446939196238787\n",
      "-> create 1778 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22868 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 449, 7\n",
      "LR fn, tp: 6, 6\n",
      "LR f1 score: 0.480\n",
      "LR cohens kappa score: 0.466\n",
      "LR average precision score: 0.604\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 452, 4\n",
      "GB fn, tp: 7, 5\n",
      "GB f1 score: 0.476\n",
      "GB cohens kappa score: 0.464\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 12, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/46 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 46 points min:0.02728552729928453 max:0.6966004952625284\n",
      "-> create 1778 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22728 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 454, 2\n",
      "LR fn, tp: 10, 2\n",
      "LR f1 score: 0.250\n",
      "LR cohens kappa score: 0.240\n",
      "LR average precision score: 0.329\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 454, 2\n",
      "GB fn, tp: 11, 1\n",
      "GB f1 score: 0.133\n",
      "GB cohens kappa score: 0.124\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 12, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/46 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 46 points min:0.02923183196448697 max:0.6446939196238787\n",
      "-> create 1778 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23396 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 453, 3\n",
      "LR fn, tp: 8, 4\n",
      "LR f1 score: 0.421\n",
      "LR cohens kappa score: 0.410\n",
      "LR average precision score: 0.530\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 455, 1\n",
      "GB fn, tp: 9, 3\n",
      "GB f1 score: 0.375\n",
      "GB cohens kappa score: 0.367\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 12, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/48 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 48 points min:0.030983866769659363 max:0.6446939196238787\n",
      "-> create 1776 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23100 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 452, 4\n",
      "LR fn, tp: 8, 2\n",
      "LR f1 score: 0.250\n",
      "LR cohens kappa score: 0.238\n",
      "LR average precision score: 0.304\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 452, 4\n",
      "GB fn, tp: 8, 2\n",
      "GB f1 score: 0.250\n",
      "GB cohens kappa score: 0.238\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 10, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "====== Step 2/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 2/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/46 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 46 points min:0.031772629730634515 max:0.6446939196238787\n",
      "-> create 1778 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22924 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 450, 6\n",
      "LR fn, tp: 8, 4\n",
      "LR f1 score: 0.364\n",
      "LR cohens kappa score: 0.348\n",
      "LR average precision score: 0.541\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 455, 1\n",
      "GB fn, tp: 10, 2\n",
      "GB f1 score: 0.267\n",
      "GB cohens kappa score: 0.259\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 12, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/46 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 46 points min:0.02728552729928453 max:0.6446939196238787\n",
      "-> create 1778 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22420 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 450, 6\n",
      "LR fn, tp: 7, 5\n",
      "LR f1 score: 0.435\n",
      "LR cohens kappa score: 0.421\n",
      "LR average precision score: 0.535\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 453, 3\n",
      "GB fn, tp: 8, 4\n",
      "GB f1 score: 0.421\n",
      "GB cohens kappa score: 0.410\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 12, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/46 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 46 points min:0.02923183196448697 max:0.6446939196238787\n",
      "-> create 1778 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23268 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 453, 3\n",
      "LR fn, tp: 10, 2\n",
      "LR f1 score: 0.235\n",
      "LR cohens kappa score: 0.224\n",
      "LR average precision score: 0.196\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 454, 2\n",
      "GB fn, tp: 10, 2\n",
      "GB f1 score: 0.250\n",
      "GB cohens kappa score: 0.240\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 12, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/46 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 46 points min:0.02728552729928453 max:0.6966004952625284\n",
      "-> create 1778 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22928 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 454, 2\n",
      "LR fn, tp: 8, 4\n",
      "LR f1 score: 0.444\n",
      "LR cohens kappa score: 0.435\n",
      "LR average precision score: 0.430\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 455, 1\n",
      "GB fn, tp: 9, 3\n",
      "GB f1 score: 0.375\n",
      "GB cohens kappa score: 0.367\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 12, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/48 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 48 points min:0.02728552729928453 max:0.37681593649950645\n",
      "-> create 1776 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23280 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 452, 4\n",
      "LR fn, tp: 7, 3\n",
      "LR f1 score: 0.353\n",
      "LR cohens kappa score: 0.341\n",
      "LR average precision score: 0.379\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 453, 3\n",
      "GB fn, tp: 8, 2\n",
      "GB f1 score: 0.267\n",
      "GB cohens kappa score: 0.256\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 10, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "====== Step 3/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 3/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/46 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 46 points min:0.02728552729928453 max:0.35035874471746814\n",
      "-> create 1778 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23656 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 454, 2\n",
      "LR fn, tp: 6, 6\n",
      "LR f1 score: 0.600\n",
      "LR cohens kappa score: 0.592\n",
      "LR average precision score: 0.552\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 454, 2\n",
      "GB fn, tp: 9, 3\n",
      "GB f1 score: 0.353\n",
      "GB cohens kappa score: 0.343\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 12, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/46 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 46 points min:0.02728552729928453 max:0.6966004952625284\n",
      "-> create 1778 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23188 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 452, 4\n",
      "LR fn, tp: 10, 2\n",
      "LR f1 score: 0.222\n",
      "LR cohens kappa score: 0.209\n",
      "LR average precision score: 0.369\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 453, 3\n",
      "GB fn, tp: 10, 2\n",
      "GB f1 score: 0.235\n",
      "GB cohens kappa score: 0.224\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 12, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/46 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 46 points min:0.02728552729928453 max:0.6446939196238787\n",
      "-> create 1778 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22796 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 452, 4\n",
      "LR fn, tp: 9, 3\n",
      "LR f1 score: 0.316\n",
      "LR cohens kappa score: 0.303\n",
      "LR average precision score: 0.454\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 454, 2\n",
      "GB fn, tp: 10, 2\n",
      "GB f1 score: 0.250\n",
      "GB cohens kappa score: 0.240\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 12, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/46 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 46 points min:0.030983866769659363 max:0.6446939196238787\n",
      "-> create 1778 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23188 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 452, 4\n",
      "LR fn, tp: 10, 2\n",
      "LR f1 score: 0.222\n",
      "LR cohens kappa score: 0.209\n",
      "LR average precision score: 0.248\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 453, 3\n",
      "GB fn, tp: 12, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.010\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 12, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/48 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 48 points min:0.02923183196448697 max:0.6446939196238787\n",
      "-> create 1776 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23268 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 451, 5\n",
      "LR fn, tp: 5, 5\n",
      "LR f1 score: 0.500\n",
      "LR cohens kappa score: 0.489\n",
      "LR average precision score: 0.530\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 453, 3\n",
      "GB fn, tp: 7, 3\n",
      "GB f1 score: 0.375\n",
      "GB cohens kappa score: 0.365\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 10, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "====== Step 4/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 4/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/46 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 46 points min:0.02728552729928453 max:0.37681593649950645\n",
      "-> create 1778 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23736 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 447, 9\n",
      "LR fn, tp: 5, 7\n",
      "LR f1 score: 0.500\n",
      "LR cohens kappa score: 0.485\n",
      "LR average precision score: 0.567\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 455, 1\n",
      "GB fn, tp: 10, 2\n",
      "GB f1 score: 0.267\n",
      "GB cohens kappa score: 0.259\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 12, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/46 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 46 points min:0.02728552729928453 max:0.6446939196238787\n",
      "-> create 1778 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23032 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 453, 3\n",
      "LR fn, tp: 7, 5\n",
      "LR f1 score: 0.500\n",
      "LR cohens kappa score: 0.490\n",
      "LR average precision score: 0.541\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 454, 2\n",
      "GB fn, tp: 9, 3\n",
      "GB f1 score: 0.353\n",
      "GB cohens kappa score: 0.343\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 12, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/46 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 46 points min:0.02923183196448697 max:0.6966004952625284\n",
      "-> create 1778 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22984 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 454, 2\n",
      "LR fn, tp: 10, 2\n",
      "LR f1 score: 0.250\n",
      "LR cohens kappa score: 0.240\n",
      "LR average precision score: 0.279\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 454, 2\n",
      "GB fn, tp: 12, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.007\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 12, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/46 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 46 points min:0.02728552729928453 max:0.6446939196238787\n",
      "-> create 1778 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22680 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 454, 2\n",
      "LR fn, tp: 10, 2\n",
      "LR f1 score: 0.250\n",
      "LR cohens kappa score: 0.240\n",
      "LR average precision score: 0.415\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 452, 4\n",
      "GB fn, tp: 11, 1\n",
      "GB f1 score: 0.118\n",
      "GB cohens kappa score: 0.104\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 12, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/48 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 48 points min:0.02728552729928453 max:0.6446939196238787\n",
      "-> create 1776 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22804 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 455, 1\n",
      "LR fn, tp: 8, 2\n",
      "LR f1 score: 0.308\n",
      "LR cohens kappa score: 0.301\n",
      "LR average precision score: 0.295\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 453, 3\n",
      "GB fn, tp: 8, 2\n",
      "GB f1 score: 0.267\n",
      "GB cohens kappa score: 0.256\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 10, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "====== Step 5/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 5/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/46 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 46 points min:0.02728552729928453 max:0.6446939196238787\n",
      "-> create 1778 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22932 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 452, 4\n",
      "LR fn, tp: 8, 4\n",
      "LR f1 score: 0.400\n",
      "LR cohens kappa score: 0.387\n",
      "LR average precision score: 0.397\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 453, 3\n",
      "GB fn, tp: 10, 2\n",
      "GB f1 score: 0.235\n",
      "GB cohens kappa score: 0.224\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 12, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/46 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 46 points min:0.02728552729928453 max:0.6966004952625284\n",
      "-> create 1778 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22716 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 450, 6\n",
      "LR fn, tp: 10, 2\n",
      "LR f1 score: 0.200\n",
      "LR cohens kappa score: 0.183\n",
      "LR average precision score: 0.160\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 454, 2\n",
      "GB fn, tp: 12, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.007\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 12, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/46 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 46 points min:0.02923183196448697 max:0.6446939196238787\n",
      "-> create 1778 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23340 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 450, 6\n",
      "LR fn, tp: 9, 3\n",
      "LR f1 score: 0.286\n",
      "LR cohens kappa score: 0.270\n",
      "LR average precision score: 0.398\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 453, 3\n",
      "GB fn, tp: 10, 2\n",
      "GB f1 score: 0.235\n",
      "GB cohens kappa score: 0.224\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 12, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/46 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 46 points min:0.030983866769659363 max:0.19717631703630123\n",
      "-> create 1778 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23448 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 456, 0\n",
      "LR fn, tp: 8, 4\n",
      "LR f1 score: 0.500\n",
      "LR cohens kappa score: 0.494\n",
      "LR average precision score: 0.661\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 454, 2\n",
      "GB fn, tp: 9, 3\n",
      "GB f1 score: 0.353\n",
      "GB cohens kappa score: 0.343\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 12, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1824/48 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 48 points min:0.02728552729928453 max:0.6446939196238787\n",
      "-> create 1776 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23036 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 453, 3\n",
      "LR fn, tp: 6, 4\n",
      "LR f1 score: 0.471\n",
      "LR cohens kappa score: 0.461\n",
      "LR average precision score: 0.472\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 452, 4\n",
      "GB fn, tp: 7, 3\n",
      "GB f1 score: 0.353\n",
      "GB cohens kappa score: 0.341\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 10, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "### Exercise is done.\n",
      "\n",
      "-----[ LR ]-----\n",
      "maximum:\n",
      "LR tn, fp: 456, 9\n",
      "LR fn, tp: 10, 7\n",
      "LR f1 score: 0.600\n",
      "LR cohens kappa score: 0.592\n",
      "LR average precision score: 0.661\n",
      "\n",
      "\n",
      "average:\n",
      "LR tn, fp: 452.08, 3.92\n",
      "LR fn, tp: 8.08, 3.52\n",
      "LR f1 score: 0.362\n",
      "LR cohens kappa score: 0.350\n",
      "LR average precision score: 0.420\n",
      "\n",
      "\n",
      "minimum:\n",
      "LR tn, fp: 447, 0\n",
      "LR fn, tp: 5, 2\n",
      "LR f1 score: 0.200\n",
      "LR cohens kappa score: 0.183\n",
      "LR average precision score: 0.160\n",
      "\n",
      "\n",
      "-----[ GB ]-----\n",
      "maximum:\n",
      "GB tn, fp: 455, 4\n",
      "GB fn, tp: 12, 5\n",
      "GB f1 score: 0.476\n",
      "GB cohens kappa score: 0.464\n",
      "\n",
      "\n",
      "average:\n",
      "GB tn, fp: 453.56, 2.44\n",
      "GB fn, tp: 9.48, 2.12\n",
      "GB f1 score: 0.254\n",
      "GB cohens kappa score: 0.244\n",
      "\n",
      "\n",
      "minimum:\n",
      "GB tn, fp: 452, 1\n",
      "GB fn, tp: 7, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.010\n",
      "\n",
      "\n",
      "-----[ KNN ]-----\n",
      "maximum:\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 12, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "average:\n",
      "KNN tn, fp: 456.0, 0.0\n",
      "KNN fn, tp: 11.6, 0.0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "minimum:\n",
      "KNN tn, fp: 456, 0\n",
      "KNN fn, tp: 10, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n"
     ]
    }
   ],
   "source": [
    "runExerciseForSpheredNoise(\"folding_abalone_17_vs_7_8_9_10\", resultList)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "graphic-fancy",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "///////////////////////////////////////////\n",
      "// Running SpheredNoise on folding_abalone9-18\n",
      "///////////////////////////////////////////\n",
      "\n",
      "-> Shuffling data\n",
      "### Start exercise for synthetic point generator\n",
      "\n",
      "====== Step 1/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 1/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 551/33 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 33 points min:0.03211308144666282 max:0.3975704340113837\n",
      "-> create 518 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 19000 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 137, 1\n",
      "LR fn, tp: 3, 6\n",
      "LR f1 score: 0.750\n",
      "LR cohens kappa score: 0.736\n",
      "LR average precision score: 0.828\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 134, 4\n",
      "GB fn, tp: 4, 5\n",
      "GB f1 score: 0.556\n",
      "GB cohens kappa score: 0.527\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 138, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 551/33 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 33 points min:0.03311344137959691 max:0.6176281243596343\n",
      "-> create 518 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 19100 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 135, 3\n",
      "LR fn, tp: 5, 4\n",
      "LR f1 score: 0.500\n",
      "LR cohens kappa score: 0.472\n",
      "LR average precision score: 0.499\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 136, 2\n",
      "GB fn, tp: 6, 3\n",
      "GB f1 score: 0.429\n",
      "GB cohens kappa score: 0.402\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 138, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 551/33 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 33 points min:0.03211308144666282 max:0.6176281243596343\n",
      "-> create 518 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 18500 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 136, 2\n",
      "LR fn, tp: 5, 4\n",
      "LR f1 score: 0.533\n",
      "LR cohens kappa score: 0.509\n",
      "LR average precision score: 0.710\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 137, 1\n",
      "GB fn, tp: 6, 3\n",
      "GB f1 score: 0.462\n",
      "GB cohens kappa score: 0.440\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 138, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 551/33 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 33 points min:0.03211308144666282 max:0.6176281243596343\n",
      "-> create 518 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 19556 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 137, 1\n",
      "LR fn, tp: 6, 3\n",
      "LR f1 score: 0.462\n",
      "LR cohens kappa score: 0.440\n",
      "LR average precision score: 0.619\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 137, 1\n",
      "GB fn, tp: 5, 4\n",
      "GB f1 score: 0.571\n",
      "GB cohens kappa score: 0.552\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 138, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 552/36 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 36 points min:0.03211308144666282 max:0.6863390197271315\n",
      "-> create 516 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 19028 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 134, 3\n",
      "LR fn, tp: 3, 3\n",
      "LR f1 score: 0.500\n",
      "LR cohens kappa score: 0.478\n",
      "LR average precision score: 0.498\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 136, 1\n",
      "GB fn, tp: 6, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.012\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 137, 0\n",
      "KNN fn, tp: 6, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "====== Step 2/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 2/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 551/33 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 33 points min:0.03311344137959691 max:0.6176281243596343\n",
      "-> create 518 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 18400 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 136, 2\n",
      "LR fn, tp: 5, 4\n",
      "LR f1 score: 0.533\n",
      "LR cohens kappa score: 0.509\n",
      "LR average precision score: 0.667\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 134, 4\n",
      "GB fn, tp: 7, 2\n",
      "GB f1 score: 0.267\n",
      "GB cohens kappa score: 0.229\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 138, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 551/33 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 33 points min:0.03311344137959691 max:0.6176281243596343\n",
      "-> create 518 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 19144 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 136, 2\n",
      "LR fn, tp: 3, 6\n",
      "LR f1 score: 0.706\n",
      "LR cohens kappa score: 0.688\n",
      "LR average precision score: 0.726\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 136, 2\n",
      "GB fn, tp: 5, 4\n",
      "GB f1 score: 0.533\n",
      "GB cohens kappa score: 0.509\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 138, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 551/33 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 33 points min:0.03211308144666282 max:0.3752825602129679\n",
      "-> create 518 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 19616 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 136, 2\n",
      "LR fn, tp: 6, 3\n",
      "LR f1 score: 0.429\n",
      "LR cohens kappa score: 0.402\n",
      "LR average precision score: 0.535\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 136, 2\n",
      "GB fn, tp: 6, 3\n",
      "GB f1 score: 0.429\n",
      "GB cohens kappa score: 0.402\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 138, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 551/33 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 33 points min:0.03211308144666282 max:0.6176281243596343\n",
      "-> create 518 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 18932 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 136, 2\n",
      "LR fn, tp: 6, 3\n",
      "LR f1 score: 0.429\n",
      "LR cohens kappa score: 0.402\n",
      "LR average precision score: 0.675\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 136, 2\n",
      "GB fn, tp: 5, 4\n",
      "GB f1 score: 0.533\n",
      "GB cohens kappa score: 0.509\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 138, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 552/36 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 36 points min:0.03211308144666282 max:0.6176281243596343\n",
      "-> create 516 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 19052 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 134, 3\n",
      "LR fn, tp: 2, 4\n",
      "LR f1 score: 0.615\n",
      "LR cohens kappa score: 0.597\n",
      "LR average precision score: 0.510\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 136, 1\n",
      "GB fn, tp: 3, 3\n",
      "GB f1 score: 0.600\n",
      "GB cohens kappa score: 0.586\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 137, 0\n",
      "KNN fn, tp: 6, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "====== Step 3/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 3/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 551/33 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 33 points min:0.03211308144666282 max:0.6176281243596343\n",
      "-> create 518 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 19352 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 134, 4\n",
      "LR fn, tp: 6, 3\n",
      "LR f1 score: 0.375\n",
      "LR cohens kappa score: 0.340\n",
      "LR average precision score: 0.501\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 135, 3\n",
      "GB fn, tp: 8, 1\n",
      "GB f1 score: 0.154\n",
      "GB cohens kappa score: 0.121\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 138, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 551/33 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 33 points min:0.03211308144666282 max:0.6176281243596343\n",
      "-> create 518 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 19332 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 137, 1\n",
      "LR fn, tp: 4, 5\n",
      "LR f1 score: 0.667\n",
      "LR cohens kappa score: 0.649\n",
      "LR average precision score: 0.766\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 137, 1\n",
      "GB fn, tp: 7, 2\n",
      "GB f1 score: 0.333\n",
      "GB cohens kappa score: 0.312\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 138, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 551/33 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 33 points min:0.03311344137959691 max:0.6176281243596343\n",
      "-> create 518 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 18916 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 136, 2\n",
      "LR fn, tp: 5, 4\n",
      "LR f1 score: 0.533\n",
      "LR cohens kappa score: 0.509\n",
      "LR average precision score: 0.587\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 138, 0\n",
      "GB fn, tp: 7, 2\n",
      "GB f1 score: 0.364\n",
      "GB cohens kappa score: 0.349\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 138, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 551/33 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 33 points min:0.03211308144666282 max:0.6610300673948196\n",
      "-> create 518 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 18824 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 135, 3\n",
      "LR fn, tp: 3, 6\n",
      "LR f1 score: 0.667\n",
      "LR cohens kappa score: 0.645\n",
      "LR average precision score: 0.630\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 137, 1\n",
      "GB fn, tp: 4, 5\n",
      "GB f1 score: 0.667\n",
      "GB cohens kappa score: 0.649\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 138, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 552/36 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 36 points min:0.0358887168898527 max:0.4738359420727812\n",
      "-> create 516 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 18468 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 135, 2\n",
      "LR fn, tp: 4, 2\n",
      "LR f1 score: 0.400\n",
      "LR cohens kappa score: 0.379\n",
      "LR average precision score: 0.581\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 134, 3\n",
      "GB fn, tp: 4, 2\n",
      "GB f1 score: 0.364\n",
      "GB cohens kappa score: 0.338\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 137, 0\n",
      "KNN fn, tp: 6, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "====== Step 4/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 4/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 551/33 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 33 points min:0.03311344137959691 max:0.6176281243596343\n",
      "-> create 518 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 19244 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 134, 4\n",
      "LR fn, tp: 5, 4\n",
      "LR f1 score: 0.471\n",
      "LR cohens kappa score: 0.438\n",
      "LR average precision score: 0.524\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 134, 4\n",
      "GB fn, tp: 6, 3\n",
      "GB f1 score: 0.375\n",
      "GB cohens kappa score: 0.340\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 138, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 551/33 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 33 points min:0.03311344137959691 max:0.3975704340113837\n",
      "-> create 518 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 18792 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 137, 1\n",
      "LR fn, tp: 5, 4\n",
      "LR f1 score: 0.571\n",
      "LR cohens kappa score: 0.552\n",
      "LR average precision score: 0.605\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 132, 6\n",
      "GB fn, tp: 5, 4\n",
      "GB f1 score: 0.421\n",
      "GB cohens kappa score: 0.381\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 138, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 551/33 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 33 points min:0.03211308144666282 max:0.6176281243596343\n",
      "-> create 518 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 19152 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 137, 1\n",
      "LR fn, tp: 4, 5\n",
      "LR f1 score: 0.667\n",
      "LR cohens kappa score: 0.649\n",
      "LR average precision score: 0.608\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 134, 4\n",
      "GB fn, tp: 6, 3\n",
      "GB f1 score: 0.375\n",
      "GB cohens kappa score: 0.340\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 138, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 551/33 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 33 points min:0.03211308144666282 max:0.6176281243596343\n",
      "-> create 518 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 18840 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 137, 1\n",
      "LR fn, tp: 5, 4\n",
      "LR f1 score: 0.571\n",
      "LR cohens kappa score: 0.552\n",
      "LR average precision score: 0.805\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 137, 1\n",
      "GB fn, tp: 7, 2\n",
      "GB f1 score: 0.333\n",
      "GB cohens kappa score: 0.312\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 138, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 552/36 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 36 points min:0.03211308144666282 max:0.6610300673948196\n",
      "-> create 516 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 18988 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 135, 2\n",
      "LR fn, tp: 4, 2\n",
      "LR f1 score: 0.400\n",
      "LR cohens kappa score: 0.379\n",
      "LR average precision score: 0.439\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 135, 2\n",
      "GB fn, tp: 5, 1\n",
      "GB f1 score: 0.222\n",
      "GB cohens kappa score: 0.200\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 137, 0\n",
      "KNN fn, tp: 6, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "====== Step 5/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 5/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 551/33 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 33 points min:0.03211308144666282 max:0.4217019089356842\n",
      "-> create 518 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 18928 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 133, 5\n",
      "LR fn, tp: 3, 6\n",
      "LR f1 score: 0.600\n",
      "LR cohens kappa score: 0.571\n",
      "LR average precision score: 0.707\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 135, 3\n",
      "GB fn, tp: 6, 3\n",
      "GB f1 score: 0.400\n",
      "GB cohens kappa score: 0.369\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 138, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 551/33 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 33 points min:0.03211308144666282 max:0.6610300673948196\n",
      "-> create 518 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 19124 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 136, 2\n",
      "LR fn, tp: 4, 5\n",
      "LR f1 score: 0.625\n",
      "LR cohens kappa score: 0.604\n",
      "LR average precision score: 0.715\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 136, 2\n",
      "GB fn, tp: 7, 2\n",
      "GB f1 score: 0.308\n",
      "GB cohens kappa score: 0.281\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 138, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 551/33 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 33 points min:0.037393181196576475 max:0.6176281243596343\n",
      "-> create 518 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 18940 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 135, 3\n",
      "LR fn, tp: 6, 3\n",
      "LR f1 score: 0.400\n",
      "LR cohens kappa score: 0.369\n",
      "LR average precision score: 0.479\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 136, 2\n",
      "GB fn, tp: 6, 3\n",
      "GB f1 score: 0.429\n",
      "GB cohens kappa score: 0.402\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 138, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 551/33 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 33 points min:0.03211308144666282 max:0.6176281243596343\n",
      "-> create 518 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 19144 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 137, 1\n",
      "LR fn, tp: 5, 4\n",
      "LR f1 score: 0.571\n",
      "LR cohens kappa score: 0.552\n",
      "LR average precision score: 0.711\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 138, 0\n",
      "GB fn, tp: 6, 3\n",
      "GB f1 score: 0.500\n",
      "GB cohens kappa score: 0.484\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 138, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 552/36 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 36 points min:0.03311344137959691 max:0.6176281243596343\n",
      "-> create 516 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 18692 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 137, 0\n",
      "LR fn, tp: 3, 3\n",
      "LR f1 score: 0.667\n",
      "LR cohens kappa score: 0.657\n",
      "LR average precision score: 0.788\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 136, 1\n",
      "GB fn, tp: 3, 3\n",
      "GB f1 score: 0.600\n",
      "GB cohens kappa score: 0.586\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 137, 0\n",
      "KNN fn, tp: 6, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "### Exercise is done.\n",
      "\n",
      "-----[ LR ]-----\n",
      "maximum:\n",
      "LR tn, fp: 137, 5\n",
      "LR fn, tp: 6, 6\n",
      "LR f1 score: 0.750\n",
      "LR cohens kappa score: 0.736\n",
      "LR average precision score: 0.828\n",
      "\n",
      "\n",
      "average:\n",
      "LR tn, fp: 135.68, 2.12\n",
      "LR fn, tp: 4.4, 4.0\n",
      "LR f1 score: 0.546\n",
      "LR cohens kappa score: 0.523\n",
      "LR average precision score: 0.629\n",
      "\n",
      "\n",
      "minimum:\n",
      "LR tn, fp: 133, 0\n",
      "LR fn, tp: 2, 2\n",
      "LR f1 score: 0.375\n",
      "LR cohens kappa score: 0.340\n",
      "LR average precision score: 0.439\n",
      "\n",
      "\n",
      "-----[ GB ]-----\n",
      "maximum:\n",
      "GB tn, fp: 138, 6\n",
      "GB fn, tp: 8, 5\n",
      "GB f1 score: 0.667\n",
      "GB cohens kappa score: 0.649\n",
      "\n",
      "\n",
      "average:\n",
      "GB tn, fp: 135.68, 2.12\n",
      "GB fn, tp: 5.6, 2.8\n",
      "GB f1 score: 0.409\n",
      "GB cohens kappa score: 0.384\n",
      "\n",
      "\n",
      "minimum:\n",
      "GB tn, fp: 132, 0\n",
      "GB fn, tp: 3, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.012\n",
      "\n",
      "\n",
      "-----[ KNN ]-----\n",
      "maximum:\n",
      "KNN tn, fp: 138, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "average:\n",
      "KNN tn, fp: 137.8, 0.0\n",
      "KNN fn, tp: 8.4, 0.0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "minimum:\n",
      "KNN tn, fp: 137, 0\n",
      "KNN fn, tp: 6, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n"
     ]
    }
   ],
   "source": [
    "runExerciseForSpheredNoise(\"folding_abalone9-18\", resultList)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "fiscal-villa",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "///////////////////////////////////////////\n",
      "// Running SpheredNoise on folding_car_good\n",
      "///////////////////////////////////////////\n",
      "\n",
      "-> Shuffling data\n",
      "### Start exercise for synthetic point generator\n",
      "\n",
      "====== Step 1/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 1/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1327/55 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 55 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26888 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 313, 19\n",
      "LR fn, tp: 14, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.049\n",
      "LR average precision score: 0.038\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 332, 0\n",
      "GB fn, tp: 4, 10\n",
      "GB f1 score: 0.833\n",
      "GB cohens kappa score: 0.828\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 329, 3\n",
      "KNN fn, tp: 12, 2\n",
      "KNN f1 score: 0.211\n",
      "KNN cohens kappa score: 0.193\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1327/55 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 55 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 27120 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 314, 18\n",
      "LR fn, tp: 14, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.048\n",
      "LR average precision score: 0.033\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 332, 0\n",
      "GB fn, tp: 2, 12\n",
      "GB f1 score: 0.923\n",
      "GB cohens kappa score: 0.920\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 331, 1\n",
      "KNN fn, tp: 13, 1\n",
      "KNN f1 score: 0.125\n",
      "KNN cohens kappa score: 0.116\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1327/55 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 55 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26896 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 313, 19\n",
      "LR fn, tp: 14, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.049\n",
      "LR average precision score: 0.043\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 331, 1\n",
      "GB fn, tp: 5, 9\n",
      "GB f1 score: 0.750\n",
      "GB cohens kappa score: 0.741\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 329, 3\n",
      "KNN fn, tp: 11, 3\n",
      "KNN f1 score: 0.300\n",
      "KNN cohens kappa score: 0.283\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1327/55 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 55 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26892 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 311, 21\n",
      "LR fn, tp: 14, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.051\n",
      "LR average precision score: 0.038\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 332, 0\n",
      "GB fn, tp: 8, 6\n",
      "GB f1 score: 0.600\n",
      "GB cohens kappa score: 0.590\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 329, 3\n",
      "KNN fn, tp: 14, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: -0.014\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1328/56 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 56 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 28436 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 311, 20\n",
      "LR fn, tp: 13, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.048\n",
      "LR average precision score: 0.047\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 328, 3\n",
      "GB fn, tp: 2, 11\n",
      "GB f1 score: 0.815\n",
      "GB cohens kappa score: 0.807\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 330, 1\n",
      "KNN fn, tp: 13, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: -0.005\n",
      "\n",
      "\n",
      "====== Step 2/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 2/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1327/55 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 55 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 28188 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 312, 20\n",
      "LR fn, tp: 14, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.050\n",
      "LR average precision score: 0.041\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 331, 1\n",
      "GB fn, tp: 7, 7\n",
      "GB f1 score: 0.636\n",
      "GB cohens kappa score: 0.625\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 329, 3\n",
      "KNN fn, tp: 12, 2\n",
      "KNN f1 score: 0.211\n",
      "KNN cohens kappa score: 0.193\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1327/55 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 55 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26388 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 317, 15\n",
      "LR fn, tp: 14, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.044\n",
      "LR average precision score: 0.035\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 332, 0\n",
      "GB fn, tp: 1, 13\n",
      "GB f1 score: 0.963\n",
      "GB cohens kappa score: 0.961\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 330, 2\n",
      "KNN fn, tp: 12, 2\n",
      "KNN f1 score: 0.222\n",
      "KNN cohens kappa score: 0.208\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1327/55 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 55 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 27148 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 316, 16\n",
      "LR fn, tp: 14, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.045\n",
      "LR average precision score: 0.043\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 332, 0\n",
      "GB fn, tp: 8, 6\n",
      "GB f1 score: 0.600\n",
      "GB cohens kappa score: 0.590\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 331, 1\n",
      "KNN fn, tp: 12, 2\n",
      "KNN f1 score: 0.235\n",
      "KNN cohens kappa score: 0.224\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1327/55 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 55 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26708 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 313, 19\n",
      "LR fn, tp: 14, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.049\n",
      "LR average precision score: 0.040\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 331, 1\n",
      "GB fn, tp: 5, 9\n",
      "GB f1 score: 0.750\n",
      "GB cohens kappa score: 0.741\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 332, 0\n",
      "KNN fn, tp: 14, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1328/56 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 56 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26064 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 307, 24\n",
      "LR fn, tp: 13, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.052\n",
      "LR average precision score: 0.039\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 330, 1\n",
      "GB fn, tp: 3, 10\n",
      "GB f1 score: 0.833\n",
      "GB cohens kappa score: 0.827\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 327, 4\n",
      "KNN fn, tp: 12, 1\n",
      "KNN f1 score: 0.111\n",
      "KNN cohens kappa score: 0.092\n",
      "\n",
      "\n",
      "====== Step 3/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 3/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1327/55 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 55 points min:1.0 max:1.4142135623730951\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26624 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 312, 20\n",
      "LR fn, tp: 14, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.050\n",
      "LR average precision score: 0.039\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 332, 0\n",
      "GB fn, tp: 3, 11\n",
      "GB f1 score: 0.880\n",
      "GB cohens kappa score: 0.876\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 330, 2\n",
      "KNN fn, tp: 13, 1\n",
      "KNN f1 score: 0.118\n",
      "KNN cohens kappa score: 0.105\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1327/55 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 55 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 28688 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 315, 17\n",
      "LR fn, tp: 14, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.046\n",
      "LR average precision score: 0.045\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 330, 2\n",
      "GB fn, tp: 5, 9\n",
      "GB f1 score: 0.720\n",
      "GB cohens kappa score: 0.710\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 330, 2\n",
      "KNN fn, tp: 10, 4\n",
      "KNN f1 score: 0.400\n",
      "KNN cohens kappa score: 0.385\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1327/55 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 55 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26536 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 317, 15\n",
      "LR fn, tp: 14, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.044\n",
      "LR average precision score: 0.039\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 331, 1\n",
      "GB fn, tp: 6, 8\n",
      "GB f1 score: 0.696\n",
      "GB cohens kappa score: 0.686\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 328, 4\n",
      "KNN fn, tp: 14, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: -0.018\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1327/55 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 55 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22744 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 318, 14\n",
      "LR fn, tp: 14, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.042\n",
      "LR average precision score: 0.037\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 331, 1\n",
      "GB fn, tp: 6, 8\n",
      "GB f1 score: 0.696\n",
      "GB cohens kappa score: 0.686\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 330, 2\n",
      "KNN fn, tp: 13, 1\n",
      "KNN f1 score: 0.118\n",
      "KNN cohens kappa score: 0.105\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1328/56 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 56 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 29168 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 303, 28\n",
      "LR fn, tp: 13, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.054\n",
      "LR average precision score: 0.037\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 328, 3\n",
      "GB fn, tp: 5, 8\n",
      "GB f1 score: 0.667\n",
      "GB cohens kappa score: 0.655\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 329, 2\n",
      "KNN fn, tp: 9, 4\n",
      "KNN f1 score: 0.421\n",
      "KNN cohens kappa score: 0.407\n",
      "\n",
      "\n",
      "====== Step 4/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 4/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1327/55 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 55 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26136 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 310, 22\n",
      "LR fn, tp: 14, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.052\n",
      "LR average precision score: 0.041\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 332, 0\n",
      "GB fn, tp: 2, 12\n",
      "GB f1 score: 0.923\n",
      "GB cohens kappa score: 0.920\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 329, 3\n",
      "KNN fn, tp: 13, 1\n",
      "KNN f1 score: 0.111\n",
      "KNN cohens kappa score: 0.095\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1327/55 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 55 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 20624 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 319, 13\n",
      "LR fn, tp: 14, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.041\n",
      "LR average precision score: 0.037\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 332, 0\n",
      "GB fn, tp: 7, 7\n",
      "GB f1 score: 0.667\n",
      "GB cohens kappa score: 0.657\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 331, 1\n",
      "KNN fn, tp: 13, 1\n",
      "KNN f1 score: 0.125\n",
      "KNN cohens kappa score: 0.116\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1327/55 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 55 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 27436 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 316, 16\n",
      "LR fn, tp: 14, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.045\n",
      "LR average precision score: 0.037\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 332, 0\n",
      "GB fn, tp: 8, 6\n",
      "GB f1 score: 0.600\n",
      "GB cohens kappa score: 0.590\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 329, 3\n",
      "KNN fn, tp: 12, 2\n",
      "KNN f1 score: 0.211\n",
      "KNN cohens kappa score: 0.193\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1327/55 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 55 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24928 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 308, 24\n",
      "LR fn, tp: 14, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.054\n",
      "LR average precision score: 0.037\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 331, 1\n",
      "GB fn, tp: 2, 12\n",
      "GB f1 score: 0.889\n",
      "GB cohens kappa score: 0.884\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 327, 5\n",
      "KNN fn, tp: 11, 3\n",
      "KNN f1 score: 0.273\n",
      "KNN cohens kappa score: 0.251\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1328/56 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 56 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26536 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 313, 18\n",
      "LR fn, tp: 13, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.046\n",
      "LR average precision score: 0.046\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 330, 1\n",
      "GB fn, tp: 4, 9\n",
      "GB f1 score: 0.783\n",
      "GB cohens kappa score: 0.775\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 328, 3\n",
      "KNN fn, tp: 12, 1\n",
      "KNN f1 score: 0.118\n",
      "KNN cohens kappa score: 0.102\n",
      "\n",
      "\n",
      "====== Step 5/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 5/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1327/55 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 55 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26216 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 309, 23\n",
      "LR fn, tp: 14, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.053\n",
      "LR average precision score: 0.035\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 332, 0\n",
      "GB fn, tp: 6, 8\n",
      "GB f1 score: 0.727\n",
      "GB cohens kappa score: 0.719\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 329, 3\n",
      "KNN fn, tp: 13, 1\n",
      "KNN f1 score: 0.111\n",
      "KNN cohens kappa score: 0.095\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1327/55 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 55 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 28540 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 317, 15\n",
      "LR fn, tp: 14, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.044\n",
      "LR average precision score: 0.041\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 331, 1\n",
      "GB fn, tp: 4, 10\n",
      "GB f1 score: 0.800\n",
      "GB cohens kappa score: 0.793\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 331, 1\n",
      "KNN fn, tp: 13, 1\n",
      "KNN f1 score: 0.125\n",
      "KNN cohens kappa score: 0.116\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1327/55 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 55 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25792 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 318, 14\n",
      "LR fn, tp: 14, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.042\n",
      "LR average precision score: 0.043\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 331, 1\n",
      "GB fn, tp: 6, 8\n",
      "GB f1 score: 0.696\n",
      "GB cohens kappa score: 0.686\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 329, 3\n",
      "KNN fn, tp: 11, 3\n",
      "KNN f1 score: 0.300\n",
      "KNN cohens kappa score: 0.283\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1327/55 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 55 points min:1.0 max:1.0\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 27812 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 311, 21\n",
      "LR fn, tp: 14, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.051\n",
      "LR average precision score: 0.045\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 332, 0\n",
      "GB fn, tp: 7, 7\n",
      "GB f1 score: 0.667\n",
      "GB cohens kappa score: 0.657\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 329, 3\n",
      "KNN fn, tp: 14, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: -0.014\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1328/56 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 56 points min:1.0 max:1.4142135623730951\n",
      "-> create 1272 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25892 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 310, 21\n",
      "LR fn, tp: 13, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.049\n",
      "LR average precision score: 0.034\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 331, 0\n",
      "GB fn, tp: 0, 13\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 331, 0\n",
      "KNN fn, tp: 12, 1\n",
      "KNN f1 score: 0.143\n",
      "KNN cohens kappa score: 0.138\n",
      "\n",
      "### Exercise is done.\n",
      "\n",
      "-----[ LR ]-----\n",
      "maximum:\n",
      "LR tn, fp: 319, 28\n",
      "LR fn, tp: 14, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.041\n",
      "LR average precision score: 0.047\n",
      "\n",
      "\n",
      "average:\n",
      "LR tn, fp: 312.92, 18.88\n",
      "LR fn, tp: 13.8, 0.0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.048\n",
      "LR average precision score: 0.040\n",
      "\n",
      "\n",
      "minimum:\n",
      "LR tn, fp: 303, 13\n",
      "LR fn, tp: 13, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.054\n",
      "LR average precision score: 0.033\n",
      "\n",
      "\n",
      "-----[ GB ]-----\n",
      "maximum:\n",
      "GB tn, fp: 332, 3\n",
      "GB fn, tp: 8, 13\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "average:\n",
      "GB tn, fp: 331.08, 0.72\n",
      "GB fn, tp: 4.64, 9.16\n",
      "GB f1 score: 0.765\n",
      "GB cohens kappa score: 0.757\n",
      "\n",
      "\n",
      "minimum:\n",
      "GB tn, fp: 328, 0\n",
      "GB fn, tp: 0, 6\n",
      "GB f1 score: 0.600\n",
      "GB cohens kappa score: 0.590\n",
      "\n",
      "\n",
      "-----[ KNN ]-----\n",
      "maximum:\n",
      "KNN tn, fp: 332, 5\n",
      "KNN fn, tp: 14, 4\n",
      "KNN f1 score: 0.421\n",
      "KNN cohens kappa score: 0.407\n",
      "\n",
      "\n",
      "average:\n",
      "KNN tn, fp: 329.48, 2.32\n",
      "KNN fn, tp: 12.32, 1.48\n",
      "KNN f1 score: 0.159\n",
      "KNN cohens kappa score: 0.146\n",
      "\n",
      "\n",
      "minimum:\n",
      "KNN tn, fp: 327, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: -0.018\n",
      "\n"
     ]
    }
   ],
   "source": [
    "runExerciseForSpheredNoise(\"folding_car_good\", resultList)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "indie-refrigerator",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "///////////////////////////////////////////\n",
      "// Running SpheredNoise on folding_car-vgood\n",
      "///////////////////////////////////////////\n",
      "\n",
      "-> Shuffling data\n",
      "### Start exercise for synthetic point generator\n",
      "\n",
      "====== Step 1/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 1/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1330/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1278 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24580 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 314, 19\n",
      "LR fn, tp: 12, 1\n",
      "LR f1 score: 0.061\n",
      "LR cohens kappa score: 0.016\n",
      "LR average precision score: 0.180\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 333, 0\n",
      "GB fn, tp: 0, 13\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 329, 4\n",
      "KNN fn, tp: 10, 3\n",
      "KNN f1 score: 0.300\n",
      "KNN cohens kappa score: 0.281\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1330/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1278 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 28516 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 314, 19\n",
      "LR fn, tp: 9, 4\n",
      "LR f1 score: 0.222\n",
      "LR cohens kappa score: 0.183\n",
      "LR average precision score: 0.184\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 333, 0\n",
      "GB fn, tp: 0, 13\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 332, 1\n",
      "KNN fn, tp: 8, 5\n",
      "KNN f1 score: 0.526\n",
      "KNN cohens kappa score: 0.515\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1330/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1278 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25508 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 314, 19\n",
      "LR fn, tp: 7, 6\n",
      "LR f1 score: 0.316\n",
      "LR cohens kappa score: 0.280\n",
      "LR average precision score: 0.271\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 333, 0\n",
      "GB fn, tp: 1, 12\n",
      "GB f1 score: 0.960\n",
      "GB cohens kappa score: 0.959\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 331, 2\n",
      "KNN fn, tp: 7, 6\n",
      "KNN f1 score: 0.571\n",
      "KNN cohens kappa score: 0.559\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1330/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1278 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 28760 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 322, 11\n",
      "LR fn, tp: 9, 4\n",
      "LR f1 score: 0.286\n",
      "LR cohens kappa score: 0.256\n",
      "LR average precision score: 0.243\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 333, 0\n",
      "GB fn, tp: 0, 13\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 333, 0\n",
      "KNN fn, tp: 10, 3\n",
      "KNN f1 score: 0.375\n",
      "KNN cohens kappa score: 0.366\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1332/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.4142135623730951\n",
      "-> create 1280 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26928 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 320, 11\n",
      "LR fn, tp: 8, 5\n",
      "LR f1 score: 0.345\n",
      "LR cohens kappa score: 0.316\n",
      "LR average precision score: 0.218\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 329, 2\n",
      "GB fn, tp: 0, 13\n",
      "GB f1 score: 0.929\n",
      "GB cohens kappa score: 0.926\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 328, 3\n",
      "KNN fn, tp: 8, 5\n",
      "KNN f1 score: 0.476\n",
      "KNN cohens kappa score: 0.461\n",
      "\n",
      "\n",
      "====== Step 2/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 2/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1330/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1278 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26412 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 316, 17\n",
      "LR fn, tp: 9, 4\n",
      "LR f1 score: 0.235\n",
      "LR cohens kappa score: 0.198\n",
      "LR average precision score: 0.338\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 332, 1\n",
      "GB fn, tp: 0, 13\n",
      "GB f1 score: 0.963\n",
      "GB cohens kappa score: 0.961\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 331, 2\n",
      "KNN fn, tp: 10, 3\n",
      "KNN f1 score: 0.333\n",
      "KNN cohens kappa score: 0.319\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1330/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.4142135623730951\n",
      "-> create 1278 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26036 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 308, 25\n",
      "LR fn, tp: 8, 5\n",
      "LR f1 score: 0.233\n",
      "LR cohens kappa score: 0.190\n",
      "LR average precision score: 0.162\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 331, 2\n",
      "GB fn, tp: 0, 13\n",
      "GB f1 score: 0.929\n",
      "GB cohens kappa score: 0.926\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 327, 6\n",
      "KNN fn, tp: 8, 5\n",
      "KNN f1 score: 0.417\n",
      "KNN cohens kappa score: 0.396\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1330/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1278 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24984 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 320, 13\n",
      "LR fn, tp: 10, 3\n",
      "LR f1 score: 0.207\n",
      "LR cohens kappa score: 0.173\n",
      "LR average precision score: 0.213\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 333, 0\n",
      "GB fn, tp: 0, 13\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 329, 4\n",
      "KNN fn, tp: 7, 6\n",
      "KNN f1 score: 0.522\n",
      "KNN cohens kappa score: 0.506\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1330/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1278 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26812 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 322, 11\n",
      "LR fn, tp: 9, 4\n",
      "LR f1 score: 0.286\n",
      "LR cohens kappa score: 0.256\n",
      "LR average precision score: 0.303\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 333, 0\n",
      "GB fn, tp: 3, 10\n",
      "GB f1 score: 0.870\n",
      "GB cohens kappa score: 0.865\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 332, 1\n",
      "KNN fn, tp: 8, 5\n",
      "KNN f1 score: 0.526\n",
      "KNN cohens kappa score: 0.515\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1332/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1280 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26676 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 317, 14\n",
      "LR fn, tp: 10, 3\n",
      "LR f1 score: 0.200\n",
      "LR cohens kappa score: 0.164\n",
      "LR average precision score: 0.183\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 331, 0\n",
      "GB fn, tp: 0, 13\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 330, 1\n",
      "KNN fn, tp: 9, 4\n",
      "KNN f1 score: 0.444\n",
      "KNN cohens kappa score: 0.433\n",
      "\n",
      "\n",
      "====== Step 3/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 3/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1330/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1278 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 27200 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 316, 17\n",
      "LR fn, tp: 11, 2\n",
      "LR f1 score: 0.125\n",
      "LR cohens kappa score: 0.084\n",
      "LR average precision score: 0.190\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 333, 0\n",
      "GB fn, tp: 3, 10\n",
      "GB f1 score: 0.870\n",
      "GB cohens kappa score: 0.865\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 331, 2\n",
      "KNN fn, tp: 9, 4\n",
      "KNN f1 score: 0.421\n",
      "KNN cohens kappa score: 0.407\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1330/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1278 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25768 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 314, 19\n",
      "LR fn, tp: 9, 4\n",
      "LR f1 score: 0.222\n",
      "LR cohens kappa score: 0.183\n",
      "LR average precision score: 0.188\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 332, 1\n",
      "GB fn, tp: 0, 13\n",
      "GB f1 score: 0.963\n",
      "GB cohens kappa score: 0.961\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 329, 4\n",
      "KNN fn, tp: 10, 3\n",
      "KNN f1 score: 0.300\n",
      "KNN cohens kappa score: 0.281\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1330/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1278 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 27980 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 309, 24\n",
      "LR fn, tp: 6, 7\n",
      "LR f1 score: 0.318\n",
      "LR cohens kappa score: 0.280\n",
      "LR average precision score: 0.250\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 330, 3\n",
      "GB fn, tp: 0, 13\n",
      "GB f1 score: 0.897\n",
      "GB cohens kappa score: 0.892\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 330, 3\n",
      "KNN fn, tp: 8, 5\n",
      "KNN f1 score: 0.476\n",
      "KNN cohens kappa score: 0.461\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1330/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1278 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 29140 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 320, 13\n",
      "LR fn, tp: 9, 4\n",
      "LR f1 score: 0.267\n",
      "LR cohens kappa score: 0.234\n",
      "LR average precision score: 0.250\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 332, 1\n",
      "GB fn, tp: 0, 13\n",
      "GB f1 score: 0.963\n",
      "GB cohens kappa score: 0.961\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 332, 1\n",
      "KNN fn, tp: 7, 6\n",
      "KNN f1 score: 0.600\n",
      "KNN cohens kappa score: 0.589\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1332/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1280 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 28692 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 322, 9\n",
      "LR fn, tp: 10, 3\n",
      "LR f1 score: 0.240\n",
      "LR cohens kappa score: 0.211\n",
      "LR average precision score: 0.271\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 331, 0\n",
      "GB fn, tp: 3, 10\n",
      "GB f1 score: 0.870\n",
      "GB cohens kappa score: 0.865\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 330, 1\n",
      "KNN fn, tp: 10, 3\n",
      "KNN f1 score: 0.353\n",
      "KNN cohens kappa score: 0.341\n",
      "\n",
      "\n",
      "====== Step 4/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 4/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1330/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1278 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25924 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 319, 14\n",
      "LR fn, tp: 10, 3\n",
      "LR f1 score: 0.200\n",
      "LR cohens kappa score: 0.164\n",
      "LR average precision score: 0.224\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 331, 2\n",
      "GB fn, tp: 0, 13\n",
      "GB f1 score: 0.929\n",
      "GB cohens kappa score: 0.926\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 333, 0\n",
      "KNN fn, tp: 12, 1\n",
      "KNN f1 score: 0.143\n",
      "KNN cohens kappa score: 0.138\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1330/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1278 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26436 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 312, 21\n",
      "LR fn, tp: 9, 4\n",
      "LR f1 score: 0.211\n",
      "LR cohens kappa score: 0.169\n",
      "LR average precision score: 0.219\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 332, 1\n",
      "GB fn, tp: 1, 12\n",
      "GB f1 score: 0.923\n",
      "GB cohens kappa score: 0.920\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 329, 4\n",
      "KNN fn, tp: 11, 2\n",
      "KNN f1 score: 0.211\n",
      "KNN cohens kappa score: 0.191\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1330/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1278 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25648 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 314, 19\n",
      "LR fn, tp: 10, 3\n",
      "LR f1 score: 0.171\n",
      "LR cohens kappa score: 0.130\n",
      "LR average precision score: 0.178\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 330, 3\n",
      "GB fn, tp: 0, 13\n",
      "GB f1 score: 0.897\n",
      "GB cohens kappa score: 0.892\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 330, 3\n",
      "KNN fn, tp: 10, 3\n",
      "KNN f1 score: 0.316\n",
      "KNN cohens kappa score: 0.299\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1330/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1278 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26872 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 320, 13\n",
      "LR fn, tp: 9, 4\n",
      "LR f1 score: 0.267\n",
      "LR cohens kappa score: 0.234\n",
      "LR average precision score: 0.246\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 333, 0\n",
      "GB fn, tp: 1, 12\n",
      "GB f1 score: 0.960\n",
      "GB cohens kappa score: 0.959\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 331, 2\n",
      "KNN fn, tp: 11, 2\n",
      "KNN f1 score: 0.235\n",
      "KNN cohens kappa score: 0.222\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1332/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1280 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25364 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 317, 14\n",
      "LR fn, tp: 9, 4\n",
      "LR f1 score: 0.258\n",
      "LR cohens kappa score: 0.224\n",
      "LR average precision score: 0.219\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 331, 0\n",
      "GB fn, tp: 1, 12\n",
      "GB f1 score: 0.960\n",
      "GB cohens kappa score: 0.958\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 329, 2\n",
      "KNN fn, tp: 6, 7\n",
      "KNN f1 score: 0.636\n",
      "KNN cohens kappa score: 0.625\n",
      "\n",
      "\n",
      "====== Step 5/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 5/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1330/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1278 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 31296 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 312, 21\n",
      "LR fn, tp: 7, 6\n",
      "LR f1 score: 0.300\n",
      "LR cohens kappa score: 0.263\n",
      "LR average precision score: 0.250\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 332, 1\n",
      "GB fn, tp: 0, 13\n",
      "GB f1 score: 0.963\n",
      "GB cohens kappa score: 0.961\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 327, 6\n",
      "KNN fn, tp: 7, 6\n",
      "KNN f1 score: 0.480\n",
      "KNN cohens kappa score: 0.461\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1330/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1278 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 28440 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 320, 13\n",
      "LR fn, tp: 11, 2\n",
      "LR f1 score: 0.143\n",
      "LR cohens kappa score: 0.107\n",
      "LR average precision score: 0.172\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 333, 0\n",
      "GB fn, tp: 3, 10\n",
      "GB f1 score: 0.870\n",
      "GB cohens kappa score: 0.865\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 331, 2\n",
      "KNN fn, tp: 9, 4\n",
      "KNN f1 score: 0.421\n",
      "KNN cohens kappa score: 0.407\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1330/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.4142135623730951\n",
      "-> create 1278 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 27868 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 321, 12\n",
      "LR fn, tp: 7, 6\n",
      "LR f1 score: 0.387\n",
      "LR cohens kappa score: 0.359\n",
      "LR average precision score: 0.281\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 333, 0\n",
      "GB fn, tp: 1, 12\n",
      "GB f1 score: 0.960\n",
      "GB cohens kappa score: 0.959\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 332, 1\n",
      "KNN fn, tp: 8, 5\n",
      "KNN f1 score: 0.526\n",
      "KNN cohens kappa score: 0.515\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1330/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1278 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24796 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 314, 19\n",
      "LR fn, tp: 9, 4\n",
      "LR f1 score: 0.222\n",
      "LR cohens kappa score: 0.183\n",
      "LR average precision score: 0.193\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 333, 0\n",
      "GB fn, tp: 1, 12\n",
      "GB f1 score: 0.960\n",
      "GB cohens kappa score: 0.959\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 330, 3\n",
      "KNN fn, tp: 7, 6\n",
      "KNN f1 score: 0.545\n",
      "KNN cohens kappa score: 0.531\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1332/52 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 52 points min:1.0 max:1.0\n",
      "-> create 1280 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26572 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 317, 14\n",
      "LR fn, tp: 9, 4\n",
      "LR f1 score: 0.258\n",
      "LR cohens kappa score: 0.224\n",
      "LR average precision score: 0.201\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 329, 2\n",
      "GB fn, tp: 1, 12\n",
      "GB f1 score: 0.889\n",
      "GB cohens kappa score: 0.884\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 327, 4\n",
      "KNN fn, tp: 6, 7\n",
      "KNN f1 score: 0.583\n",
      "KNN cohens kappa score: 0.568\n",
      "\n",
      "### Exercise is done.\n",
      "\n",
      "-----[ LR ]-----\n",
      "maximum:\n",
      "LR tn, fp: 322, 25\n",
      "LR fn, tp: 12, 7\n",
      "LR f1 score: 0.387\n",
      "LR cohens kappa score: 0.359\n",
      "LR average precision score: 0.338\n",
      "\n",
      "\n",
      "average:\n",
      "LR tn, fp: 316.56, 16.04\n",
      "LR fn, tp: 9.04, 3.96\n",
      "LR f1 score: 0.239\n",
      "LR cohens kappa score: 0.203\n",
      "LR average precision score: 0.225\n",
      "\n",
      "\n",
      "minimum:\n",
      "LR tn, fp: 308, 9\n",
      "LR fn, tp: 6, 1\n",
      "LR f1 score: 0.061\n",
      "LR cohens kappa score: 0.016\n",
      "LR average precision score: 0.162\n",
      "\n",
      "\n",
      "-----[ GB ]-----\n",
      "maximum:\n",
      "GB tn, fp: 333, 3\n",
      "GB fn, tp: 3, 13\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "average:\n",
      "GB tn, fp: 331.84, 0.76\n",
      "GB fn, tp: 0.76, 12.24\n",
      "GB f1 score: 0.941\n",
      "GB cohens kappa score: 0.939\n",
      "\n",
      "\n",
      "minimum:\n",
      "GB tn, fp: 329, 0\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 0.870\n",
      "GB cohens kappa score: 0.865\n",
      "\n",
      "\n",
      "-----[ KNN ]-----\n",
      "maximum:\n",
      "KNN tn, fp: 333, 6\n",
      "KNN fn, tp: 12, 7\n",
      "KNN f1 score: 0.636\n",
      "KNN cohens kappa score: 0.625\n",
      "\n",
      "\n",
      "average:\n",
      "KNN tn, fp: 330.12, 2.48\n",
      "KNN fn, tp: 8.64, 4.36\n",
      "KNN f1 score: 0.430\n",
      "KNN cohens kappa score: 0.415\n",
      "\n",
      "\n",
      "minimum:\n",
      "KNN tn, fp: 327, 0\n",
      "KNN fn, tp: 6, 1\n",
      "KNN f1 score: 0.143\n",
      "KNN cohens kappa score: 0.138\n",
      "\n"
     ]
    }
   ],
   "source": [
    "runExerciseForSpheredNoise(\"folding_car-vgood\", resultList)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "sustainable-firmware",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "///////////////////////////////////////////\n",
      "// Running SpheredNoise on folding_flare-F\n",
      "///////////////////////////////////////////\n",
      "\n",
      "non empty cut in data_input/folding_flare-F! (23 points)\n",
      "-> Shuffling data\n",
      "### Start exercise for synthetic point generator\n",
      "\n",
      "====== Step 1/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 1/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 818/34 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 34 points min:1.0 max:1.4142135623730951\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 16556 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 202, 3\n",
      "LR fn, tp: 9, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.021\n",
      "LR average precision score: 0.112\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 204, 1\n",
      "GB fn, tp: 9, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.008\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 202, 3\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: -0.021\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 818/34 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 34 points min:1.0 max:1.7320508075688772\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 17228 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 202, 3\n",
      "LR fn, tp: 6, 3\n",
      "LR f1 score: 0.400\n",
      "LR cohens kappa score: 0.379\n",
      "LR average precision score: 0.377\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 203, 2\n",
      "GB fn, tp: 8, 1\n",
      "GB f1 score: 0.167\n",
      "GB cohens kappa score: 0.149\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 204, 1\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: -0.008\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 818/34 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 34 points min:1.0 max:1.7320508075688772\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 17116 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 204, 1\n",
      "LR fn, tp: 8, 1\n",
      "LR f1 score: 0.182\n",
      "LR cohens kappa score: 0.169\n",
      "LR average precision score: 0.315\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 204, 1\n",
      "GB fn, tp: 9, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.008\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 205, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 818/34 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 34 points min:1.0 max:2.0\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 17168 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 203, 2\n",
      "LR fn, tp: 5, 4\n",
      "LR f1 score: 0.533\n",
      "LR cohens kappa score: 0.517\n",
      "LR average precision score: 0.726\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 203, 2\n",
      "GB fn, tp: 8, 1\n",
      "GB f1 score: 0.167\n",
      "GB cohens kappa score: 0.149\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 205, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 820/36 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 36 points min:1.0 max:1.7320508075688772\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 17176 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 196, 7\n",
      "LR fn, tp: 5, 2\n",
      "LR f1 score: 0.250\n",
      "LR cohens kappa score: 0.221\n",
      "LR average precision score: 0.202\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 200, 3\n",
      "GB fn, tp: 6, 1\n",
      "GB f1 score: 0.182\n",
      "GB cohens kappa score: 0.161\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 203, 0\n",
      "KNN fn, tp: 7, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "====== Step 2/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 2/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 818/34 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 34 points min:1.0 max:1.4142135623730951\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 16880 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 202, 3\n",
      "LR fn, tp: 6, 3\n",
      "LR f1 score: 0.400\n",
      "LR cohens kappa score: 0.379\n",
      "LR average precision score: 0.399\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 203, 2\n",
      "GB fn, tp: 7, 2\n",
      "GB f1 score: 0.308\n",
      "GB cohens kappa score: 0.289\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 205, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 818/34 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 34 points min:1.0 max:1.7320508075688772\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 17304 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 203, 2\n",
      "LR fn, tp: 7, 2\n",
      "LR f1 score: 0.308\n",
      "LR cohens kappa score: 0.289\n",
      "LR average precision score: 0.316\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 203, 2\n",
      "GB fn, tp: 9, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.016\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 205, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 818/34 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 34 points min:1.0 max:2.0\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 21120 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 203, 2\n",
      "LR fn, tp: 7, 2\n",
      "LR f1 score: 0.308\n",
      "LR cohens kappa score: 0.289\n",
      "LR average precision score: 0.278\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 205, 0\n",
      "GB fn, tp: 8, 1\n",
      "GB f1 score: 0.200\n",
      "GB cohens kappa score: 0.193\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 205, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 818/34 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 34 points min:1.0 max:1.7320508075688772\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 17072 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 202, 3\n",
      "LR fn, tp: 8, 1\n",
      "LR f1 score: 0.154\n",
      "LR cohens kappa score: 0.131\n",
      "LR average precision score: 0.274\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 204, 1\n",
      "GB fn, tp: 8, 1\n",
      "GB f1 score: 0.182\n",
      "GB cohens kappa score: 0.169\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 205, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 820/36 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 36 points min:1.0 max:1.7320508075688772\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 17420 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 201, 2\n",
      "LR fn, tp: 4, 3\n",
      "LR f1 score: 0.500\n",
      "LR cohens kappa score: 0.486\n",
      "LR average precision score: 0.471\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 201, 2\n",
      "GB fn, tp: 6, 1\n",
      "GB f1 score: 0.200\n",
      "GB cohens kappa score: 0.184\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 203, 0\n",
      "KNN fn, tp: 7, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "====== Step 3/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 3/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 818/34 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 34 points min:1.0 max:1.7320508075688772\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 21420 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 204, 1\n",
      "LR fn, tp: 3, 6\n",
      "LR f1 score: 0.750\n",
      "LR cohens kappa score: 0.740\n",
      "LR average precision score: 0.749\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 205, 0\n",
      "GB fn, tp: 9, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: 0.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 205, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 818/34 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 34 points min:1.0 max:2.23606797749979\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 16796 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 198, 7\n",
      "LR fn, tp: 6, 3\n",
      "LR f1 score: 0.316\n",
      "LR cohens kappa score: 0.284\n",
      "LR average precision score: 0.210\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 200, 5\n",
      "GB fn, tp: 6, 3\n",
      "GB f1 score: 0.353\n",
      "GB cohens kappa score: 0.326\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 204, 1\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: -0.008\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 818/34 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 34 points min:1.0 max:1.7320508075688772\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 17112 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 204, 1\n",
      "LR fn, tp: 8, 1\n",
      "LR f1 score: 0.182\n",
      "LR cohens kappa score: 0.169\n",
      "LR average precision score: 0.371\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 204, 1\n",
      "GB fn, tp: 9, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.008\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 205, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 818/34 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 34 points min:1.0 max:1.7320508075688772\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 17096 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 204, 1\n",
      "LR fn, tp: 9, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.008\n",
      "LR average precision score: 0.274\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 203, 2\n",
      "GB fn, tp: 9, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.016\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 205, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 820/36 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 36 points min:1.0 max:2.0\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 17188 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 199, 4\n",
      "LR fn, tp: 6, 1\n",
      "LR f1 score: 0.167\n",
      "LR cohens kappa score: 0.143\n",
      "LR average precision score: 0.326\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 200, 3\n",
      "GB fn, tp: 6, 1\n",
      "GB f1 score: 0.182\n",
      "GB cohens kappa score: 0.161\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 201, 2\n",
      "KNN fn, tp: 7, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: -0.015\n",
      "\n",
      "\n",
      "====== Step 4/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 4/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 818/34 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 34 points min:1.0 max:1.7320508075688772\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 16964 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 200, 5\n",
      "LR fn, tp: 9, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.031\n",
      "LR average precision score: 0.171\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 199, 6\n",
      "GB fn, tp: 9, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.035\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 205, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 818/34 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 34 points min:1.0 max:1.7320508075688772\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 16800 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 204, 1\n",
      "LR fn, tp: 6, 3\n",
      "LR f1 score: 0.462\n",
      "LR cohens kappa score: 0.447\n",
      "LR average precision score: 0.559\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 204, 1\n",
      "GB fn, tp: 8, 1\n",
      "GB f1 score: 0.182\n",
      "GB cohens kappa score: 0.169\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 205, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 818/34 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 34 points min:1.0 max:2.0\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 16652 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 200, 5\n",
      "LR fn, tp: 7, 2\n",
      "LR f1 score: 0.250\n",
      "LR cohens kappa score: 0.221\n",
      "LR average precision score: 0.209\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 205, 0\n",
      "GB fn, tp: 8, 1\n",
      "GB f1 score: 0.200\n",
      "GB cohens kappa score: 0.193\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 204, 1\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: -0.008\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 818/34 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 34 points min:1.0 max:1.4142135623730951\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 16724 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 201, 4\n",
      "LR fn, tp: 6, 3\n",
      "LR f1 score: 0.375\n",
      "LR cohens kappa score: 0.351\n",
      "LR average precision score: 0.385\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 203, 2\n",
      "GB fn, tp: 7, 2\n",
      "GB f1 score: 0.308\n",
      "GB cohens kappa score: 0.289\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 205, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 820/36 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 36 points min:1.0 max:1.7320508075688772\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 16652 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 203, 0\n",
      "LR fn, tp: 4, 3\n",
      "LR f1 score: 0.600\n",
      "LR cohens kappa score: 0.592\n",
      "LR average precision score: 0.610\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 201, 2\n",
      "GB fn, tp: 6, 1\n",
      "GB f1 score: 0.200\n",
      "GB cohens kappa score: 0.184\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 203, 0\n",
      "KNN fn, tp: 7, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "====== Step 5/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 5/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 818/34 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 34 points min:1.0 max:1.7320508075688772\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 20968 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 204, 1\n",
      "LR fn, tp: 8, 1\n",
      "LR f1 score: 0.182\n",
      "LR cohens kappa score: 0.169\n",
      "LR average precision score: 0.217\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 204, 1\n",
      "GB fn, tp: 8, 1\n",
      "GB f1 score: 0.182\n",
      "GB cohens kappa score: 0.169\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 205, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 818/34 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 34 points min:1.0 max:1.7320508075688772\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 17220 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 203, 2\n",
      "LR fn, tp: 6, 3\n",
      "LR f1 score: 0.429\n",
      "LR cohens kappa score: 0.411\n",
      "LR average precision score: 0.360\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 205, 0\n",
      "GB fn, tp: 9, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: 0.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 205, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 818/34 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 34 points min:1.0 max:1.4142135623730951\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 16716 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 199, 6\n",
      "LR fn, tp: 4, 5\n",
      "LR f1 score: 0.500\n",
      "LR cohens kappa score: 0.476\n",
      "LR average precision score: 0.464\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 205, 0\n",
      "GB fn, tp: 8, 1\n",
      "GB f1 score: 0.200\n",
      "GB cohens kappa score: 0.193\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 205, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 818/34 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 34 points min:1.0 max:1.7320508075688772\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 17264 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 203, 2\n",
      "LR fn, tp: 9, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.016\n",
      "LR average precision score: 0.185\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 203, 2\n",
      "GB fn, tp: 9, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.016\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 205, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 820/36 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 36 points min:1.0 max:1.7320508075688772\n",
      "-> create 784 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 17188 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 203, 0\n",
      "LR fn, tp: 5, 2\n",
      "LR f1 score: 0.444\n",
      "LR cohens kappa score: 0.436\n",
      "LR average precision score: 0.438\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 199, 4\n",
      "GB fn, tp: 5, 2\n",
      "GB f1 score: 0.308\n",
      "GB cohens kappa score: 0.286\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 203, 0\n",
      "KNN fn, tp: 7, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "### Exercise is done.\n",
      "\n",
      "-----[ LR ]-----\n",
      "maximum:\n",
      "LR tn, fp: 204, 7\n",
      "LR fn, tp: 9, 6\n",
      "LR f1 score: 0.750\n",
      "LR cohens kappa score: 0.740\n",
      "LR average precision score: 0.749\n",
      "\n",
      "\n",
      "average:\n",
      "LR tn, fp: 201.88, 2.72\n",
      "LR fn, tp: 6.44, 2.16\n",
      "LR f1 score: 0.308\n",
      "LR cohens kappa score: 0.289\n",
      "LR average precision score: 0.360\n",
      "\n",
      "\n",
      "minimum:\n",
      "LR tn, fp: 196, 0\n",
      "LR fn, tp: 3, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.031\n",
      "LR average precision score: 0.112\n",
      "\n",
      "\n",
      "-----[ GB ]-----\n",
      "maximum:\n",
      "GB tn, fp: 205, 6\n",
      "GB fn, tp: 9, 3\n",
      "GB f1 score: 0.353\n",
      "GB cohens kappa score: 0.326\n",
      "\n",
      "\n",
      "average:\n",
      "GB tn, fp: 202.8, 1.8\n",
      "GB fn, tp: 7.76, 0.84\n",
      "GB f1 score: 0.141\n",
      "GB cohens kappa score: 0.126\n",
      "\n",
      "\n",
      "minimum:\n",
      "GB tn, fp: 199, 0\n",
      "GB fn, tp: 5, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.035\n",
      "\n",
      "\n",
      "-----[ KNN ]-----\n",
      "maximum:\n",
      "KNN tn, fp: 205, 3\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "average:\n",
      "KNN tn, fp: 204.28, 0.32\n",
      "KNN fn, tp: 8.6, 0.0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: -0.002\n",
      "\n",
      "\n",
      "minimum:\n",
      "KNN tn, fp: 201, 0\n",
      "KNN fn, tp: 7, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: -0.021\n",
      "\n"
     ]
    }
   ],
   "source": [
    "runExerciseForSpheredNoise(\"folding_flare-F\", resultList)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "original-twist",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "///////////////////////////////////////////\n",
      "// Running SpheredNoise on folding_hypothyroid\n",
      "///////////////////////////////////////////\n",
      "\n",
      "non empty cut in data_input/folding_hypothyroid! (1 points)\n",
      "-> Shuffling data\n",
      "### Start exercise for synthetic point generator\n",
      "\n",
      "====== Step 1/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 1/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2409/120 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 120 points min:1.0 max:91.88035698668132\n",
      "-> create 2289 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 27356 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 596, 7\n",
      "LR fn, tp: 20, 11\n",
      "LR f1 score: 0.449\n",
      "LR cohens kappa score: 0.428\n",
      "LR average precision score: 0.528\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 601, 2\n",
      "GB fn, tp: 7, 24\n",
      "GB f1 score: 0.842\n",
      "GB cohens kappa score: 0.835\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 600, 3\n",
      "KNN fn, tp: 15, 16\n",
      "KNN f1 score: 0.640\n",
      "KNN cohens kappa score: 0.626\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2409/120 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 120 points min:7.416198487095663 max:91.88035698668132\n",
      "-> create 2289 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25296 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 592, 11\n",
      "LR fn, tp: 19, 12\n",
      "LR f1 score: 0.444\n",
      "LR cohens kappa score: 0.420\n",
      "LR average precision score: 0.505\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 595, 8\n",
      "GB fn, tp: 9, 22\n",
      "GB f1 score: 0.721\n",
      "GB cohens kappa score: 0.707\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 596, 7\n",
      "KNN fn, tp: 15, 16\n",
      "KNN f1 score: 0.593\n",
      "KNN cohens kappa score: 0.575\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2409/120 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 120 points min:1.0 max:91.97282207261013\n",
      "-> create 2289 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 27292 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 594, 9\n",
      "LR fn, tp: 24, 7\n",
      "LR f1 score: 0.298\n",
      "LR cohens kappa score: 0.274\n",
      "LR average precision score: 0.421\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 600, 3\n",
      "GB fn, tp: 7, 24\n",
      "GB f1 score: 0.828\n",
      "GB cohens kappa score: 0.819\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 599, 4\n",
      "KNN fn, tp: 16, 15\n",
      "KNN f1 score: 0.600\n",
      "KNN cohens kappa score: 0.585\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2409/120 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 120 points min:1.0 max:91.88035698668132\n",
      "-> create 2289 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26536 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 595, 8\n",
      "LR fn, tp: 21, 10\n",
      "LR f1 score: 0.408\n",
      "LR cohens kappa score: 0.386\n",
      "LR average precision score: 0.446\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 600, 3\n",
      "GB fn, tp: 11, 20\n",
      "GB f1 score: 0.741\n",
      "GB cohens kappa score: 0.729\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 601, 2\n",
      "KNN fn, tp: 16, 15\n",
      "KNN f1 score: 0.625\n",
      "KNN cohens kappa score: 0.612\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2412/124 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 124 points min:1.0 max:90.58145505565695\n",
      "-> create 2288 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26708 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 595, 5\n",
      "LR fn, tp: 17, 10\n",
      "LR f1 score: 0.476\n",
      "LR cohens kappa score: 0.460\n",
      "LR average precision score: 0.572\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 598, 2\n",
      "GB fn, tp: 5, 22\n",
      "GB f1 score: 0.863\n",
      "GB cohens kappa score: 0.857\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 597, 3\n",
      "KNN fn, tp: 16, 11\n",
      "KNN f1 score: 0.537\n",
      "KNN cohens kappa score: 0.523\n",
      "\n",
      "\n",
      "====== Step 2/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 2/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2409/120 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 120 points min:1.0 max:91.97282207261013\n",
      "-> create 2289 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 27124 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 596, 7\n",
      "LR fn, tp: 20, 11\n",
      "LR f1 score: 0.449\n",
      "LR cohens kappa score: 0.428\n",
      "LR average precision score: 0.482\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 596, 7\n",
      "GB fn, tp: 12, 19\n",
      "GB f1 score: 0.667\n",
      "GB cohens kappa score: 0.651\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 598, 5\n",
      "KNN fn, tp: 22, 9\n",
      "KNN f1 score: 0.400\n",
      "KNN cohens kappa score: 0.381\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2409/120 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 120 points min:7.416198487095663 max:91.88035698668132\n",
      "-> create 2289 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25588 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 595, 8\n",
      "LR fn, tp: 24, 7\n",
      "LR f1 score: 0.304\n",
      "LR cohens kappa score: 0.281\n",
      "LR average precision score: 0.491\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 597, 6\n",
      "GB fn, tp: 9, 22\n",
      "GB f1 score: 0.746\n",
      "GB cohens kappa score: 0.733\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 600, 3\n",
      "KNN fn, tp: 15, 16\n",
      "KNN f1 score: 0.640\n",
      "KNN cohens kappa score: 0.626\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2409/120 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 120 points min:1.0 max:91.88035698668132\n",
      "-> create 2289 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26504 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 595, 8\n",
      "LR fn, tp: 17, 14\n",
      "LR f1 score: 0.528\n",
      "LR cohens kappa score: 0.508\n",
      "LR average precision score: 0.554\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 600, 3\n",
      "GB fn, tp: 12, 19\n",
      "GB f1 score: 0.717\n",
      "GB cohens kappa score: 0.705\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 601, 2\n",
      "KNN fn, tp: 16, 15\n",
      "KNN f1 score: 0.625\n",
      "KNN cohens kappa score: 0.612\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2409/120 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 120 points min:9.219544457292887 max:91.88035698668132\n",
      "-> create 2289 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24128 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 596, 7\n",
      "LR fn, tp: 25, 6\n",
      "LR f1 score: 0.273\n",
      "LR cohens kappa score: 0.251\n",
      "LR average precision score: 0.418\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 600, 3\n",
      "GB fn, tp: 6, 25\n",
      "GB f1 score: 0.847\n",
      "GB cohens kappa score: 0.840\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 596, 7\n",
      "KNN fn, tp: 16, 15\n",
      "KNN f1 score: 0.566\n",
      "KNN cohens kappa score: 0.548\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2412/124 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 124 points min:1.0 max:75.78918128598566\n",
      "-> create 2288 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26900 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 592, 8\n",
      "LR fn, tp: 16, 11\n",
      "LR f1 score: 0.478\n",
      "LR cohens kappa score: 0.459\n",
      "LR average precision score: 0.562\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 597, 3\n",
      "GB fn, tp: 5, 22\n",
      "GB f1 score: 0.846\n",
      "GB cohens kappa score: 0.840\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 595, 5\n",
      "KNN fn, tp: 12, 15\n",
      "KNN f1 score: 0.638\n",
      "KNN cohens kappa score: 0.625\n",
      "\n",
      "\n",
      "====== Step 3/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 3/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2409/120 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 120 points min:7.416198487095663 max:91.88035698668132\n",
      "-> create 2289 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25760 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 599, 4\n",
      "LR fn, tp: 22, 9\n",
      "LR f1 score: 0.409\n",
      "LR cohens kappa score: 0.392\n",
      "LR average precision score: 0.557\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 603, 0\n",
      "GB fn, tp: 13, 18\n",
      "GB f1 score: 0.735\n",
      "GB cohens kappa score: 0.725\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 602, 1\n",
      "KNN fn, tp: 19, 12\n",
      "KNN f1 score: 0.545\n",
      "KNN cohens kappa score: 0.532\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2409/120 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 120 points min:1.0 max:76.87652437513027\n",
      "-> create 2289 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 27092 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 593, 10\n",
      "LR fn, tp: 22, 9\n",
      "LR f1 score: 0.360\n",
      "LR cohens kappa score: 0.335\n",
      "LR average precision score: 0.349\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 595, 8\n",
      "GB fn, tp: 6, 25\n",
      "GB f1 score: 0.781\n",
      "GB cohens kappa score: 0.770\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 598, 5\n",
      "KNN fn, tp: 16, 15\n",
      "KNN f1 score: 0.588\n",
      "KNN cohens kappa score: 0.572\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2409/120 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 120 points min:1.0 max:91.88035698668132\n",
      "-> create 2289 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26560 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 594, 9\n",
      "LR fn, tp: 16, 15\n",
      "LR f1 score: 0.545\n",
      "LR cohens kappa score: 0.525\n",
      "LR average precision score: 0.663\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 598, 5\n",
      "GB fn, tp: 5, 26\n",
      "GB f1 score: 0.839\n",
      "GB cohens kappa score: 0.830\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 596, 7\n",
      "KNN fn, tp: 15, 16\n",
      "KNN f1 score: 0.593\n",
      "KNN cohens kappa score: 0.575\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2409/120 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 120 points min:9.0 max:91.97282207261013\n",
      "-> create 2289 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25592 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 595, 8\n",
      "LR fn, tp: 20, 11\n",
      "LR f1 score: 0.440\n",
      "LR cohens kappa score: 0.418\n",
      "LR average precision score: 0.510\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 596, 7\n",
      "GB fn, tp: 8, 23\n",
      "GB f1 score: 0.754\n",
      "GB cohens kappa score: 0.742\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 599, 4\n",
      "KNN fn, tp: 17, 14\n",
      "KNN f1 score: 0.571\n",
      "KNN cohens kappa score: 0.555\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2412/124 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 124 points min:1.0 max:91.88035698668132\n",
      "-> create 2288 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 27268 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 595, 5\n",
      "LR fn, tp: 21, 6\n",
      "LR f1 score: 0.316\n",
      "LR cohens kappa score: 0.298\n",
      "LR average precision score: 0.361\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 597, 3\n",
      "GB fn, tp: 7, 20\n",
      "GB f1 score: 0.800\n",
      "GB cohens kappa score: 0.792\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 599, 1\n",
      "KNN fn, tp: 14, 13\n",
      "KNN f1 score: 0.634\n",
      "KNN cohens kappa score: 0.623\n",
      "\n",
      "\n",
      "====== Step 4/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 4/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2409/120 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 120 points min:7.416198487095663 max:91.97282207261013\n",
      "-> create 2289 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25860 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 592, 11\n",
      "LR fn, tp: 22, 9\n",
      "LR f1 score: 0.353\n",
      "LR cohens kappa score: 0.327\n",
      "LR average precision score: 0.430\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 598, 5\n",
      "GB fn, tp: 4, 27\n",
      "GB f1 score: 0.857\n",
      "GB cohens kappa score: 0.850\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 600, 3\n",
      "KNN fn, tp: 21, 10\n",
      "KNN f1 score: 0.455\n",
      "KNN cohens kappa score: 0.438\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2409/120 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 120 points min:1.0 max:91.88035698668132\n",
      "-> create 2289 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 27120 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 595, 8\n",
      "LR fn, tp: 21, 10\n",
      "LR f1 score: 0.408\n",
      "LR cohens kappa score: 0.386\n",
      "LR average precision score: 0.496\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 599, 4\n",
      "GB fn, tp: 8, 23\n",
      "GB f1 score: 0.793\n",
      "GB cohens kappa score: 0.783\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 599, 4\n",
      "KNN fn, tp: 18, 13\n",
      "KNN f1 score: 0.542\n",
      "KNN cohens kappa score: 0.525\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2409/120 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 120 points min:1.0 max:91.88035698668132\n",
      "-> create 2289 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26884 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 599, 4\n",
      "LR fn, tp: 22, 9\n",
      "LR f1 score: 0.409\n",
      "LR cohens kappa score: 0.392\n",
      "LR average precision score: 0.629\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 599, 4\n",
      "GB fn, tp: 7, 24\n",
      "GB f1 score: 0.814\n",
      "GB cohens kappa score: 0.804\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 600, 3\n",
      "KNN fn, tp: 17, 14\n",
      "KNN f1 score: 0.583\n",
      "KNN cohens kappa score: 0.568\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2409/120 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 120 points min:1.0 max:75.78918128598566\n",
      "-> create 2289 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26572 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 594, 9\n",
      "LR fn, tp: 19, 12\n",
      "LR f1 score: 0.462\n",
      "LR cohens kappa score: 0.439\n",
      "LR average precision score: 0.501\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 600, 3\n",
      "GB fn, tp: 8, 23\n",
      "GB f1 score: 0.807\n",
      "GB cohens kappa score: 0.798\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 597, 6\n",
      "KNN fn, tp: 17, 14\n",
      "KNN f1 score: 0.549\n",
      "KNN cohens kappa score: 0.531\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2412/124 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 124 points min:9.0 max:91.88035698668132\n",
      "-> create 2288 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25344 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 593, 7\n",
      "LR fn, tp: 19, 8\n",
      "LR f1 score: 0.381\n",
      "LR cohens kappa score: 0.361\n",
      "LR average precision score: 0.430\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 596, 4\n",
      "GB fn, tp: 9, 18\n",
      "GB f1 score: 0.735\n",
      "GB cohens kappa score: 0.724\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 593, 7\n",
      "KNN fn, tp: 12, 15\n",
      "KNN f1 score: 0.612\n",
      "KNN cohens kappa score: 0.597\n",
      "\n",
      "\n",
      "====== Step 5/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 5/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2409/120 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 120 points min:1.0 max:91.88035698668132\n",
      "-> create 2289 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26708 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 589, 14\n",
      "LR fn, tp: 19, 12\n",
      "LR f1 score: 0.421\n",
      "LR cohens kappa score: 0.394\n",
      "LR average precision score: 0.485\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 599, 4\n",
      "GB fn, tp: 9, 22\n",
      "GB f1 score: 0.772\n",
      "GB cohens kappa score: 0.761\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 599, 4\n",
      "KNN fn, tp: 17, 14\n",
      "KNN f1 score: 0.571\n",
      "KNN cohens kappa score: 0.555\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2409/120 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 120 points min:1.0 max:91.88035698668132\n",
      "-> create 2289 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26928 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 598, 5\n",
      "LR fn, tp: 20, 11\n",
      "LR f1 score: 0.468\n",
      "LR cohens kappa score: 0.450\n",
      "LR average precision score: 0.481\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 600, 3\n",
      "GB fn, tp: 8, 23\n",
      "GB f1 score: 0.807\n",
      "GB cohens kappa score: 0.798\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 599, 4\n",
      "KNN fn, tp: 18, 13\n",
      "KNN f1 score: 0.542\n",
      "KNN cohens kappa score: 0.525\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2409/120 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 120 points min:7.416198487095663 max:91.88035698668132\n",
      "-> create 2289 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24764 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 594, 9\n",
      "LR fn, tp: 18, 13\n",
      "LR f1 score: 0.491\n",
      "LR cohens kappa score: 0.469\n",
      "LR average precision score: 0.551\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 598, 5\n",
      "GB fn, tp: 14, 17\n",
      "GB f1 score: 0.642\n",
      "GB cohens kappa score: 0.626\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 598, 5\n",
      "KNN fn, tp: 18, 13\n",
      "KNN f1 score: 0.531\n",
      "KNN cohens kappa score: 0.513\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2409/120 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 120 points min:1.0 max:91.88035698668132\n",
      "-> create 2289 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 27092 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 601, 2\n",
      "LR fn, tp: 22, 9\n",
      "LR f1 score: 0.429\n",
      "LR cohens kappa score: 0.414\n",
      "LR average precision score: 0.549\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 599, 4\n",
      "GB fn, tp: 5, 26\n",
      "GB f1 score: 0.852\n",
      "GB cohens kappa score: 0.845\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 601, 2\n",
      "KNN fn, tp: 14, 17\n",
      "KNN f1 score: 0.680\n",
      "KNN cohens kappa score: 0.668\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2412/124 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 124 points min:1.0 max:75.78918128598566\n",
      "-> create 2288 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26592 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 590, 10\n",
      "LR fn, tp: 21, 6\n",
      "LR f1 score: 0.279\n",
      "LR cohens kappa score: 0.255\n",
      "LR average precision score: 0.397\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 596, 4\n",
      "GB fn, tp: 7, 20\n",
      "GB f1 score: 0.784\n",
      "GB cohens kappa score: 0.775\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 597, 3\n",
      "KNN fn, tp: 17, 10\n",
      "KNN f1 score: 0.500\n",
      "KNN cohens kappa score: 0.486\n",
      "\n",
      "### Exercise is done.\n",
      "\n",
      "-----[ LR ]-----\n",
      "maximum:\n",
      "LR tn, fp: 601, 14\n",
      "LR fn, tp: 25, 15\n",
      "LR f1 score: 0.545\n",
      "LR cohens kappa score: 0.525\n",
      "LR average precision score: 0.663\n",
      "\n",
      "\n",
      "average:\n",
      "LR tn, fp: 594.68, 7.72\n",
      "LR fn, tp: 20.28, 9.92\n",
      "LR f1 score: 0.411\n",
      "LR cohens kappa score: 0.390\n",
      "LR average precision score: 0.495\n",
      "\n",
      "\n",
      "minimum:\n",
      "LR tn, fp: 589, 2\n",
      "LR fn, tp: 16, 6\n",
      "LR f1 score: 0.273\n",
      "LR cohens kappa score: 0.251\n",
      "LR average precision score: 0.349\n",
      "\n",
      "\n",
      "-----[ GB ]-----\n",
      "maximum:\n",
      "GB tn, fp: 603, 8\n",
      "GB fn, tp: 14, 27\n",
      "GB f1 score: 0.863\n",
      "GB cohens kappa score: 0.857\n",
      "\n",
      "\n",
      "average:\n",
      "GB tn, fp: 598.28, 4.12\n",
      "GB fn, tp: 8.04, 22.16\n",
      "GB f1 score: 0.784\n",
      "GB cohens kappa score: 0.774\n",
      "\n",
      "\n",
      "minimum:\n",
      "GB tn, fp: 595, 0\n",
      "GB fn, tp: 4, 17\n",
      "GB f1 score: 0.642\n",
      "GB cohens kappa score: 0.626\n",
      "\n",
      "\n",
      "-----[ KNN ]-----\n",
      "maximum:\n",
      "KNN tn, fp: 602, 7\n",
      "KNN fn, tp: 22, 17\n",
      "KNN f1 score: 0.680\n",
      "KNN cohens kappa score: 0.668\n",
      "\n",
      "\n",
      "average:\n",
      "KNN tn, fp: 598.4, 4.0\n",
      "KNN fn, tp: 16.36, 13.84\n",
      "KNN f1 score: 0.574\n",
      "KNN cohens kappa score: 0.559\n",
      "\n",
      "\n",
      "minimum:\n",
      "KNN tn, fp: 593, 1\n",
      "KNN fn, tp: 12, 9\n",
      "KNN f1 score: 0.400\n",
      "KNN cohens kappa score: 0.381\n",
      "\n"
     ]
    }
   ],
   "source": [
    "runExerciseForSpheredNoise(\"folding_hypothyroid\", resultList)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "numerous-graduation",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "///////////////////////////////////////////\n",
      "// Running SpheredNoise on folding_kddcup-guess_passwd_vs_satan\n",
      "///////////////////////////////////////////\n",
      "\n",
      "-> Shuffling data\n",
      "### Start exercise for synthetic point generator\n",
      "\n",
      "====== Step 1/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 1/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1271/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:148.4225447834661 max:1929.7078500384455\n",
      "-> create 1229 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14800 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 318, 0\n",
      "LR fn, tp: 0, 11\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 317, 1\n",
      "GB fn, tp: 0, 11\n",
      "GB f1 score: 0.957\n",
      "GB cohens kappa score: 0.955\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 317, 1\n",
      "KNN fn, tp: 0, 11\n",
      "KNN f1 score: 0.957\n",
      "KNN cohens kappa score: 0.955\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1271/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:147.82845395931056 max:1877.517291717975\n",
      "-> create 1229 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13708 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 318, 0\n",
      "LR fn, tp: 0, 11\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 318, 0\n",
      "GB fn, tp: 0, 11\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 318, 0\n",
      "KNN fn, tp: 0, 11\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1271/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:199.5711026175884 max:284.9796045333771\n",
      "-> create 1229 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13692 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 318, 0\n",
      "LR fn, tp: 0, 11\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 318, 0\n",
      "GB fn, tp: 0, 11\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 317, 1\n",
      "KNN fn, tp: 0, 11\n",
      "KNN f1 score: 0.957\n",
      "KNN cohens kappa score: 0.955\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1271/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:147.82845395931056 max:1877.517291717975\n",
      "-> create 1229 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13828 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 317, 1\n",
      "LR fn, tp: 0, 11\n",
      "LR f1 score: 0.957\n",
      "LR cohens kappa score: 0.955\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 317, 1\n",
      "GB fn, tp: 0, 11\n",
      "GB f1 score: 0.957\n",
      "GB cohens kappa score: 0.955\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 317, 1\n",
      "KNN fn, tp: 0, 11\n",
      "KNN f1 score: 0.957\n",
      "KNN cohens kappa score: 0.955\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1272/44 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 44 points min:147.82845395931056 max:1877.517291717975\n",
      "-> create 1228 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15496 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 317, 0\n",
      "LR fn, tp: 0, 9\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 317, 0\n",
      "GB fn, tp: 0, 9\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 317, 0\n",
      "KNN fn, tp: 0, 9\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "====== Step 2/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 2/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1271/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:148.4225447834661 max:234.9446483748885\n",
      "-> create 1229 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13860 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 318, 0\n",
      "LR fn, tp: 0, 11\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 318, 0\n",
      "GB fn, tp: 0, 11\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 318, 0\n",
      "KNN fn, tp: 0, 11\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1271/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:147.82845395931056 max:1877.517291717975\n",
      "-> create 1229 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14464 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 318, 0\n",
      "LR fn, tp: 0, 11\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 318, 0\n",
      "GB fn, tp: 0, 11\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 317, 1\n",
      "KNN fn, tp: 0, 11\n",
      "KNN f1 score: 0.957\n",
      "KNN cohens kappa score: 0.955\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1271/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:147.82845395931056 max:1929.7078500384455\n",
      "-> create 1229 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15636 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 317, 1\n",
      "LR fn, tp: 0, 11\n",
      "LR f1 score: 0.957\n",
      "LR cohens kappa score: 0.955\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 317, 1\n",
      "GB fn, tp: 0, 11\n",
      "GB f1 score: 0.957\n",
      "GB cohens kappa score: 0.955\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 317, 1\n",
      "KNN fn, tp: 0, 11\n",
      "KNN f1 score: 0.957\n",
      "KNN cohens kappa score: 0.955\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1271/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:147.82845395931056 max:1877.517291717975\n",
      "-> create 1229 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13464 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 318, 0\n",
      "LR fn, tp: 0, 11\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 318, 0\n",
      "GB fn, tp: 0, 11\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 318, 0\n",
      "KNN fn, tp: 0, 11\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1272/44 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 44 points min:199.5731382225574 max:1877.517291717975\n",
      "-> create 1228 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14696 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 317, 0\n",
      "LR fn, tp: 0, 9\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 317, 0\n",
      "GB fn, tp: 0, 9\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 316, 1\n",
      "KNN fn, tp: 0, 9\n",
      "KNN f1 score: 0.947\n",
      "KNN cohens kappa score: 0.946\n",
      "\n",
      "\n",
      "====== Step 3/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 3/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1271/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:147.82845395931056 max:1877.517291717975\n",
      "-> create 1229 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13960 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 318, 0\n",
      "LR fn, tp: 0, 11\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 318, 0\n",
      "GB fn, tp: 0, 11\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 317, 1\n",
      "KNN fn, tp: 0, 11\n",
      "KNN f1 score: 0.957\n",
      "KNN cohens kappa score: 0.955\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1271/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:147.82845395931056 max:1877.517291717975\n",
      "-> create 1229 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14672 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 316, 2\n",
      "LR fn, tp: 0, 11\n",
      "LR f1 score: 0.917\n",
      "LR cohens kappa score: 0.914\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 315, 3\n",
      "GB fn, tp: 0, 11\n",
      "GB f1 score: 0.880\n",
      "GB cohens kappa score: 0.875\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 316, 2\n",
      "KNN fn, tp: 0, 11\n",
      "KNN f1 score: 0.917\n",
      "KNN cohens kappa score: 0.914\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1271/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:147.82845395931056 max:1877.517291717975\n",
      "-> create 1229 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14124 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 318, 0\n",
      "LR fn, tp: 0, 11\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 318, 0\n",
      "GB fn, tp: 0, 11\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 318, 0\n",
      "KNN fn, tp: 0, 11\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1271/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:147.82845395931056 max:234.9446483748885\n",
      "-> create 1229 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14708 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 318, 0\n",
      "LR fn, tp: 0, 11\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 318, 0\n",
      "GB fn, tp: 0, 11\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 318, 0\n",
      "KNN fn, tp: 0, 11\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1272/44 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 44 points min:199.56770655594556 max:1983.7451250349677\n",
      "-> create 1228 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13724 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 317, 0\n",
      "LR fn, tp: 0, 9\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 317, 0\n",
      "GB fn, tp: 0, 9\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 317, 0\n",
      "KNN fn, tp: 0, 9\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "====== Step 4/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 4/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1271/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:148.4225447834661 max:1877.517291717975\n",
      "-> create 1229 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14540 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 318, 0\n",
      "LR fn, tp: 0, 11\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 318, 0\n",
      "GB fn, tp: 0, 11\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 317, 1\n",
      "KNN fn, tp: 0, 11\n",
      "KNN f1 score: 0.957\n",
      "KNN cohens kappa score: 0.955\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1271/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:147.82845395931056 max:1877.517291717975\n",
      "-> create 1229 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13952 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 318, 0\n",
      "LR fn, tp: 0, 11\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 318, 0\n",
      "GB fn, tp: 0, 11\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 317, 1\n",
      "KNN fn, tp: 0, 11\n",
      "KNN f1 score: 0.957\n",
      "KNN cohens kappa score: 0.955\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1271/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:199.56770655594556 max:284.9796045333771\n",
      "-> create 1229 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14936 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 318, 0\n",
      "LR fn, tp: 0, 11\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 317, 1\n",
      "GB fn, tp: 0, 11\n",
      "GB f1 score: 0.957\n",
      "GB cohens kappa score: 0.955\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 318, 0\n",
      "KNN fn, tp: 0, 11\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1271/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:147.82845395931056 max:1877.517291717975\n",
      "-> create 1229 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14988 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 318, 0\n",
      "LR fn, tp: 0, 11\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 318, 0\n",
      "GB fn, tp: 0, 11\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 318, 0\n",
      "KNN fn, tp: 0, 11\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1272/44 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 44 points min:147.82845395931056 max:1877.517291717975\n",
      "-> create 1228 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13756 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 317, 0\n",
      "LR fn, tp: 0, 9\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 317, 0\n",
      "GB fn, tp: 0, 9\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 316, 1\n",
      "KNN fn, tp: 0, 9\n",
      "KNN f1 score: 0.947\n",
      "KNN cohens kappa score: 0.946\n",
      "\n",
      "\n",
      "====== Step 5/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 5/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1271/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:149.02768803145273 max:1877.517291717975\n",
      "-> create 1229 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15080 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 318, 0\n",
      "LR fn, tp: 0, 11\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 318, 0\n",
      "GB fn, tp: 0, 11\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 317, 1\n",
      "KNN fn, tp: 0, 11\n",
      "KNN f1 score: 0.957\n",
      "KNN cohens kappa score: 0.955\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1271/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:147.82845395931056 max:234.9446483748885\n",
      "-> create 1229 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14620 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 318, 0\n",
      "LR fn, tp: 0, 11\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 318, 0\n",
      "GB fn, tp: 0, 11\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 318, 0\n",
      "KNN fn, tp: 0, 11\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1271/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:147.82845395931056 max:1877.517291717975\n",
      "-> create 1229 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14604 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 318, 0\n",
      "LR fn, tp: 0, 11\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 318, 0\n",
      "GB fn, tp: 1, 10\n",
      "GB f1 score: 0.952\n",
      "GB cohens kappa score: 0.951\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 318, 0\n",
      "KNN fn, tp: 0, 11\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1271/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:147.82845395931056 max:1877.517291717975\n",
      "-> create 1229 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14560 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 318, 0\n",
      "LR fn, tp: 0, 11\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 317, 1\n",
      "GB fn, tp: 0, 11\n",
      "GB f1 score: 0.957\n",
      "GB cohens kappa score: 0.955\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 318, 0\n",
      "KNN fn, tp: 0, 11\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1272/44 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 44 points min:213.2104687861269 max:1929.7078500384455\n",
      "-> create 1228 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13980 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 315, 2\n",
      "LR fn, tp: 0, 9\n",
      "LR f1 score: 0.900\n",
      "LR cohens kappa score: 0.897\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 315, 2\n",
      "GB fn, tp: 0, 9\n",
      "GB f1 score: 0.900\n",
      "GB cohens kappa score: 0.897\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 315, 2\n",
      "KNN fn, tp: 0, 9\n",
      "KNN f1 score: 0.900\n",
      "KNN cohens kappa score: 0.897\n",
      "\n",
      "### Exercise is done.\n",
      "\n",
      "-----[ LR ]-----\n",
      "maximum:\n",
      "LR tn, fp: 318, 2\n",
      "LR fn, tp: 0, 11\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "\n",
      "average:\n",
      "LR tn, fp: 317.56, 0.24\n",
      "LR fn, tp: 0.0, 10.6\n",
      "LR f1 score: 0.989\n",
      "LR cohens kappa score: 0.989\n",
      "LR average precision score: 1.000\n",
      "\n",
      "\n",
      "minimum:\n",
      "LR tn, fp: 315, 0\n",
      "LR fn, tp: 0, 9\n",
      "LR f1 score: 0.900\n",
      "LR cohens kappa score: 0.897\n",
      "LR average precision score: 1.000\n",
      "\n",
      "\n",
      "-----[ GB ]-----\n",
      "maximum:\n",
      "GB tn, fp: 318, 3\n",
      "GB fn, tp: 1, 11\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "average:\n",
      "GB tn, fp: 317.4, 0.4\n",
      "GB fn, tp: 0.04, 10.56\n",
      "GB f1 score: 0.981\n",
      "GB cohens kappa score: 0.980\n",
      "\n",
      "\n",
      "minimum:\n",
      "GB tn, fp: 315, 0\n",
      "GB fn, tp: 0, 9\n",
      "GB f1 score: 0.880\n",
      "GB cohens kappa score: 0.875\n",
      "\n",
      "\n",
      "-----[ KNN ]-----\n",
      "maximum:\n",
      "KNN tn, fp: 318, 2\n",
      "KNN fn, tp: 0, 11\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "average:\n",
      "KNN tn, fp: 317.2, 0.6\n",
      "KNN fn, tp: 0.0, 10.6\n",
      "KNN f1 score: 0.973\n",
      "KNN cohens kappa score: 0.972\n",
      "\n",
      "\n",
      "minimum:\n",
      "KNN tn, fp: 315, 0\n",
      "KNN fn, tp: 0, 9\n",
      "KNN f1 score: 0.900\n",
      "KNN cohens kappa score: 0.897\n",
      "\n"
     ]
    }
   ],
   "source": [
    "runExerciseForSpheredNoise(\"folding_kddcup-guess_passwd_vs_satan\", resultList)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "thorough-impression",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "///////////////////////////////////////////\n",
      "// Running SpheredNoise on folding_kr-vs-k-three_vs_eleven\n",
      "///////////////////////////////////////////\n",
      "\n",
      "-> Shuffling data\n",
      "### Start exercise for synthetic point generator\n",
      "\n",
      "====== Step 1/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 1/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2283/64 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 64 points min:1.0 max:3.3166247903554\n",
      "-> create 2219 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 42564 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 570, 1\n",
      "LR fn, tp: 0, 17\n",
      "LR f1 score: 0.971\n",
      "LR cohens kappa score: 0.971\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 571, 0\n",
      "GB fn, tp: 0, 17\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 571, 0\n",
      "KNN fn, tp: 1, 16\n",
      "KNN f1 score: 0.970\n",
      "KNN cohens kappa score: 0.969\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2283/64 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 64 points min:1.0 max:3.3166247903554\n",
      "-> create 2219 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 42600 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 571, 0\n",
      "LR fn, tp: 2, 15\n",
      "LR f1 score: 0.938\n",
      "LR cohens kappa score: 0.936\n",
      "LR average precision score: 0.990\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 571, 0\n",
      "GB fn, tp: 0, 17\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 571, 0\n",
      "KNN fn, tp: 1, 16\n",
      "KNN f1 score: 0.970\n",
      "KNN cohens kappa score: 0.969\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2283/64 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 64 points min:1.0 max:3.3166247903554\n",
      "-> create 2219 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 42164 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 568, 3\n",
      "LR fn, tp: 1, 16\n",
      "LR f1 score: 0.889\n",
      "LR cohens kappa score: 0.885\n",
      "LR average precision score: 0.991\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 571, 0\n",
      "GB fn, tp: 0, 17\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 571, 0\n",
      "KNN fn, tp: 1, 16\n",
      "KNN f1 score: 0.970\n",
      "KNN cohens kappa score: 0.969\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2283/64 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 64 points min:1.0 max:3.3166247903554\n",
      "-> create 2219 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 41820 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 570, 1\n",
      "LR fn, tp: 1, 16\n",
      "LR f1 score: 0.941\n",
      "LR cohens kappa score: 0.939\n",
      "LR average precision score: 0.994\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 571, 0\n",
      "GB fn, tp: 0, 17\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 571, 0\n",
      "KNN fn, tp: 2, 15\n",
      "KNN f1 score: 0.938\n",
      "KNN cohens kappa score: 0.936\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2284/68 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 68 points min:1.0 max:3.3166247903554\n",
      "-> create 2216 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 41968 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 565, 5\n",
      "LR fn, tp: 1, 12\n",
      "LR f1 score: 0.800\n",
      "LR cohens kappa score: 0.795\n",
      "LR average precision score: 0.782\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 570, 0\n",
      "GB fn, tp: 0, 13\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 568, 2\n",
      "KNN fn, tp: 1, 12\n",
      "KNN f1 score: 0.889\n",
      "KNN cohens kappa score: 0.886\n",
      "\n",
      "\n",
      "====== Step 2/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 2/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2283/64 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 64 points min:1.0 max:3.1622776601683795\n",
      "-> create 2219 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 40780 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 570, 1\n",
      "LR fn, tp: 0, 17\n",
      "LR f1 score: 0.971\n",
      "LR cohens kappa score: 0.971\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 571, 0\n",
      "GB fn, tp: 0, 17\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 571, 0\n",
      "KNN fn, tp: 2, 15\n",
      "KNN f1 score: 0.938\n",
      "KNN cohens kappa score: 0.936\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2283/64 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 64 points min:1.0 max:3.3166247903554\n",
      "-> create 2219 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 39496 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 571, 0\n",
      "LR fn, tp: 1, 16\n",
      "LR f1 score: 0.970\n",
      "LR cohens kappa score: 0.969\n",
      "LR average precision score: 0.991\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 571, 0\n",
      "GB fn, tp: 0, 17\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 571, 0\n",
      "KNN fn, tp: 0, 17\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2283/64 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 64 points min:1.0 max:3.3166247903554\n",
      "-> create 2219 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 41748 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 568, 3\n",
      "LR fn, tp: 2, 15\n",
      "LR f1 score: 0.857\n",
      "LR cohens kappa score: 0.853\n",
      "LR average precision score: 0.923\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 571, 0\n",
      "GB fn, tp: 0, 17\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 570, 1\n",
      "KNN fn, tp: 3, 14\n",
      "KNN f1 score: 0.875\n",
      "KNN cohens kappa score: 0.872\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2283/64 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 64 points min:1.0 max:3.3166247903554\n",
      "-> create 2219 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 41656 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 569, 2\n",
      "LR fn, tp: 1, 16\n",
      "LR f1 score: 0.914\n",
      "LR cohens kappa score: 0.912\n",
      "LR average precision score: 0.994\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 571, 0\n",
      "GB fn, tp: 0, 17\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 571, 0\n",
      "KNN fn, tp: 2, 15\n",
      "KNN f1 score: 0.938\n",
      "KNN cohens kappa score: 0.936\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2284/68 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 68 points min:1.0 max:3.3166247903554\n",
      "-> create 2216 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 40620 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 569, 1\n",
      "LR fn, tp: 1, 12\n",
      "LR f1 score: 0.923\n",
      "LR cohens kappa score: 0.921\n",
      "LR average precision score: 0.990\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 570, 0\n",
      "GB fn, tp: 0, 13\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 569, 1\n",
      "KNN fn, tp: 0, 13\n",
      "KNN f1 score: 0.963\n",
      "KNN cohens kappa score: 0.962\n",
      "\n",
      "\n",
      "====== Step 3/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 3/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2283/64 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 64 points min:1.0 max:3.3166247903554\n",
      "-> create 2219 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 42260 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 569, 2\n",
      "LR fn, tp: 0, 17\n",
      "LR f1 score: 0.944\n",
      "LR cohens kappa score: 0.943\n",
      "LR average precision score: 0.990\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 571, 0\n",
      "GB fn, tp: 0, 17\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 571, 0\n",
      "KNN fn, tp: 0, 17\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2283/64 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 64 points min:1.0 max:3.3166247903554\n",
      "-> create 2219 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 42724 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 570, 1\n",
      "LR fn, tp: 1, 16\n",
      "LR f1 score: 0.941\n",
      "LR cohens kappa score: 0.939\n",
      "LR average precision score: 0.994\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 570, 1\n",
      "GB fn, tp: 0, 17\n",
      "GB f1 score: 0.971\n",
      "GB cohens kappa score: 0.971\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 570, 1\n",
      "KNN fn, tp: 3, 14\n",
      "KNN f1 score: 0.875\n",
      "KNN cohens kappa score: 0.872\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2283/64 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 64 points min:1.0 max:3.3166247903554\n",
      "-> create 2219 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 40140 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 569, 2\n",
      "LR fn, tp: 1, 16\n",
      "LR f1 score: 0.914\n",
      "LR cohens kappa score: 0.912\n",
      "LR average precision score: 0.994\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 571, 0\n",
      "GB fn, tp: 0, 17\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 570, 1\n",
      "KNN fn, tp: 0, 17\n",
      "KNN f1 score: 0.971\n",
      "KNN cohens kappa score: 0.971\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2283/64 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 64 points min:1.0 max:3.3166247903554\n",
      "-> create 2219 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 42560 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 568, 3\n",
      "LR fn, tp: 1, 16\n",
      "LR f1 score: 0.889\n",
      "LR cohens kappa score: 0.885\n",
      "LR average precision score: 0.987\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 571, 0\n",
      "GB fn, tp: 0, 17\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 571, 0\n",
      "KNN fn, tp: 2, 15\n",
      "KNN f1 score: 0.938\n",
      "KNN cohens kappa score: 0.936\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2284/68 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 68 points min:1.0 max:3.3166247903554\n",
      "-> create 2216 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 41464 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 570, 0\n",
      "LR fn, tp: 1, 12\n",
      "LR f1 score: 0.960\n",
      "LR cohens kappa score: 0.959\n",
      "LR average precision score: 0.990\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 570, 0\n",
      "GB fn, tp: 0, 13\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 570, 0\n",
      "KNN fn, tp: 3, 10\n",
      "KNN f1 score: 0.870\n",
      "KNN cohens kappa score: 0.867\n",
      "\n",
      "\n",
      "====== Step 4/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 4/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2283/64 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 64 points min:1.0 max:3.3166247903554\n",
      "-> create 2219 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 39988 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 568, 3\n",
      "LR fn, tp: 1, 16\n",
      "LR f1 score: 0.889\n",
      "LR cohens kappa score: 0.885\n",
      "LR average precision score: 0.989\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 571, 0\n",
      "GB fn, tp: 0, 17\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 571, 0\n",
      "KNN fn, tp: 1, 16\n",
      "KNN f1 score: 0.970\n",
      "KNN cohens kappa score: 0.969\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2283/64 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 64 points min:1.0 max:3.3166247903554\n",
      "-> create 2219 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 41980 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 571, 0\n",
      "LR fn, tp: 1, 16\n",
      "LR f1 score: 0.970\n",
      "LR cohens kappa score: 0.969\n",
      "LR average precision score: 0.989\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 571, 0\n",
      "GB fn, tp: 0, 17\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 571, 0\n",
      "KNN fn, tp: 3, 14\n",
      "KNN f1 score: 0.903\n",
      "KNN cohens kappa score: 0.901\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2283/64 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 64 points min:1.0 max:3.3166247903554\n",
      "-> create 2219 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 41152 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 571, 0\n",
      "LR fn, tp: 1, 16\n",
      "LR f1 score: 0.970\n",
      "LR cohens kappa score: 0.969\n",
      "LR average precision score: 0.997\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 571, 0\n",
      "GB fn, tp: 0, 17\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 570, 1\n",
      "KNN fn, tp: 0, 17\n",
      "KNN f1 score: 0.971\n",
      "KNN cohens kappa score: 0.971\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2283/64 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 64 points min:1.0 max:3.3166247903554\n",
      "-> create 2219 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 42588 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 568, 3\n",
      "LR fn, tp: 0, 17\n",
      "LR f1 score: 0.919\n",
      "LR cohens kappa score: 0.916\n",
      "LR average precision score: 0.936\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 571, 0\n",
      "GB fn, tp: 0, 17\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 570, 1\n",
      "KNN fn, tp: 0, 17\n",
      "KNN f1 score: 0.971\n",
      "KNN cohens kappa score: 0.971\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2284/68 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 68 points min:1.0 max:3.3166247903554\n",
      "-> create 2216 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 40644 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 569, 1\n",
      "LR fn, tp: 1, 12\n",
      "LR f1 score: 0.923\n",
      "LR cohens kappa score: 0.921\n",
      "LR average precision score: 0.990\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 570, 0\n",
      "GB fn, tp: 0, 13\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 570, 0\n",
      "KNN fn, tp: 2, 11\n",
      "KNN f1 score: 0.917\n",
      "KNN cohens kappa score: 0.915\n",
      "\n",
      "\n",
      "====== Step 5/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 5/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2283/64 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 64 points min:1.0 max:3.3166247903554\n",
      "-> create 2219 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 42800 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 567, 4\n",
      "LR fn, tp: 0, 17\n",
      "LR f1 score: 0.895\n",
      "LR cohens kappa score: 0.891\n",
      "LR average precision score: 0.994\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 571, 0\n",
      "GB fn, tp: 0, 17\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 570, 1\n",
      "KNN fn, tp: 2, 15\n",
      "KNN f1 score: 0.909\n",
      "KNN cohens kappa score: 0.906\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2283/64 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 64 points min:1.0 max:3.3166247903554\n",
      "-> create 2219 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 42096 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 568, 3\n",
      "LR fn, tp: 2, 15\n",
      "LR f1 score: 0.857\n",
      "LR cohens kappa score: 0.853\n",
      "LR average precision score: 0.970\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 571, 0\n",
      "GB fn, tp: 0, 17\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 571, 0\n",
      "KNN fn, tp: 2, 15\n",
      "KNN f1 score: 0.938\n",
      "KNN cohens kappa score: 0.936\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2283/64 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 64 points min:1.0 max:3.3166247903554\n",
      "-> create 2219 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 41888 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 571, 0\n",
      "LR fn, tp: 1, 16\n",
      "LR f1 score: 0.970\n",
      "LR cohens kappa score: 0.969\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 571, 0\n",
      "GB fn, tp: 0, 17\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 571, 0\n",
      "KNN fn, tp: 1, 16\n",
      "KNN f1 score: 0.970\n",
      "KNN cohens kappa score: 0.969\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2283/64 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 64 points min:1.0 max:3.3166247903554\n",
      "-> create 2219 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 41748 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 571, 0\n",
      "LR fn, tp: 2, 15\n",
      "LR f1 score: 0.938\n",
      "LR cohens kappa score: 0.936\n",
      "LR average precision score: 0.977\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 571, 0\n",
      "GB fn, tp: 0, 17\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 570, 1\n",
      "KNN fn, tp: 1, 16\n",
      "KNN f1 score: 0.941\n",
      "KNN cohens kappa score: 0.939\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2284/68 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 68 points min:1.0 max:3.3166247903554\n",
      "-> create 2216 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 42984 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 570, 0\n",
      "LR fn, tp: 0, 13\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 570, 0\n",
      "GB fn, tp: 0, 13\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 570, 0\n",
      "KNN fn, tp: 1, 12\n",
      "KNN f1 score: 0.960\n",
      "KNN cohens kappa score: 0.959\n",
      "\n",
      "### Exercise is done.\n",
      "\n",
      "-----[ LR ]-----\n",
      "maximum:\n",
      "LR tn, fp: 571, 5\n",
      "LR fn, tp: 2, 17\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "\n",
      "average:\n",
      "LR tn, fp: 569.24, 1.56\n",
      "LR fn, tp: 0.92, 15.28\n",
      "LR f1 score: 0.926\n",
      "LR cohens kappa score: 0.924\n",
      "LR average precision score: 0.978\n",
      "\n",
      "\n",
      "minimum:\n",
      "LR tn, fp: 565, 0\n",
      "LR fn, tp: 0, 12\n",
      "LR f1 score: 0.800\n",
      "LR cohens kappa score: 0.795\n",
      "LR average precision score: 0.782\n",
      "\n",
      "\n",
      "-----[ GB ]-----\n",
      "maximum:\n",
      "GB tn, fp: 571, 1\n",
      "GB fn, tp: 0, 17\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "average:\n",
      "GB tn, fp: 570.76, 0.04\n",
      "GB fn, tp: 0.0, 16.2\n",
      "GB f1 score: 0.999\n",
      "GB cohens kappa score: 0.999\n",
      "\n",
      "\n",
      "minimum:\n",
      "GB tn, fp: 570, 0\n",
      "GB fn, tp: 0, 13\n",
      "GB f1 score: 0.971\n",
      "GB cohens kappa score: 0.971\n",
      "\n",
      "\n",
      "-----[ KNN ]-----\n",
      "maximum:\n",
      "KNN tn, fp: 571, 2\n",
      "KNN fn, tp: 3, 17\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "average:\n",
      "KNN tn, fp: 570.4, 0.4\n",
      "KNN fn, tp: 1.36, 14.84\n",
      "KNN f1 score: 0.942\n",
      "KNN cohens kappa score: 0.941\n",
      "\n",
      "\n",
      "minimum:\n",
      "KNN tn, fp: 568, 0\n",
      "KNN fn, tp: 0, 10\n",
      "KNN f1 score: 0.870\n",
      "KNN cohens kappa score: 0.867\n",
      "\n"
     ]
    }
   ],
   "source": [
    "runExerciseForSpheredNoise(\"folding_kr-vs-k-three_vs_eleven\", resultList)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "working-poland",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "///////////////////////////////////////////\n",
      "// Running SpheredNoise on folding_kr-vs-k-zero-one_vs_draw\n",
      "///////////////////////////////////////////\n",
      "\n",
      "-> Shuffling data\n",
      "### Start exercise for synthetic point generator\n",
      "\n",
      "====== Step 1/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 1/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2236/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:6.082762530298219\n",
      "-> create 2152 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 30136 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 556, 4\n",
      "LR fn, tp: 3, 18\n",
      "LR f1 score: 0.837\n",
      "LR cohens kappa score: 0.831\n",
      "LR average precision score: 0.831\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 560, 0\n",
      "GB fn, tp: 2, 19\n",
      "GB f1 score: 0.950\n",
      "GB cohens kappa score: 0.948\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 559, 1\n",
      "KNN fn, tp: 7, 14\n",
      "KNN f1 score: 0.778\n",
      "KNN cohens kappa score: 0.771\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2236/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:6.0\n",
      "-> create 2152 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 32416 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 554, 6\n",
      "LR fn, tp: 5, 16\n",
      "LR f1 score: 0.744\n",
      "LR cohens kappa score: 0.734\n",
      "LR average precision score: 0.892\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 559, 1\n",
      "GB fn, tp: 1, 20\n",
      "GB f1 score: 0.952\n",
      "GB cohens kappa score: 0.951\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 559, 1\n",
      "KNN fn, tp: 4, 17\n",
      "KNN f1 score: 0.872\n",
      "KNN cohens kappa score: 0.867\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2236/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:6.0\n",
      "-> create 2152 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 32620 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 548, 12\n",
      "LR fn, tp: 5, 16\n",
      "LR f1 score: 0.653\n",
      "LR cohens kappa score: 0.638\n",
      "LR average precision score: 0.770\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 560, 0\n",
      "GB fn, tp: 1, 20\n",
      "GB f1 score: 0.976\n",
      "GB cohens kappa score: 0.975\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 558, 2\n",
      "KNN fn, tp: 3, 18\n",
      "KNN f1 score: 0.878\n",
      "KNN cohens kappa score: 0.874\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2236/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:5.5677643628300215\n",
      "-> create 2152 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 33640 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 549, 11\n",
      "LR fn, tp: 3, 18\n",
      "LR f1 score: 0.720\n",
      "LR cohens kappa score: 0.708\n",
      "LR average precision score: 0.836\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 557, 3\n",
      "GB fn, tp: 1, 20\n",
      "GB f1 score: 0.909\n",
      "GB cohens kappa score: 0.906\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 560, 0\n",
      "KNN fn, tp: 4, 17\n",
      "KNN f1 score: 0.895\n",
      "KNN cohens kappa score: 0.891\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2240/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:6.0\n",
      "-> create 2156 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 31960 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 551, 5\n",
      "LR fn, tp: 3, 18\n",
      "LR f1 score: 0.818\n",
      "LR cohens kappa score: 0.811\n",
      "LR average precision score: 0.921\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 556, 0\n",
      "GB fn, tp: 1, 20\n",
      "GB f1 score: 0.976\n",
      "GB cohens kappa score: 0.975\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 556, 0\n",
      "KNN fn, tp: 4, 17\n",
      "KNN f1 score: 0.895\n",
      "KNN cohens kappa score: 0.891\n",
      "\n",
      "\n",
      "====== Step 2/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 2/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2236/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:6.0\n",
      "-> create 2152 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 31920 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 552, 8\n",
      "LR fn, tp: 2, 19\n",
      "LR f1 score: 0.792\n",
      "LR cohens kappa score: 0.783\n",
      "LR average precision score: 0.895\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 560, 0\n",
      "GB fn, tp: 1, 20\n",
      "GB f1 score: 0.976\n",
      "GB cohens kappa score: 0.975\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 560, 0\n",
      "KNN fn, tp: 3, 18\n",
      "KNN f1 score: 0.923\n",
      "KNN cohens kappa score: 0.920\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2236/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:6.082762530298219\n",
      "-> create 2152 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 30660 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 557, 3\n",
      "LR fn, tp: 4, 17\n",
      "LR f1 score: 0.829\n",
      "LR cohens kappa score: 0.823\n",
      "LR average precision score: 0.916\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 560, 0\n",
      "GB fn, tp: 2, 19\n",
      "GB f1 score: 0.950\n",
      "GB cohens kappa score: 0.948\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 560, 0\n",
      "KNN fn, tp: 4, 17\n",
      "KNN f1 score: 0.895\n",
      "KNN cohens kappa score: 0.891\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2236/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:6.0\n",
      "-> create 2152 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 32828 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 555, 5\n",
      "LR fn, tp: 3, 18\n",
      "LR f1 score: 0.818\n",
      "LR cohens kappa score: 0.811\n",
      "LR average precision score: 0.894\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 560, 0\n",
      "GB fn, tp: 0, 21\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 559, 1\n",
      "KNN fn, tp: 6, 15\n",
      "KNN f1 score: 0.811\n",
      "KNN cohens kappa score: 0.805\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2236/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:5.5677643628300215\n",
      "-> create 2152 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 31040 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 547, 13\n",
      "LR fn, tp: 3, 18\n",
      "LR f1 score: 0.692\n",
      "LR cohens kappa score: 0.678\n",
      "LR average precision score: 0.830\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 559, 1\n",
      "GB fn, tp: 1, 20\n",
      "GB f1 score: 0.952\n",
      "GB cohens kappa score: 0.951\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 556, 4\n",
      "KNN fn, tp: 6, 15\n",
      "KNN f1 score: 0.750\n",
      "KNN cohens kappa score: 0.741\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2240/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:6.0\n",
      "-> create 2156 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 32568 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 546, 10\n",
      "LR fn, tp: 6, 15\n",
      "LR f1 score: 0.652\n",
      "LR cohens kappa score: 0.638\n",
      "LR average precision score: 0.813\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 555, 1\n",
      "GB fn, tp: 0, 21\n",
      "GB f1 score: 0.977\n",
      "GB cohens kappa score: 0.976\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 556, 0\n",
      "KNN fn, tp: 5, 16\n",
      "KNN f1 score: 0.865\n",
      "KNN cohens kappa score: 0.860\n",
      "\n",
      "\n",
      "====== Step 3/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 3/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2236/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:6.0\n",
      "-> create 2152 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 33656 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 552, 8\n",
      "LR fn, tp: 3, 18\n",
      "LR f1 score: 0.766\n",
      "LR cohens kappa score: 0.756\n",
      "LR average precision score: 0.902\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 559, 1\n",
      "GB fn, tp: 1, 20\n",
      "GB f1 score: 0.952\n",
      "GB cohens kappa score: 0.951\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 558, 2\n",
      "KNN fn, tp: 2, 19\n",
      "KNN f1 score: 0.905\n",
      "KNN cohens kappa score: 0.901\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2236/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:6.0\n",
      "-> create 2152 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 33732 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 558, 2\n",
      "LR fn, tp: 4, 17\n",
      "LR f1 score: 0.850\n",
      "LR cohens kappa score: 0.845\n",
      "LR average precision score: 0.866\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 560, 0\n",
      "GB fn, tp: 1, 20\n",
      "GB f1 score: 0.976\n",
      "GB cohens kappa score: 0.975\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 558, 2\n",
      "KNN fn, tp: 7, 14\n",
      "KNN f1 score: 0.757\n",
      "KNN cohens kappa score: 0.749\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2236/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:6.0\n",
      "-> create 2152 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 32004 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 546, 14\n",
      "LR fn, tp: 5, 16\n",
      "LR f1 score: 0.627\n",
      "LR cohens kappa score: 0.611\n",
      "LR average precision score: 0.764\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 559, 1\n",
      "GB fn, tp: 1, 20\n",
      "GB f1 score: 0.952\n",
      "GB cohens kappa score: 0.951\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 560, 0\n",
      "KNN fn, tp: 5, 16\n",
      "KNN f1 score: 0.865\n",
      "KNN cohens kappa score: 0.861\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2236/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:5.5677643628300215\n",
      "-> create 2152 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 33228 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 549, 11\n",
      "LR fn, tp: 3, 18\n",
      "LR f1 score: 0.720\n",
      "LR cohens kappa score: 0.708\n",
      "LR average precision score: 0.891\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 560, 0\n",
      "GB fn, tp: 1, 20\n",
      "GB f1 score: 0.976\n",
      "GB cohens kappa score: 0.975\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 560, 0\n",
      "KNN fn, tp: 3, 18\n",
      "KNN f1 score: 0.923\n",
      "KNN cohens kappa score: 0.920\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2240/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:6.0\n",
      "-> create 2156 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 32536 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 553, 3\n",
      "LR fn, tp: 4, 17\n",
      "LR f1 score: 0.829\n",
      "LR cohens kappa score: 0.823\n",
      "LR average precision score: 0.897\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 556, 0\n",
      "GB fn, tp: 0, 21\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 556, 0\n",
      "KNN fn, tp: 4, 17\n",
      "KNN f1 score: 0.895\n",
      "KNN cohens kappa score: 0.891\n",
      "\n",
      "\n",
      "====== Step 4/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 4/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2236/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:6.0\n",
      "-> create 2152 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 32784 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 552, 8\n",
      "LR fn, tp: 3, 18\n",
      "LR f1 score: 0.766\n",
      "LR cohens kappa score: 0.756\n",
      "LR average precision score: 0.878\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 560, 0\n",
      "GB fn, tp: 0, 21\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 559, 1\n",
      "KNN fn, tp: 2, 19\n",
      "KNN f1 score: 0.927\n",
      "KNN cohens kappa score: 0.924\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2236/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:6.0\n",
      "-> create 2152 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 32832 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 552, 8\n",
      "LR fn, tp: 2, 19\n",
      "LR f1 score: 0.792\n",
      "LR cohens kappa score: 0.783\n",
      "LR average precision score: 0.936\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 560, 0\n",
      "GB fn, tp: 0, 21\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 560, 0\n",
      "KNN fn, tp: 3, 18\n",
      "KNN f1 score: 0.923\n",
      "KNN cohens kappa score: 0.920\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2236/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:6.0\n",
      "-> create 2152 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 33240 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 555, 5\n",
      "LR fn, tp: 7, 14\n",
      "LR f1 score: 0.700\n",
      "LR cohens kappa score: 0.689\n",
      "LR average precision score: 0.777\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 559, 1\n",
      "GB fn, tp: 1, 20\n",
      "GB f1 score: 0.952\n",
      "GB cohens kappa score: 0.951\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 558, 2\n",
      "KNN fn, tp: 8, 13\n",
      "KNN f1 score: 0.722\n",
      "KNN cohens kappa score: 0.714\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2236/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:5.5677643628300215\n",
      "-> create 2152 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 30972 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 551, 9\n",
      "LR fn, tp: 3, 18\n",
      "LR f1 score: 0.750\n",
      "LR cohens kappa score: 0.739\n",
      "LR average precision score: 0.853\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 559, 1\n",
      "GB fn, tp: 0, 21\n",
      "GB f1 score: 0.977\n",
      "GB cohens kappa score: 0.976\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 559, 1\n",
      "KNN fn, tp: 3, 18\n",
      "KNN f1 score: 0.900\n",
      "KNN cohens kappa score: 0.896\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2240/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:6.082762530298219\n",
      "-> create 2156 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 33868 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 550, 6\n",
      "LR fn, tp: 3, 18\n",
      "LR f1 score: 0.800\n",
      "LR cohens kappa score: 0.792\n",
      "LR average precision score: 0.873\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 556, 0\n",
      "GB fn, tp: 2, 19\n",
      "GB f1 score: 0.950\n",
      "GB cohens kappa score: 0.948\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 556, 0\n",
      "KNN fn, tp: 5, 16\n",
      "KNN f1 score: 0.865\n",
      "KNN cohens kappa score: 0.860\n",
      "\n",
      "\n",
      "====== Step 5/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 5/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2236/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:5.5677643628300215\n",
      "-> create 2152 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 34328 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 556, 4\n",
      "LR fn, tp: 3, 18\n",
      "LR f1 score: 0.837\n",
      "LR cohens kappa score: 0.831\n",
      "LR average precision score: 0.952\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 559, 1\n",
      "GB fn, tp: 1, 20\n",
      "GB f1 score: 0.952\n",
      "GB cohens kappa score: 0.951\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 560, 0\n",
      "KNN fn, tp: 4, 17\n",
      "KNN f1 score: 0.895\n",
      "KNN cohens kappa score: 0.891\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2236/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:6.082762530298219\n",
      "-> create 2152 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 32948 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 554, 6\n",
      "LR fn, tp: 7, 14\n",
      "LR f1 score: 0.683\n",
      "LR cohens kappa score: 0.671\n",
      "LR average precision score: 0.839\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 560, 0\n",
      "GB fn, tp: 3, 18\n",
      "GB f1 score: 0.923\n",
      "GB cohens kappa score: 0.920\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 560, 0\n",
      "KNN fn, tp: 5, 16\n",
      "KNN f1 score: 0.865\n",
      "KNN cohens kappa score: 0.861\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2236/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:6.0\n",
      "-> create 2152 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 33472 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 552, 8\n",
      "LR fn, tp: 4, 17\n",
      "LR f1 score: 0.739\n",
      "LR cohens kappa score: 0.728\n",
      "LR average precision score: 0.796\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 560, 0\n",
      "GB fn, tp: 1, 20\n",
      "GB f1 score: 0.976\n",
      "GB cohens kappa score: 0.975\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 558, 2\n",
      "KNN fn, tp: 5, 16\n",
      "KNN f1 score: 0.821\n",
      "KNN cohens kappa score: 0.814\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2236/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:6.0\n",
      "-> create 2152 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 32532 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 549, 11\n",
      "LR fn, tp: 5, 16\n",
      "LR f1 score: 0.667\n",
      "LR cohens kappa score: 0.653\n",
      "LR average precision score: 0.811\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 560, 0\n",
      "GB fn, tp: 1, 20\n",
      "GB f1 score: 0.976\n",
      "GB cohens kappa score: 0.975\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 559, 1\n",
      "KNN fn, tp: 6, 15\n",
      "KNN f1 score: 0.811\n",
      "KNN cohens kappa score: 0.805\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2240/84 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 84 points min:1.0 max:6.0\n",
      "-> create 2156 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 31404 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 548, 8\n",
      "LR fn, tp: 1, 20\n",
      "LR f1 score: 0.816\n",
      "LR cohens kappa score: 0.808\n",
      "LR average precision score: 0.902\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 556, 0\n",
      "GB fn, tp: 0, 21\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 555, 1\n",
      "KNN fn, tp: 2, 19\n",
      "KNN f1 score: 0.927\n",
      "KNN cohens kappa score: 0.924\n",
      "\n",
      "### Exercise is done.\n",
      "\n",
      "-----[ LR ]-----\n",
      "maximum:\n",
      "LR tn, fp: 558, 14\n",
      "LR fn, tp: 7, 20\n",
      "LR f1 score: 0.850\n",
      "LR cohens kappa score: 0.845\n",
      "LR average precision score: 0.952\n",
      "\n",
      "\n",
      "average:\n",
      "LR tn, fp: 551.68, 7.52\n",
      "LR fn, tp: 3.76, 17.24\n",
      "LR f1 score: 0.756\n",
      "LR cohens kappa score: 0.746\n",
      "LR average precision score: 0.861\n",
      "\n",
      "\n",
      "minimum:\n",
      "LR tn, fp: 546, 2\n",
      "LR fn, tp: 1, 14\n",
      "LR f1 score: 0.627\n",
      "LR cohens kappa score: 0.611\n",
      "LR average precision score: 0.764\n",
      "\n",
      "\n",
      "-----[ GB ]-----\n",
      "maximum:\n",
      "GB tn, fp: 560, 3\n",
      "GB fn, tp: 3, 21\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "average:\n",
      "GB tn, fp: 558.76, 0.44\n",
      "GB fn, tp: 0.92, 20.08\n",
      "GB f1 score: 0.967\n",
      "GB cohens kappa score: 0.966\n",
      "\n",
      "\n",
      "minimum:\n",
      "GB tn, fp: 555, 0\n",
      "GB fn, tp: 0, 18\n",
      "GB f1 score: 0.909\n",
      "GB cohens kappa score: 0.906\n",
      "\n",
      "\n",
      "-----[ KNN ]-----\n",
      "maximum:\n",
      "KNN tn, fp: 560, 4\n",
      "KNN fn, tp: 8, 19\n",
      "KNN f1 score: 0.927\n",
      "KNN cohens kappa score: 0.924\n",
      "\n",
      "\n",
      "average:\n",
      "KNN tn, fp: 558.36, 0.84\n",
      "KNN fn, tp: 4.4, 16.6\n",
      "KNN f1 score: 0.862\n",
      "KNN cohens kappa score: 0.858\n",
      "\n",
      "\n",
      "minimum:\n",
      "KNN tn, fp: 555, 0\n",
      "KNN fn, tp: 2, 13\n",
      "KNN f1 score: 0.722\n",
      "KNN cohens kappa score: 0.714\n",
      "\n"
     ]
    }
   ],
   "source": [
    "runExerciseForSpheredNoise(\"folding_kr-vs-k-zero-one_vs_draw\", resultList)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "complimentary-observer",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "///////////////////////////////////////////\n",
      "// Running SpheredNoise on folding_shuttle-2_vs_5\n",
      "///////////////////////////////////////////\n",
      "\n",
      "-> Shuffling data\n",
      "### Start exercise for synthetic point generator\n",
      "\n",
      "====== Step 1/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 1/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2613/39 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 39 points min:15.652475842498529 max:106.4377752492037\n",
      "-> create 2574 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 12768 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 652, 2\n",
      "LR fn, tp: 0, 10\n",
      "LR f1 score: 0.909\n",
      "LR cohens kappa score: 0.908\n",
      "LR average precision score: 0.909\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 653, 1\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 0.952\n",
      "GB cohens kappa score: 0.952\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 653, 1\n",
      "KNN fn, tp: 0, 10\n",
      "KNN f1 score: 0.952\n",
      "KNN cohens kappa score: 0.952\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2613/39 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 39 points min:18.083141320025124 max:106.4377752492037\n",
      "-> create 2574 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 12936 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 654, 0\n",
      "LR fn, tp: 0, 10\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 654, 0\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 653, 1\n",
      "KNN fn, tp: 2, 8\n",
      "KNN f1 score: 0.842\n",
      "KNN cohens kappa score: 0.840\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2613/39 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 39 points min:15.652475842498529 max:106.4377752492037\n",
      "-> create 2574 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14264 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 653, 1\n",
      "LR fn, tp: 0, 10\n",
      "LR f1 score: 0.952\n",
      "LR cohens kappa score: 0.952\n",
      "LR average precision score: 0.892\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 654, 0\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 654, 0\n",
      "KNN fn, tp: 1, 9\n",
      "KNN f1 score: 0.947\n",
      "KNN cohens kappa score: 0.947\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2613/39 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 39 points min:15.652475842498529 max:90.82400563727631\n",
      "-> create 2574 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13116 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 653, 1\n",
      "LR fn, tp: 0, 10\n",
      "LR f1 score: 0.952\n",
      "LR cohens kappa score: 0.952\n",
      "LR average precision score: 0.901\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 654, 0\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 653, 1\n",
      "KNN fn, tp: 0, 10\n",
      "KNN f1 score: 0.952\n",
      "KNN cohens kappa score: 0.952\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2616/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:16.186414056238647 max:109.5810202544218\n",
      "-> create 2576 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 12988 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 651, 0\n",
      "LR fn, tp: 0, 9\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 651, 0\n",
      "GB fn, tp: 0, 9\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 651, 0\n",
      "KNN fn, tp: 0, 9\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "====== Step 2/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 2/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2613/39 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 39 points min:15.652475842498529 max:106.4377752492037\n",
      "-> create 2574 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 12544 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 654, 0\n",
      "LR fn, tp: 0, 10\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 654, 0\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 654, 0\n",
      "KNN fn, tp: 2, 8\n",
      "KNN f1 score: 0.889\n",
      "KNN cohens kappa score: 0.887\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2613/39 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 39 points min:15.652475842498529 max:106.4377752492037\n",
      "-> create 2574 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13072 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 654, 0\n",
      "LR fn, tp: 0, 10\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 652, 2\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 0.909\n",
      "GB cohens kappa score: 0.908\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 654, 0\n",
      "KNN fn, tp: 0, 10\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2613/39 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 39 points min:23.173260452512935 max:90.64215354899729\n",
      "-> create 2574 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 12764 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 654, 0\n",
      "LR fn, tp: 0, 10\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 653, 1\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 0.952\n",
      "GB cohens kappa score: 0.952\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 652, 2\n",
      "KNN fn, tp: 2, 8\n",
      "KNN f1 score: 0.800\n",
      "KNN cohens kappa score: 0.797\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2613/39 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 39 points min:15.652475842498529 max:106.4377752492037\n",
      "-> create 2574 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13164 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 654, 0\n",
      "LR fn, tp: 0, 10\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 654, 0\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 654, 0\n",
      "KNN fn, tp: 0, 10\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2616/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:15.652475842498529 max:109.5810202544218\n",
      "-> create 2576 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14156 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 651, 0\n",
      "LR fn, tp: 0, 9\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 651, 0\n",
      "GB fn, tp: 0, 9\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 650, 1\n",
      "KNN fn, tp: 0, 9\n",
      "KNN f1 score: 0.947\n",
      "KNN cohens kappa score: 0.947\n",
      "\n",
      "\n",
      "====== Step 3/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 3/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2613/39 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 39 points min:16.186414056238647 max:109.5810202544218\n",
      "-> create 2574 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 12932 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 654, 0\n",
      "LR fn, tp: 0, 10\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 654, 0\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 654, 0\n",
      "KNN fn, tp: 0, 10\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2613/39 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 39 points min:15.652475842498529 max:106.4377752492037\n",
      "-> create 2574 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 12664 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 654, 0\n",
      "LR fn, tp: 0, 10\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 653, 1\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 0.952\n",
      "GB cohens kappa score: 0.952\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 653, 1\n",
      "KNN fn, tp: 1, 9\n",
      "KNN f1 score: 0.900\n",
      "KNN cohens kappa score: 0.898\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2613/39 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 39 points min:15.652475842498529 max:106.4377752492037\n",
      "-> create 2574 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13104 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 654, 0\n",
      "LR fn, tp: 0, 10\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 654, 0\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 654, 0\n",
      "KNN fn, tp: 0, 10\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2613/39 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 39 points min:15.652475842498529 max:90.82400563727631\n",
      "-> create 2574 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13124 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 654, 0\n",
      "LR fn, tp: 0, 10\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 654, 0\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 653, 1\n",
      "KNN fn, tp: 2, 8\n",
      "KNN f1 score: 0.842\n",
      "KNN cohens kappa score: 0.840\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2616/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:18.083141320025124 max:106.4377752492037\n",
      "-> create 2576 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13012 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 651, 0\n",
      "LR fn, tp: 0, 9\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 650, 1\n",
      "GB fn, tp: 0, 9\n",
      "GB f1 score: 0.947\n",
      "GB cohens kappa score: 0.947\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 650, 1\n",
      "KNN fn, tp: 1, 8\n",
      "KNN f1 score: 0.889\n",
      "KNN cohens kappa score: 0.887\n",
      "\n",
      "\n",
      "====== Step 4/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 4/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2613/39 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 39 points min:15.652475842498529 max:106.4377752492037\n",
      "-> create 2574 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13268 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 654, 0\n",
      "LR fn, tp: 0, 10\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 653, 1\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 0.952\n",
      "GB cohens kappa score: 0.952\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 654, 0\n",
      "KNN fn, tp: 0, 10\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2613/39 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 39 points min:15.652475842498529 max:109.5810202544218\n",
      "-> create 2574 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13100 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 654, 0\n",
      "LR fn, tp: 0, 10\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 654, 0\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 653, 1\n",
      "KNN fn, tp: 0, 10\n",
      "KNN f1 score: 0.952\n",
      "KNN cohens kappa score: 0.952\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2613/39 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 39 points min:15.652475842498529 max:91.0\n",
      "-> create 2574 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13056 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 654, 0\n",
      "LR fn, tp: 0, 10\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 654, 0\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 654, 0\n",
      "KNN fn, tp: 1, 9\n",
      "KNN f1 score: 0.947\n",
      "KNN cohens kappa score: 0.947\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2613/39 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 39 points min:23.366642891095847 max:106.4377752492037\n",
      "-> create 2574 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13248 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 653, 1\n",
      "LR fn, tp: 0, 10\n",
      "LR f1 score: 0.952\n",
      "LR cohens kappa score: 0.952\n",
      "LR average precision score: 0.981\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 654, 0\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 653, 1\n",
      "KNN fn, tp: 2, 8\n",
      "KNN f1 score: 0.842\n",
      "KNN cohens kappa score: 0.840\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2616/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:16.186414056238647 max:106.4377752492037\n",
      "-> create 2576 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13060 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 650, 1\n",
      "LR fn, tp: 0, 9\n",
      "LR f1 score: 0.947\n",
      "LR cohens kappa score: 0.947\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 650, 1\n",
      "GB fn, tp: 0, 9\n",
      "GB f1 score: 0.947\n",
      "GB cohens kappa score: 0.947\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 650, 1\n",
      "KNN fn, tp: 0, 9\n",
      "KNN f1 score: 0.947\n",
      "KNN cohens kappa score: 0.947\n",
      "\n",
      "\n",
      "====== Step 5/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 5/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2613/39 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 39 points min:15.652475842498529 max:106.4377752492037\n",
      "-> create 2574 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 12964 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 654, 0\n",
      "LR fn, tp: 0, 10\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 654, 0\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 653, 1\n",
      "KNN fn, tp: 0, 10\n",
      "KNN f1 score: 0.952\n",
      "KNN cohens kappa score: 0.952\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2613/39 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 39 points min:15.652475842498529 max:90.82400563727631\n",
      "-> create 2574 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13280 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 654, 0\n",
      "LR fn, tp: 0, 10\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 654, 0\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 654, 0\n",
      "KNN fn, tp: 1, 9\n",
      "KNN f1 score: 0.947\n",
      "KNN cohens kappa score: 0.947\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2613/39 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 39 points min:23.173260452512935 max:109.5810202544218\n",
      "-> create 2574 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 12184 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 654, 0\n",
      "LR fn, tp: 0, 10\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 654, 0\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 652, 2\n",
      "KNN fn, tp: 2, 8\n",
      "KNN f1 score: 0.800\n",
      "KNN cohens kappa score: 0.797\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2613/39 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 39 points min:15.652475842498529 max:106.4377752492037\n",
      "-> create 2574 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 13072 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 654, 0\n",
      "LR fn, tp: 0, 10\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 654, 0\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 654, 0\n",
      "KNN fn, tp: 0, 10\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 2616/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:16.186414056238647 max:106.4377752492037\n",
      "-> create 2576 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 12856 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 650, 1\n",
      "LR fn, tp: 0, 9\n",
      "LR f1 score: 0.947\n",
      "LR cohens kappa score: 0.947\n",
      "LR average precision score: 0.879\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 650, 1\n",
      "GB fn, tp: 0, 9\n",
      "GB f1 score: 0.947\n",
      "GB cohens kappa score: 0.947\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 650, 1\n",
      "KNN fn, tp: 1, 8\n",
      "KNN f1 score: 0.889\n",
      "KNN cohens kappa score: 0.887\n",
      "\n",
      "### Exercise is done.\n",
      "\n",
      "-----[ LR ]-----\n",
      "maximum:\n",
      "LR tn, fp: 654, 2\n",
      "LR fn, tp: 0, 10\n",
      "LR f1 score: 1.000\n",
      "LR cohens kappa score: 1.000\n",
      "LR average precision score: 1.000\n",
      "\n",
      "\n",
      "average:\n",
      "LR tn, fp: 653.12, 0.28\n",
      "LR fn, tp: 0.0, 9.8\n",
      "LR f1 score: 0.986\n",
      "LR cohens kappa score: 0.986\n",
      "LR average precision score: 0.982\n",
      "\n",
      "\n",
      "minimum:\n",
      "LR tn, fp: 650, 0\n",
      "LR fn, tp: 0, 9\n",
      "LR f1 score: 0.909\n",
      "LR cohens kappa score: 0.908\n",
      "LR average precision score: 0.879\n",
      "\n",
      "\n",
      "-----[ GB ]-----\n",
      "maximum:\n",
      "GB tn, fp: 654, 2\n",
      "GB fn, tp: 0, 10\n",
      "GB f1 score: 1.000\n",
      "GB cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "average:\n",
      "GB tn, fp: 653.04, 0.36\n",
      "GB fn, tp: 0.0, 9.8\n",
      "GB f1 score: 0.982\n",
      "GB cohens kappa score: 0.982\n",
      "\n",
      "\n",
      "minimum:\n",
      "GB tn, fp: 650, 0\n",
      "GB fn, tp: 0, 9\n",
      "GB f1 score: 0.909\n",
      "GB cohens kappa score: 0.908\n",
      "\n",
      "\n",
      "-----[ KNN ]-----\n",
      "maximum:\n",
      "KNN tn, fp: 654, 2\n",
      "KNN fn, tp: 2, 10\n",
      "KNN f1 score: 1.000\n",
      "KNN cohens kappa score: 1.000\n",
      "\n",
      "\n",
      "average:\n",
      "KNN tn, fp: 652.76, 0.64\n",
      "KNN fn, tp: 0.72, 9.08\n",
      "KNN f1 score: 0.930\n",
      "KNN cohens kappa score: 0.929\n",
      "\n",
      "\n",
      "minimum:\n",
      "KNN tn, fp: 650, 0\n",
      "KNN fn, tp: 0, 8\n",
      "KNN f1 score: 0.800\n",
      "KNN cohens kappa score: 0.797\n",
      "\n"
     ]
    }
   ],
   "source": [
    "runExerciseForSpheredNoise(\"folding_shuttle-2_vs_5\", resultList)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "included-pound",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "///////////////////////////////////////////\n",
      "// Running SpheredNoise on folding_winequality-red-4\n",
      "///////////////////////////////////////////\n",
      "\n",
      "-> Shuffling data\n",
      "### Start exercise for synthetic point generator\n",
      "\n",
      "====== Step 1/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 1/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1236/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:0.542887025540305 max:13.164740804983591\n",
      "-> create 1194 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26416 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 309, 1\n",
      "LR fn, tp: 11, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.006\n",
      "LR average precision score: 0.149\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 307, 3\n",
      "GB fn, tp: 10, 1\n",
      "GB f1 score: 0.133\n",
      "GB cohens kappa score: 0.117\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 310, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1236/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:0.542887025540305 max:13.364807372932841\n",
      "-> create 1194 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25704 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 309, 1\n",
      "LR fn, tp: 11, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.006\n",
      "LR average precision score: 0.134\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 308, 2\n",
      "GB fn, tp: 11, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.011\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 310, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1236/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:0.7107056774783781 max:13.164740804983591\n",
      "-> create 1194 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22848 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 310, 0\n",
      "LR fn, tp: 11, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: 0.000\n",
      "LR average precision score: 0.181\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 308, 2\n",
      "GB fn, tp: 11, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.011\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 310, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1236/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:0.542887025540305 max:3.9618467065751037\n",
      "-> create 1194 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25080 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 308, 2\n",
      "LR fn, tp: 10, 1\n",
      "LR f1 score: 0.143\n",
      "LR cohens kappa score: 0.130\n",
      "LR average precision score: 0.112\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 308, 2\n",
      "GB fn, tp: 10, 1\n",
      "GB f1 score: 0.143\n",
      "GB cohens kappa score: 0.130\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 310, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1240/44 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 44 points min:0.7107056774783781 max:13.164740804983591\n",
      "-> create 1196 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 22780 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 306, 0\n",
      "LR fn, tp: 8, 1\n",
      "LR f1 score: 0.200\n",
      "LR cohens kappa score: 0.195\n",
      "LR average precision score: 0.218\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 305, 1\n",
      "GB fn, tp: 8, 1\n",
      "GB f1 score: 0.182\n",
      "GB cohens kappa score: 0.173\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 306, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "====== Step 2/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 2/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1236/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:0.542887025540305 max:13.364807372932841\n",
      "-> create 1194 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25864 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 309, 1\n",
      "LR fn, tp: 10, 1\n",
      "LR f1 score: 0.154\n",
      "LR cohens kappa score: 0.145\n",
      "LR average precision score: 0.145\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 306, 4\n",
      "GB fn, tp: 10, 1\n",
      "GB f1 score: 0.125\n",
      "GB cohens kappa score: 0.106\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 310, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1236/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:0.9743119738564242 max:13.164740804983591\n",
      "-> create 1194 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23272 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 310, 0\n",
      "LR fn, tp: 11, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: 0.000\n",
      "LR average precision score: 0.134\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 307, 3\n",
      "GB fn, tp: 11, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.015\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 310, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1236/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:0.6050000330578494 max:5.15715300079414\n",
      "-> create 1194 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24844 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 308, 2\n",
      "LR fn, tp: 11, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.011\n",
      "LR average precision score: 0.126\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 308, 2\n",
      "GB fn, tp: 11, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.011\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 310, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1236/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:0.542887025540305 max:13.164740804983591\n",
      "-> create 1194 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25292 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 310, 0\n",
      "LR fn, tp: 11, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: 0.000\n",
      "LR average precision score: 0.259\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 310, 0\n",
      "GB fn, tp: 11, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: 0.000\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 310, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1240/44 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 44 points min:0.542887025540305 max:13.164740804983591\n",
      "-> create 1196 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24920 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 305, 1\n",
      "LR fn, tp: 9, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.006\n",
      "LR average precision score: 0.094\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 303, 3\n",
      "GB fn, tp: 8, 1\n",
      "GB f1 score: 0.154\n",
      "GB cohens kappa score: 0.139\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 306, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "====== Step 3/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 3/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1236/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:0.542887025540305 max:13.164740804983591\n",
      "-> create 1194 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 21516 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 309, 1\n",
      "LR fn, tp: 11, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.006\n",
      "LR average precision score: 0.168\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 308, 2\n",
      "GB fn, tp: 10, 1\n",
      "GB f1 score: 0.143\n",
      "GB cohens kappa score: 0.130\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 310, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1236/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:0.6050000330578494 max:13.164740804983591\n",
      "-> create 1194 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26072 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 310, 0\n",
      "LR fn, tp: 11, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: 0.000\n",
      "LR average precision score: 0.207\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 308, 2\n",
      "GB fn, tp: 11, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.011\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 310, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1236/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:0.542887025540305 max:8.006020815261474\n",
      "-> create 1194 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24296 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 308, 2\n",
      "LR fn, tp: 11, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.011\n",
      "LR average precision score: 0.079\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 306, 4\n",
      "GB fn, tp: 11, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.019\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 310, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1236/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:0.7107056774783781 max:13.164740804983591\n",
      "-> create 1194 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25276 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 309, 1\n",
      "LR fn, tp: 11, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.006\n",
      "LR average precision score: 0.173\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 308, 2\n",
      "GB fn, tp: 11, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.011\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 310, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1240/44 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 44 points min:0.542887025540305 max:13.364807372932841\n",
      "-> create 1196 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24096 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 306, 0\n",
      "LR fn, tp: 9, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: 0.000\n",
      "LR average precision score: 0.098\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 305, 1\n",
      "GB fn, tp: 8, 1\n",
      "GB f1 score: 0.182\n",
      "GB cohens kappa score: 0.173\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 306, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "====== Step 4/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 4/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1236/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:0.8812840168753769 max:13.164740804983591\n",
      "-> create 1194 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 23080 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 310, 0\n",
      "LR fn, tp: 11, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: 0.000\n",
      "LR average precision score: 0.345\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 309, 1\n",
      "GB fn, tp: 10, 1\n",
      "GB f1 score: 0.154\n",
      "GB cohens kappa score: 0.145\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 310, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1236/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:0.542887025540305 max:5.15715300079414\n",
      "-> create 1194 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24728 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 309, 1\n",
      "LR fn, tp: 11, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.006\n",
      "LR average precision score: 0.173\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 308, 2\n",
      "GB fn, tp: 10, 1\n",
      "GB f1 score: 0.143\n",
      "GB cohens kappa score: 0.130\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 310, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1236/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:0.542887025540305 max:13.164740804983591\n",
      "-> create 1194 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24672 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 310, 0\n",
      "LR fn, tp: 11, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: 0.000\n",
      "LR average precision score: 0.101\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 309, 1\n",
      "GB fn, tp: 11, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.006\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 310, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1236/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:0.542887025540305 max:13.164740804983591\n",
      "-> create 1194 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24108 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 307, 3\n",
      "LR fn, tp: 11, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.015\n",
      "LR average precision score: 0.147\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 307, 3\n",
      "GB fn, tp: 11, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.015\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 310, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1240/44 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 44 points min:0.542887025540305 max:13.364807372932841\n",
      "-> create 1196 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 26660 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 306, 0\n",
      "LR fn, tp: 9, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: 0.000\n",
      "LR average precision score: 0.048\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 303, 3\n",
      "GB fn, tp: 9, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.014\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 306, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "====== Step 5/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 5/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1236/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:0.542887025540305 max:5.15715300079414\n",
      "-> create 1194 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24712 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 309, 1\n",
      "LR fn, tp: 11, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.006\n",
      "LR average precision score: 0.077\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 307, 3\n",
      "GB fn, tp: 11, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.015\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 310, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1236/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:0.6050000330578494 max:13.164740804983591\n",
      "-> create 1194 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 20612 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 310, 0\n",
      "LR fn, tp: 11, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: 0.000\n",
      "LR average precision score: 0.096\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 307, 3\n",
      "GB fn, tp: 9, 2\n",
      "GB f1 score: 0.250\n",
      "GB cohens kappa score: 0.234\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 310, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1236/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:0.542887025540305 max:13.164740804983591\n",
      "-> create 1194 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 24884 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 309, 1\n",
      "LR fn, tp: 11, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.006\n",
      "LR average precision score: 0.220\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 306, 4\n",
      "GB fn, tp: 9, 2\n",
      "GB f1 score: 0.235\n",
      "GB cohens kappa score: 0.216\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 310, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1236/42 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 42 points min:0.542887025540305 max:13.164740804983591\n",
      "-> create 1194 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 25788 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 309, 1\n",
      "LR fn, tp: 10, 1\n",
      "LR f1 score: 0.154\n",
      "LR cohens kappa score: 0.145\n",
      "LR average precision score: 0.225\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 310, 0\n",
      "GB fn, tp: 10, 1\n",
      "GB f1 score: 0.167\n",
      "GB cohens kappa score: 0.162\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 310, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1240/44 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 44 points min:0.6050000330578494 max:13.164740804983591\n",
      "-> create 1196 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 28256 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 305, 1\n",
      "LR fn, tp: 9, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.006\n",
      "LR average precision score: 0.168\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 301, 5\n",
      "GB fn, tp: 9, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.021\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 306, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "### Exercise is done.\n",
      "\n",
      "-----[ LR ]-----\n",
      "maximum:\n",
      "LR tn, fp: 310, 3\n",
      "LR fn, tp: 11, 1\n",
      "LR f1 score: 0.200\n",
      "LR cohens kappa score: 0.195\n",
      "LR average precision score: 0.345\n",
      "\n",
      "\n",
      "average:\n",
      "LR tn, fp: 308.4, 0.8\n",
      "LR fn, tp: 10.44, 0.16\n",
      "LR f1 score: 0.026\n",
      "LR cohens kappa score: 0.021\n",
      "LR average precision score: 0.155\n",
      "\n",
      "\n",
      "minimum:\n",
      "LR tn, fp: 305, 0\n",
      "LR fn, tp: 8, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.015\n",
      "LR average precision score: 0.048\n",
      "\n",
      "\n",
      "-----[ GB ]-----\n",
      "maximum:\n",
      "GB tn, fp: 310, 5\n",
      "GB fn, tp: 11, 2\n",
      "GB f1 score: 0.250\n",
      "GB cohens kappa score: 0.234\n",
      "\n",
      "\n",
      "average:\n",
      "GB tn, fp: 306.88, 2.32\n",
      "GB fn, tp: 10.04, 0.56\n",
      "GB f1 score: 0.080\n",
      "GB cohens kappa score: 0.068\n",
      "\n",
      "\n",
      "minimum:\n",
      "GB tn, fp: 301, 0\n",
      "GB fn, tp: 8, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.021\n",
      "\n",
      "\n",
      "-----[ KNN ]-----\n",
      "maximum:\n",
      "KNN tn, fp: 310, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "average:\n",
      "KNN tn, fp: 309.2, 0.0\n",
      "KNN fn, tp: 10.6, 0.0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "minimum:\n",
      "KNN tn, fp: 306, 0\n",
      "KNN fn, tp: 9, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n"
     ]
    }
   ],
   "source": [
    "runExerciseForSpheredNoise(\"folding_winequality-red-4\", resultList)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "primary-rendering",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "///////////////////////////////////////////\n",
      "// Running SpheredNoise on folding_yeast4\n",
      "///////////////////////////////////////////\n",
      "\n",
      "-> Shuffling data\n",
      "### Start exercise for synthetic point generator\n",
      "\n",
      "====== Step 1/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 1/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1146/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:0.026457513110645887 max:0.21118712081942884\n",
      "-> create 1106 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14608 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 285, 2\n",
      "LR fn, tp: 8, 3\n",
      "LR f1 score: 0.375\n",
      "LR cohens kappa score: 0.360\n",
      "LR average precision score: 0.428\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 284, 3\n",
      "GB fn, tp: 10, 1\n",
      "GB f1 score: 0.133\n",
      "GB cohens kappa score: 0.116\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 287, 0\n",
      "KNN fn, tp: 10, 1\n",
      "KNN f1 score: 0.167\n",
      "KNN cohens kappa score: 0.162\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1146/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:0.026457513110645887 max:0.20808652046684803\n",
      "-> create 1106 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15168 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 286, 1\n",
      "LR fn, tp: 7, 4\n",
      "LR f1 score: 0.500\n",
      "LR cohens kappa score: 0.488\n",
      "LR average precision score: 0.656\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 283, 4\n",
      "GB fn, tp: 7, 4\n",
      "GB f1 score: 0.421\n",
      "GB cohens kappa score: 0.402\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 287, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1146/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:0.03872983346207415 max:0.25000000000000006\n",
      "-> create 1106 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14756 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 285, 2\n",
      "LR fn, tp: 10, 1\n",
      "LR f1 score: 0.143\n",
      "LR cohens kappa score: 0.129\n",
      "LR average precision score: 0.390\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 286, 1\n",
      "GB fn, tp: 10, 1\n",
      "GB f1 score: 0.154\n",
      "GB cohens kappa score: 0.144\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 287, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1146/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:0.03872983346207415 max:0.20808652046684803\n",
      "-> create 1106 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15596 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 284, 3\n",
      "LR fn, tp: 9, 2\n",
      "LR f1 score: 0.250\n",
      "LR cohens kappa score: 0.232\n",
      "LR average precision score: 0.213\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 282, 5\n",
      "GB fn, tp: 9, 2\n",
      "GB f1 score: 0.222\n",
      "GB cohens kappa score: 0.199\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 285, 2\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: -0.011\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1148/44 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 44 points min:0.026457513110645887 max:0.23043437243605827\n",
      "-> create 1104 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15096 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 284, 1\n",
      "LR fn, tp: 6, 1\n",
      "LR f1 score: 0.222\n",
      "LR cohens kappa score: 0.214\n",
      "LR average precision score: 0.493\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 284, 1\n",
      "GB fn, tp: 4, 3\n",
      "GB f1 score: 0.545\n",
      "GB cohens kappa score: 0.537\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 284, 1\n",
      "KNN fn, tp: 7, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: -0.006\n",
      "\n",
      "\n",
      "====== Step 2/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 2/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1146/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:0.026457513110645887 max:0.20808652046684803\n",
      "-> create 1106 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 11024 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 286, 1\n",
      "LR fn, tp: 10, 1\n",
      "LR f1 score: 0.154\n",
      "LR cohens kappa score: 0.144\n",
      "LR average precision score: 0.286\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 281, 6\n",
      "GB fn, tp: 10, 1\n",
      "GB f1 score: 0.111\n",
      "GB cohens kappa score: 0.085\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 287, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1146/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:0.026457513110645887 max:0.22181073012818836\n",
      "-> create 1106 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14788 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 284, 3\n",
      "LR fn, tp: 5, 6\n",
      "LR f1 score: 0.600\n",
      "LR cohens kappa score: 0.586\n",
      "LR average precision score: 0.473\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 285, 2\n",
      "GB fn, tp: 7, 4\n",
      "GB f1 score: 0.471\n",
      "GB cohens kappa score: 0.456\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 286, 1\n",
      "KNN fn, tp: 9, 2\n",
      "KNN f1 score: 0.286\n",
      "KNN cohens kappa score: 0.274\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1146/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:0.026457513110645887 max:0.2366431913239846\n",
      "-> create 1106 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14756 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 285, 2\n",
      "LR fn, tp: 9, 2\n",
      "LR f1 score: 0.267\n",
      "LR cohens kappa score: 0.252\n",
      "LR average precision score: 0.402\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 285, 2\n",
      "GB fn, tp: 8, 3\n",
      "GB f1 score: 0.375\n",
      "GB cohens kappa score: 0.360\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 286, 1\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: -0.006\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1146/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:0.052915026221291794 max:0.20049937655763428\n",
      "-> create 1106 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15260 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 286, 1\n",
      "LR fn, tp: 10, 1\n",
      "LR f1 score: 0.154\n",
      "LR cohens kappa score: 0.144\n",
      "LR average precision score: 0.388\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 285, 2\n",
      "GB fn, tp: 8, 3\n",
      "GB f1 score: 0.375\n",
      "GB cohens kappa score: 0.360\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 286, 1\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: -0.006\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1148/44 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 44 points min:0.026457513110645887 max:0.20808652046684803\n",
      "-> create 1104 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15516 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 284, 1\n",
      "LR fn, tp: 6, 1\n",
      "LR f1 score: 0.222\n",
      "LR cohens kappa score: 0.214\n",
      "LR average precision score: 0.505\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 283, 2\n",
      "GB fn, tp: 6, 1\n",
      "GB f1 score: 0.200\n",
      "GB cohens kappa score: 0.188\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 285, 0\n",
      "KNN fn, tp: 7, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "====== Step 3/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 3/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1146/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:0.026457513110645887 max:0.20808652046684803\n",
      "-> create 1106 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15364 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 285, 2\n",
      "LR fn, tp: 8, 3\n",
      "LR f1 score: 0.375\n",
      "LR cohens kappa score: 0.360\n",
      "LR average precision score: 0.408\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 285, 2\n",
      "GB fn, tp: 9, 2\n",
      "GB f1 score: 0.267\n",
      "GB cohens kappa score: 0.252\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 286, 1\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: -0.006\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1146/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:0.026457513110645887 max:0.2366431913239846\n",
      "-> create 1106 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14844 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 284, 3\n",
      "LR fn, tp: 11, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.016\n",
      "LR average precision score: 0.382\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 284, 3\n",
      "GB fn, tp: 10, 1\n",
      "GB f1 score: 0.133\n",
      "GB cohens kappa score: 0.116\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 287, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1146/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:0.04000000000000002 max:0.20808652046684803\n",
      "-> create 1106 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14872 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 283, 4\n",
      "LR fn, tp: 10, 1\n",
      "LR f1 score: 0.125\n",
      "LR cohens kappa score: 0.104\n",
      "LR average precision score: 0.247\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 284, 3\n",
      "GB fn, tp: 9, 2\n",
      "GB f1 score: 0.250\n",
      "GB cohens kappa score: 0.232\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 287, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1146/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:0.03872983346207415 max:0.20808652046684803\n",
      "-> create 1106 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14792 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 286, 1\n",
      "LR fn, tp: 8, 3\n",
      "LR f1 score: 0.400\n",
      "LR cohens kappa score: 0.388\n",
      "LR average precision score: 0.502\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 283, 4\n",
      "GB fn, tp: 6, 5\n",
      "GB f1 score: 0.500\n",
      "GB cohens kappa score: 0.483\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 287, 0\n",
      "KNN fn, tp: 10, 1\n",
      "KNN f1 score: 0.167\n",
      "KNN cohens kappa score: 0.162\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1148/44 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 44 points min:0.026457513110645887 max:0.19672315572906002\n",
      "-> create 1104 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14680 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 285, 0\n",
      "LR fn, tp: 5, 2\n",
      "LR f1 score: 0.444\n",
      "LR cohens kappa score: 0.438\n",
      "LR average precision score: 0.444\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 281, 4\n",
      "GB fn, tp: 4, 3\n",
      "GB f1 score: 0.429\n",
      "GB cohens kappa score: 0.415\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 285, 0\n",
      "KNN fn, tp: 5, 2\n",
      "KNN f1 score: 0.444\n",
      "KNN cohens kappa score: 0.438\n",
      "\n",
      "\n",
      "====== Step 4/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 4/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1146/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:0.03872983346207415 max:0.21000000000000002\n",
      "-> create 1106 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15392 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 287, 0\n",
      "LR fn, tp: 8, 3\n",
      "LR f1 score: 0.429\n",
      "LR cohens kappa score: 0.419\n",
      "LR average precision score: 0.471\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 284, 3\n",
      "GB fn, tp: 11, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.016\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 287, 0\n",
      "KNN fn, tp: 10, 1\n",
      "KNN f1 score: 0.167\n",
      "KNN cohens kappa score: 0.162\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1146/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:0.026457513110645887 max:0.21725560982400433\n",
      "-> create 1106 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14668 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 287, 0\n",
      "LR fn, tp: 11, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: 0.000\n",
      "LR average precision score: 0.436\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 286, 1\n",
      "GB fn, tp: 7, 4\n",
      "GB f1 score: 0.500\n",
      "GB cohens kappa score: 0.488\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 286, 1\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: -0.006\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1146/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:0.04000000000000002 max:0.2366431913239847\n",
      "-> create 1106 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14768 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 285, 2\n",
      "LR fn, tp: 10, 1\n",
      "LR f1 score: 0.143\n",
      "LR cohens kappa score: 0.129\n",
      "LR average precision score: 0.244\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 282, 5\n",
      "GB fn, tp: 9, 2\n",
      "GB f1 score: 0.222\n",
      "GB cohens kappa score: 0.199\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 287, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1146/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:0.026457513110645887 max:0.21118712081942884\n",
      "-> create 1106 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14840 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 283, 4\n",
      "LR fn, tp: 8, 3\n",
      "LR f1 score: 0.333\n",
      "LR cohens kappa score: 0.314\n",
      "LR average precision score: 0.306\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 281, 6\n",
      "GB fn, tp: 10, 1\n",
      "GB f1 score: 0.111\n",
      "GB cohens kappa score: 0.085\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 286, 1\n",
      "KNN fn, tp: 10, 1\n",
      "KNN f1 score: 0.154\n",
      "KNN cohens kappa score: 0.144\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1148/44 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 44 points min:0.026457513110645887 max:0.2366431913239846\n",
      "-> create 1104 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15312 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 283, 2\n",
      "LR fn, tp: 4, 3\n",
      "LR f1 score: 0.500\n",
      "LR cohens kappa score: 0.490\n",
      "LR average precision score: 0.586\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 283, 2\n",
      "GB fn, tp: 5, 2\n",
      "GB f1 score: 0.364\n",
      "GB cohens kappa score: 0.352\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 285, 0\n",
      "KNN fn, tp: 5, 2\n",
      "KNN f1 score: 0.444\n",
      "KNN cohens kappa score: 0.438\n",
      "\n",
      "\n",
      "====== Step 5/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 5/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1146/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:0.03872983346207415 max:0.21118712081942884\n",
      "-> create 1106 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14748 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 286, 1\n",
      "LR fn, tp: 10, 1\n",
      "LR f1 score: 0.154\n",
      "LR cohens kappa score: 0.144\n",
      "LR average precision score: 0.270\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 285, 2\n",
      "GB fn, tp: 11, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.011\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 287, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1146/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:0.026457513110645887 max:0.22561028345356957\n",
      "-> create 1106 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15448 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 285, 2\n",
      "LR fn, tp: 8, 3\n",
      "LR f1 score: 0.375\n",
      "LR cohens kappa score: 0.360\n",
      "LR average precision score: 0.544\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 285, 2\n",
      "GB fn, tp: 9, 2\n",
      "GB f1 score: 0.267\n",
      "GB cohens kappa score: 0.252\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 287, 0\n",
      "KNN fn, tp: 9, 2\n",
      "KNN f1 score: 0.308\n",
      "KNN cohens kappa score: 0.300\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1146/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:0.026457513110645887 max:0.23043437243605827\n",
      "-> create 1106 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15476 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 287, 0\n",
      "LR fn, tp: 10, 1\n",
      "LR f1 score: 0.167\n",
      "LR cohens kappa score: 0.162\n",
      "LR average precision score: 0.548\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 286, 1\n",
      "GB fn, tp: 8, 3\n",
      "GB f1 score: 0.400\n",
      "GB cohens kappa score: 0.388\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 287, 0\n",
      "KNN fn, tp: 10, 1\n",
      "KNN f1 score: 0.167\n",
      "KNN cohens kappa score: 0.162\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1146/40 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 40 points min:0.026457513110645887 max:0.25000000000000006\n",
      "-> create 1106 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14824 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 284, 3\n",
      "LR fn, tp: 7, 4\n",
      "LR f1 score: 0.444\n",
      "LR cohens kappa score: 0.428\n",
      "LR average precision score: 0.503\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 281, 6\n",
      "GB fn, tp: 9, 2\n",
      "GB f1 score: 0.211\n",
      "GB cohens kappa score: 0.185\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 287, 0\n",
      "KNN fn, tp: 11, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1148/44 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 44 points min:0.026457513110645887 max:0.20049937655763428\n",
      "-> create 1104 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14656 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 283, 2\n",
      "LR fn, tp: 6, 1\n",
      "LR f1 score: 0.200\n",
      "LR cohens kappa score: 0.188\n",
      "LR average precision score: 0.180\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 283, 2\n",
      "GB fn, tp: 5, 2\n",
      "GB f1 score: 0.364\n",
      "GB cohens kappa score: 0.352\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 285, 0\n",
      "KNN fn, tp: 7, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: 0.000\n",
      "\n",
      "### Exercise is done.\n",
      "\n",
      "-----[ LR ]-----\n",
      "maximum:\n",
      "LR tn, fp: 287, 4\n",
      "LR fn, tp: 11, 6\n",
      "LR f1 score: 0.600\n",
      "LR cohens kappa score: 0.586\n",
      "LR average precision score: 0.656\n",
      "\n",
      "\n",
      "average:\n",
      "LR tn, fp: 284.88, 1.72\n",
      "LR fn, tp: 8.16, 2.04\n",
      "LR f1 score: 0.279\n",
      "LR cohens kappa score: 0.267\n",
      "LR average precision score: 0.412\n",
      "\n",
      "\n",
      "minimum:\n",
      "LR tn, fp: 283, 0\n",
      "LR fn, tp: 4, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: -0.016\n",
      "LR average precision score: 0.180\n",
      "\n",
      "\n",
      "-----[ GB ]-----\n",
      "maximum:\n",
      "GB tn, fp: 286, 6\n",
      "GB fn, tp: 11, 5\n",
      "GB f1 score: 0.545\n",
      "GB cohens kappa score: 0.537\n",
      "\n",
      "\n",
      "average:\n",
      "GB tn, fp: 283.64, 2.96\n",
      "GB fn, tp: 8.04, 2.16\n",
      "GB f1 score: 0.281\n",
      "GB cohens kappa score: 0.265\n",
      "\n",
      "\n",
      "minimum:\n",
      "GB tn, fp: 281, 1\n",
      "GB fn, tp: 4, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.016\n",
      "\n",
      "\n",
      "-----[ KNN ]-----\n",
      "maximum:\n",
      "KNN tn, fp: 287, 2\n",
      "KNN fn, tp: 11, 2\n",
      "KNN f1 score: 0.444\n",
      "KNN cohens kappa score: 0.438\n",
      "\n",
      "\n",
      "average:\n",
      "KNN tn, fp: 286.24, 0.36\n",
      "KNN fn, tp: 9.68, 0.52\n",
      "KNN f1 score: 0.092\n",
      "KNN cohens kappa score: 0.088\n",
      "\n",
      "\n",
      "minimum:\n",
      "KNN tn, fp: 284, 0\n",
      "KNN fn, tp: 5, 0\n",
      "KNN f1 score: 0.000\n",
      "KNN cohens kappa score: -0.011\n",
      "\n"
     ]
    }
   ],
   "source": [
    "runExerciseForSpheredNoise(\"folding_yeast4\", resultList)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "painful-liechtenstein",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "///////////////////////////////////////////\n",
      "// Running SpheredNoise on folding_yeast5\n",
      "///////////////////////////////////////////\n",
      "\n",
      "-> Shuffling data\n",
      "### Start exercise for synthetic point generator\n",
      "\n",
      "====== Step 1/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 1/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/35 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 35 points min:0.042426406871192875 max:0.4011234224026316\n",
      "-> create 1117 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 10940 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 288, 0\n",
      "LR fn, tp: 5, 4\n",
      "LR f1 score: 0.615\n",
      "LR cohens kappa score: 0.608\n",
      "LR average precision score: 0.888\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 287, 1\n",
      "GB fn, tp: 6, 3\n",
      "GB f1 score: 0.462\n",
      "GB cohens kappa score: 0.451\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 288, 0\n",
      "KNN fn, tp: 4, 5\n",
      "KNN f1 score: 0.714\n",
      "KNN cohens kappa score: 0.708\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/35 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 35 points min:0.06164414002968982 max:0.2973213749463702\n",
      "-> create 1117 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15288 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 282, 6\n",
      "LR fn, tp: 4, 5\n",
      "LR f1 score: 0.500\n",
      "LR cohens kappa score: 0.483\n",
      "LR average precision score: 0.723\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 284, 4\n",
      "GB fn, tp: 0, 9\n",
      "GB f1 score: 0.818\n",
      "GB cohens kappa score: 0.811\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 286, 2\n",
      "KNN fn, tp: 3, 6\n",
      "KNN f1 score: 0.706\n",
      "KNN cohens kappa score: 0.697\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/35 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 35 points min:0.045825756949558344 max:0.4011234224026316\n",
      "-> create 1117 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15320 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 284, 4\n",
      "LR fn, tp: 5, 4\n",
      "LR f1 score: 0.471\n",
      "LR cohens kappa score: 0.455\n",
      "LR average precision score: 0.627\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 286, 2\n",
      "GB fn, tp: 3, 6\n",
      "GB f1 score: 0.706\n",
      "GB cohens kappa score: 0.697\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 284, 4\n",
      "KNN fn, tp: 3, 6\n",
      "KNN f1 score: 0.632\n",
      "KNN cohens kappa score: 0.619\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/35 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 35 points min:0.042426406871192875 max:0.4277849927241488\n",
      "-> create 1117 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14676 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 288, 0\n",
      "LR fn, tp: 6, 3\n",
      "LR f1 score: 0.500\n",
      "LR cohens kappa score: 0.492\n",
      "LR average precision score: 0.698\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 288, 0\n",
      "GB fn, tp: 4, 5\n",
      "GB f1 score: 0.714\n",
      "GB cohens kappa score: 0.708\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 288, 0\n",
      "KNN fn, tp: 8, 1\n",
      "KNN f1 score: 0.200\n",
      "KNN cohens kappa score: 0.195\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/36 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 36 points min:0.042426406871192875 max:0.4011234224026316\n",
      "-> create 1116 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14508 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 282, 6\n",
      "LR fn, tp: 2, 6\n",
      "LR f1 score: 0.600\n",
      "LR cohens kappa score: 0.587\n",
      "LR average precision score: 0.680\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 286, 2\n",
      "GB fn, tp: 2, 6\n",
      "GB f1 score: 0.750\n",
      "GB cohens kappa score: 0.743\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 286, 2\n",
      "KNN fn, tp: 3, 5\n",
      "KNN f1 score: 0.667\n",
      "KNN cohens kappa score: 0.658\n",
      "\n",
      "\n",
      "====== Step 2/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 2/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/35 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 35 points min:0.042426406871192875 max:0.4277849927241488\n",
      "-> create 1117 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14580 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 285, 3\n",
      "LR fn, tp: 2, 7\n",
      "LR f1 score: 0.737\n",
      "LR cohens kappa score: 0.728\n",
      "LR average precision score: 0.707\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 287, 1\n",
      "GB fn, tp: 2, 7\n",
      "GB f1 score: 0.824\n",
      "GB cohens kappa score: 0.818\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 287, 1\n",
      "KNN fn, tp: 3, 6\n",
      "KNN f1 score: 0.750\n",
      "KNN cohens kappa score: 0.743\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/35 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 35 points min:0.042426406871192875 max:0.2973213749463702\n",
      "-> create 1117 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14456 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 281, 7\n",
      "LR fn, tp: 7, 2\n",
      "LR f1 score: 0.222\n",
      "LR cohens kappa score: 0.198\n",
      "LR average precision score: 0.426\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 284, 4\n",
      "GB fn, tp: 6, 3\n",
      "GB f1 score: 0.375\n",
      "GB cohens kappa score: 0.358\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 284, 4\n",
      "KNN fn, tp: 7, 2\n",
      "KNN f1 score: 0.267\n",
      "KNN cohens kappa score: 0.248\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/35 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 35 points min:0.04795831523312724 max:0.4011234224026316\n",
      "-> create 1117 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15328 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 286, 2\n",
      "LR fn, tp: 6, 3\n",
      "LR f1 score: 0.429\n",
      "LR cohens kappa score: 0.416\n",
      "LR average precision score: 0.762\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 287, 1\n",
      "GB fn, tp: 1, 8\n",
      "GB f1 score: 0.889\n",
      "GB cohens kappa score: 0.885\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 287, 1\n",
      "KNN fn, tp: 4, 5\n",
      "KNN f1 score: 0.667\n",
      "KNN cohens kappa score: 0.658\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/35 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 35 points min:0.042426406871192875 max:0.4011234224026316\n",
      "-> create 1117 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14628 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 285, 3\n",
      "LR fn, tp: 2, 7\n",
      "LR f1 score: 0.737\n",
      "LR cohens kappa score: 0.728\n",
      "LR average precision score: 0.900\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 287, 1\n",
      "GB fn, tp: 2, 7\n",
      "GB f1 score: 0.824\n",
      "GB cohens kappa score: 0.818\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 286, 2\n",
      "KNN fn, tp: 3, 6\n",
      "KNN f1 score: 0.706\n",
      "KNN cohens kappa score: 0.697\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/36 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 36 points min:0.045825756949558344 max:0.4011234224026316\n",
      "-> create 1116 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14564 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 286, 2\n",
      "LR fn, tp: 4, 4\n",
      "LR f1 score: 0.571\n",
      "LR cohens kappa score: 0.561\n",
      "LR average precision score: 0.640\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 286, 2\n",
      "GB fn, tp: 7, 1\n",
      "GB f1 score: 0.182\n",
      "GB cohens kappa score: 0.170\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 288, 0\n",
      "KNN fn, tp: 5, 3\n",
      "KNN f1 score: 0.545\n",
      "KNN cohens kappa score: 0.539\n",
      "\n",
      "\n",
      "====== Step 3/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 3/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/35 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 35 points min:0.042426406871192875 max:0.4011234224026316\n",
      "-> create 1117 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15548 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 285, 3\n",
      "LR fn, tp: 4, 5\n",
      "LR f1 score: 0.588\n",
      "LR cohens kappa score: 0.576\n",
      "LR average precision score: 0.677\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 286, 2\n",
      "GB fn, tp: 3, 6\n",
      "GB f1 score: 0.706\n",
      "GB cohens kappa score: 0.697\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 287, 1\n",
      "KNN fn, tp: 5, 4\n",
      "KNN f1 score: 0.571\n",
      "KNN cohens kappa score: 0.562\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/35 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 35 points min:0.042426406871192875 max:0.4277849927241488\n",
      "-> create 1117 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14384 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 283, 5\n",
      "LR fn, tp: 3, 6\n",
      "LR f1 score: 0.600\n",
      "LR cohens kappa score: 0.586\n",
      "LR average precision score: 0.650\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 286, 2\n",
      "GB fn, tp: 3, 6\n",
      "GB f1 score: 0.706\n",
      "GB cohens kappa score: 0.697\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 286, 2\n",
      "KNN fn, tp: 6, 3\n",
      "KNN f1 score: 0.429\n",
      "KNN cohens kappa score: 0.416\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/35 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 35 points min:0.042426406871192875 max:0.4011234224026316\n",
      "-> create 1117 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14464 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 285, 3\n",
      "LR fn, tp: 4, 5\n",
      "LR f1 score: 0.588\n",
      "LR cohens kappa score: 0.576\n",
      "LR average precision score: 0.771\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 288, 0\n",
      "GB fn, tp: 5, 4\n",
      "GB f1 score: 0.615\n",
      "GB cohens kappa score: 0.608\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 288, 0\n",
      "KNN fn, tp: 7, 2\n",
      "KNN f1 score: 0.364\n",
      "KNN cohens kappa score: 0.357\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/35 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 35 points min:0.045825756949558344 max:0.4011234224026316\n",
      "-> create 1117 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14756 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 286, 2\n",
      "LR fn, tp: 6, 3\n",
      "LR f1 score: 0.429\n",
      "LR cohens kappa score: 0.416\n",
      "LR average precision score: 0.738\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 288, 0\n",
      "GB fn, tp: 5, 4\n",
      "GB f1 score: 0.615\n",
      "GB cohens kappa score: 0.608\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 288, 0\n",
      "KNN fn, tp: 4, 5\n",
      "KNN f1 score: 0.714\n",
      "KNN cohens kappa score: 0.708\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/36 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 36 points min:0.04795831523312724 max:0.2973213749463702\n",
      "-> create 1116 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15160 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 283, 5\n",
      "LR fn, tp: 5, 3\n",
      "LR f1 score: 0.375\n",
      "LR cohens kappa score: 0.358\n",
      "LR average precision score: 0.483\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 284, 4\n",
      "GB fn, tp: 1, 7\n",
      "GB f1 score: 0.737\n",
      "GB cohens kappa score: 0.728\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 285, 3\n",
      "KNN fn, tp: 3, 5\n",
      "KNN f1 score: 0.625\n",
      "KNN cohens kappa score: 0.615\n",
      "\n",
      "\n",
      "====== Step 4/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 4/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/35 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 35 points min:0.045825756949558344 max:0.2973213749463702\n",
      "-> create 1117 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 10840 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 284, 4\n",
      "LR fn, tp: 3, 6\n",
      "LR f1 score: 0.632\n",
      "LR cohens kappa score: 0.619\n",
      "LR average precision score: 0.738\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 286, 2\n",
      "GB fn, tp: 3, 6\n",
      "GB f1 score: 0.706\n",
      "GB cohens kappa score: 0.697\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 285, 3\n",
      "KNN fn, tp: 5, 4\n",
      "KNN f1 score: 0.500\n",
      "KNN cohens kappa score: 0.486\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/35 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 35 points min:0.042426406871192875 max:0.4011234224026316\n",
      "-> create 1117 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14552 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 284, 4\n",
      "LR fn, tp: 5, 4\n",
      "LR f1 score: 0.471\n",
      "LR cohens kappa score: 0.455\n",
      "LR average precision score: 0.615\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 287, 1\n",
      "GB fn, tp: 2, 7\n",
      "GB f1 score: 0.824\n",
      "GB cohens kappa score: 0.818\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 286, 2\n",
      "KNN fn, tp: 6, 3\n",
      "KNN f1 score: 0.429\n",
      "KNN cohens kappa score: 0.416\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/35 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 35 points min:0.045825756949558344 max:0.4011234224026316\n",
      "-> create 1117 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14672 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 282, 6\n",
      "LR fn, tp: 4, 5\n",
      "LR f1 score: 0.500\n",
      "LR cohens kappa score: 0.483\n",
      "LR average precision score: 0.703\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 282, 6\n",
      "GB fn, tp: 4, 5\n",
      "GB f1 score: 0.500\n",
      "GB cohens kappa score: 0.483\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 283, 5\n",
      "KNN fn, tp: 3, 6\n",
      "KNN f1 score: 0.600\n",
      "KNN cohens kappa score: 0.586\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/35 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 35 points min:0.042426406871192875 max:0.4277849927241488\n",
      "-> create 1117 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14468 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 286, 2\n",
      "LR fn, tp: 6, 3\n",
      "LR f1 score: 0.429\n",
      "LR cohens kappa score: 0.416\n",
      "LR average precision score: 0.692\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 288, 0\n",
      "GB fn, tp: 4, 5\n",
      "GB f1 score: 0.714\n",
      "GB cohens kappa score: 0.708\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 288, 0\n",
      "KNN fn, tp: 6, 3\n",
      "KNN f1 score: 0.500\n",
      "KNN cohens kappa score: 0.492\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/36 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 36 points min:0.042426406871192875 max:0.4011234224026316\n",
      "-> create 1116 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14796 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 286, 2\n",
      "LR fn, tp: 4, 4\n",
      "LR f1 score: 0.571\n",
      "LR cohens kappa score: 0.561\n",
      "LR average precision score: 0.756\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 287, 1\n",
      "GB fn, tp: 2, 6\n",
      "GB f1 score: 0.800\n",
      "GB cohens kappa score: 0.795\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 288, 0\n",
      "KNN fn, tp: 4, 4\n",
      "KNN f1 score: 0.667\n",
      "KNN cohens kappa score: 0.661\n",
      "\n",
      "\n",
      "====== Step 5/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 5/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/35 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 35 points min:0.042426406871192875 max:0.4011234224026316\n",
      "-> create 1117 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14624 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 283, 5\n",
      "LR fn, tp: 2, 7\n",
      "LR f1 score: 0.667\n",
      "LR cohens kappa score: 0.655\n",
      "LR average precision score: 0.724\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 286, 2\n",
      "GB fn, tp: 1, 8\n",
      "GB f1 score: 0.842\n",
      "GB cohens kappa score: 0.837\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 288, 0\n",
      "KNN fn, tp: 2, 7\n",
      "KNN f1 score: 0.875\n",
      "KNN cohens kappa score: 0.872\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/35 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 35 points min:0.042426406871192875 max:0.4011234224026316\n",
      "-> create 1117 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14524 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 288, 0\n",
      "LR fn, tp: 6, 3\n",
      "LR f1 score: 0.500\n",
      "LR cohens kappa score: 0.492\n",
      "LR average precision score: 0.769\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 288, 0\n",
      "GB fn, tp: 3, 6\n",
      "GB f1 score: 0.800\n",
      "GB cohens kappa score: 0.795\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 288, 0\n",
      "KNN fn, tp: 5, 4\n",
      "KNN f1 score: 0.615\n",
      "KNN cohens kappa score: 0.608\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/35 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 35 points min:0.042426406871192875 max:0.4011234224026316\n",
      "-> create 1117 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15372 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 284, 4\n",
      "LR fn, tp: 2, 7\n",
      "LR f1 score: 0.700\n",
      "LR cohens kappa score: 0.690\n",
      "LR average precision score: 0.787\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 288, 0\n",
      "GB fn, tp: 2, 7\n",
      "GB f1 score: 0.875\n",
      "GB cohens kappa score: 0.872\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 286, 2\n",
      "KNN fn, tp: 5, 4\n",
      "KNN f1 score: 0.533\n",
      "KNN cohens kappa score: 0.522\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/35 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 35 points min:0.04795831523312724 max:0.4011234224026316\n",
      "-> create 1117 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14160 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 286, 2\n",
      "LR fn, tp: 6, 3\n",
      "LR f1 score: 0.429\n",
      "LR cohens kappa score: 0.416\n",
      "LR average precision score: 0.649\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 287, 1\n",
      "GB fn, tp: 3, 6\n",
      "GB f1 score: 0.750\n",
      "GB cohens kappa score: 0.743\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 287, 1\n",
      "KNN fn, tp: 6, 3\n",
      "KNN f1 score: 0.462\n",
      "KNN cohens kappa score: 0.451\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1152/36 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 36 points min:0.045825756949558344 max:0.2973213749463702\n",
      "-> create 1116 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14708 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 284, 4\n",
      "LR fn, tp: 5, 3\n",
      "LR f1 score: 0.400\n",
      "LR cohens kappa score: 0.384\n",
      "LR average precision score: 0.511\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 283, 5\n",
      "GB fn, tp: 3, 5\n",
      "GB f1 score: 0.556\n",
      "GB cohens kappa score: 0.542\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 286, 2\n",
      "KNN fn, tp: 4, 4\n",
      "KNN f1 score: 0.571\n",
      "KNN cohens kappa score: 0.561\n",
      "\n",
      "### Exercise is done.\n",
      "\n",
      "-----[ LR ]-----\n",
      "maximum:\n",
      "LR tn, fp: 288, 7\n",
      "LR fn, tp: 7, 7\n",
      "LR f1 score: 0.737\n",
      "LR cohens kappa score: 0.728\n",
      "LR average precision score: 0.900\n",
      "\n",
      "\n",
      "average:\n",
      "LR tn, fp: 284.64, 3.36\n",
      "LR fn, tp: 4.32, 4.48\n",
      "LR f1 score: 0.530\n",
      "LR cohens kappa score: 0.518\n",
      "LR average precision score: 0.693\n",
      "\n",
      "\n",
      "minimum:\n",
      "LR tn, fp: 281, 0\n",
      "LR fn, tp: 2, 2\n",
      "LR f1 score: 0.222\n",
      "LR cohens kappa score: 0.198\n",
      "LR average precision score: 0.426\n",
      "\n",
      "\n",
      "-----[ GB ]-----\n",
      "maximum:\n",
      "GB tn, fp: 288, 6\n",
      "GB fn, tp: 7, 9\n",
      "GB f1 score: 0.889\n",
      "GB cohens kappa score: 0.885\n",
      "\n",
      "\n",
      "average:\n",
      "GB tn, fp: 286.24, 1.76\n",
      "GB fn, tp: 3.08, 5.72\n",
      "GB f1 score: 0.692\n",
      "GB cohens kappa score: 0.684\n",
      "\n",
      "\n",
      "minimum:\n",
      "GB tn, fp: 282, 0\n",
      "GB fn, tp: 0, 1\n",
      "GB f1 score: 0.182\n",
      "GB cohens kappa score: 0.170\n",
      "\n",
      "\n",
      "-----[ KNN ]-----\n",
      "maximum:\n",
      "KNN tn, fp: 288, 5\n",
      "KNN fn, tp: 8, 7\n",
      "KNN f1 score: 0.875\n",
      "KNN cohens kappa score: 0.872\n",
      "\n",
      "\n",
      "average:\n",
      "KNN tn, fp: 286.52, 1.48\n",
      "KNN fn, tp: 4.56, 4.24\n",
      "KNN f1 score: 0.572\n",
      "KNN cohens kappa score: 0.563\n",
      "\n",
      "\n",
      "minimum:\n",
      "KNN tn, fp: 283, 0\n",
      "KNN fn, tp: 2, 1\n",
      "KNN f1 score: 0.200\n",
      "KNN cohens kappa score: 0.195\n",
      "\n"
     ]
    }
   ],
   "source": [
    "runExerciseForSpheredNoise(\"folding_yeast5\", resultList)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "dutch-chocolate",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "///////////////////////////////////////////\n",
      "// Running SpheredNoise on folding_yeast6\n",
      "///////////////////////////////////////////\n",
      "\n",
      "-> Shuffling data\n",
      "### Start exercise for synthetic point generator\n",
      "\n",
      "====== Step 1/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 1/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1159/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.04795831523312718 max:0.19924858845171275\n",
      "-> create 1131 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15140 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 289, 1\n",
      "LR fn, tp: 4, 3\n",
      "LR f1 score: 0.545\n",
      "LR cohens kappa score: 0.538\n",
      "LR average precision score: 0.635\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 287, 3\n",
      "GB fn, tp: 4, 3\n",
      "GB f1 score: 0.462\n",
      "GB cohens kappa score: 0.450\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 289, 1\n",
      "KNN fn, tp: 5, 2\n",
      "KNN f1 score: 0.400\n",
      "KNN cohens kappa score: 0.391\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1159/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.03464101615137758 max:0.22248595461286985\n",
      "-> create 1131 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15024 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 285, 5\n",
      "LR fn, tp: 5, 2\n",
      "LR f1 score: 0.286\n",
      "LR cohens kappa score: 0.268\n",
      "LR average precision score: 0.431\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 287, 3\n",
      "GB fn, tp: 5, 2\n",
      "GB f1 score: 0.333\n",
      "GB cohens kappa score: 0.320\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 287, 3\n",
      "KNN fn, tp: 4, 3\n",
      "KNN f1 score: 0.462\n",
      "KNN cohens kappa score: 0.450\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1159/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.042426406871192875 max:0.19924858845171275\n",
      "-> create 1131 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14576 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 289, 1\n",
      "LR fn, tp: 6, 1\n",
      "LR f1 score: 0.222\n",
      "LR cohens kappa score: 0.214\n",
      "LR average precision score: 0.455\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 290, 0\n",
      "GB fn, tp: 5, 2\n",
      "GB f1 score: 0.444\n",
      "GB cohens kappa score: 0.439\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 288, 2\n",
      "KNN fn, tp: 6, 1\n",
      "KNN f1 score: 0.200\n",
      "KNN cohens kappa score: 0.189\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1159/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.03464101615137758 max:0.19924858845171275\n",
      "-> create 1131 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14524 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 289, 1\n",
      "LR fn, tp: 5, 2\n",
      "LR f1 score: 0.400\n",
      "LR cohens kappa score: 0.391\n",
      "LR average precision score: 0.618\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 287, 3\n",
      "GB fn, tp: 4, 3\n",
      "GB f1 score: 0.462\n",
      "GB cohens kappa score: 0.450\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 290, 0\n",
      "KNN fn, tp: 5, 2\n",
      "KNN f1 score: 0.444\n",
      "KNN cohens kappa score: 0.439\n",
      "\n",
      "\n",
      "------ Step 1/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1160/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.03464101615137758 max:0.19924858845171275\n",
      "-> create 1132 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14664 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 287, 2\n",
      "LR fn, tp: 3, 4\n",
      "LR f1 score: 0.615\n",
      "LR cohens kappa score: 0.607\n",
      "LR average precision score: 0.662\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 288, 1\n",
      "GB fn, tp: 3, 4\n",
      "GB f1 score: 0.667\n",
      "GB cohens kappa score: 0.660\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 289, 0\n",
      "KNN fn, tp: 1, 6\n",
      "KNN f1 score: 0.923\n",
      "KNN cohens kappa score: 0.921\n",
      "\n",
      "\n",
      "====== Step 2/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 2/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1159/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.045825756949558344 max:0.15874507866387544\n",
      "-> create 1131 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14716 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 289, 1\n",
      "LR fn, tp: 3, 4\n",
      "LR f1 score: 0.667\n",
      "LR cohens kappa score: 0.660\n",
      "LR average precision score: 0.677\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 288, 2\n",
      "GB fn, tp: 4, 3\n",
      "GB f1 score: 0.500\n",
      "GB cohens kappa score: 0.490\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 288, 2\n",
      "KNN fn, tp: 4, 3\n",
      "KNN f1 score: 0.500\n",
      "KNN cohens kappa score: 0.490\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1159/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.03464101615137758 max:0.19924858845171275\n",
      "-> create 1131 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14712 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 286, 4\n",
      "LR fn, tp: 5, 2\n",
      "LR f1 score: 0.308\n",
      "LR cohens kappa score: 0.292\n",
      "LR average precision score: 0.403\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 287, 3\n",
      "GB fn, tp: 5, 2\n",
      "GB f1 score: 0.333\n",
      "GB cohens kappa score: 0.320\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 290, 0\n",
      "KNN fn, tp: 5, 2\n",
      "KNN f1 score: 0.444\n",
      "KNN cohens kappa score: 0.439\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1159/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.03464101615137758 max:0.19924858845171275\n",
      "-> create 1131 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14248 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 289, 1\n",
      "LR fn, tp: 5, 2\n",
      "LR f1 score: 0.400\n",
      "LR cohens kappa score: 0.391\n",
      "LR average precision score: 0.511\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 288, 2\n",
      "GB fn, tp: 6, 1\n",
      "GB f1 score: 0.200\n",
      "GB cohens kappa score: 0.189\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 290, 0\n",
      "KNN fn, tp: 4, 3\n",
      "KNN f1 score: 0.600\n",
      "KNN cohens kappa score: 0.594\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1159/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.03464101615137758 max:0.2054263858417414\n",
      "-> create 1131 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15292 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 288, 2\n",
      "LR fn, tp: 4, 3\n",
      "LR f1 score: 0.500\n",
      "LR cohens kappa score: 0.490\n",
      "LR average precision score: 0.560\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 286, 4\n",
      "GB fn, tp: 5, 2\n",
      "GB f1 score: 0.308\n",
      "GB cohens kappa score: 0.292\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 287, 3\n",
      "KNN fn, tp: 5, 2\n",
      "KNN f1 score: 0.333\n",
      "KNN cohens kappa score: 0.320\n",
      "\n",
      "\n",
      "------ Step 2/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1160/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.03464101615137758 max:0.19924858845171275\n",
      "-> create 1132 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14396 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 288, 1\n",
      "LR fn, tp: 5, 2\n",
      "LR f1 score: 0.400\n",
      "LR cohens kappa score: 0.391\n",
      "LR average precision score: 0.507\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 289, 0\n",
      "GB fn, tp: 6, 1\n",
      "GB f1 score: 0.250\n",
      "GB cohens kappa score: 0.246\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 289, 0\n",
      "KNN fn, tp: 4, 3\n",
      "KNN f1 score: 0.600\n",
      "KNN cohens kappa score: 0.594\n",
      "\n",
      "\n",
      "====== Step 3/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 3/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1159/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.042426406871192875 max:0.19924858845171275\n",
      "-> create 1131 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15072 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 289, 1\n",
      "LR fn, tp: 4, 3\n",
      "LR f1 score: 0.545\n",
      "LR cohens kappa score: 0.538\n",
      "LR average precision score: 0.646\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 288, 2\n",
      "GB fn, tp: 5, 2\n",
      "GB f1 score: 0.364\n",
      "GB cohens kappa score: 0.353\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 289, 1\n",
      "KNN fn, tp: 3, 4\n",
      "KNN f1 score: 0.667\n",
      "KNN cohens kappa score: 0.660\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1159/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.03464101615137758 max:0.15132745950421558\n",
      "-> create 1131 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14640 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 290, 0\n",
      "LR fn, tp: 3, 4\n",
      "LR f1 score: 0.727\n",
      "LR cohens kappa score: 0.723\n",
      "LR average precision score: 0.791\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 289, 1\n",
      "GB fn, tp: 4, 3\n",
      "GB f1 score: 0.545\n",
      "GB cohens kappa score: 0.538\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 290, 0\n",
      "KNN fn, tp: 4, 3\n",
      "KNN f1 score: 0.600\n",
      "KNN cohens kappa score: 0.594\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1159/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.03464101615137758 max:0.22248595461286985\n",
      "-> create 1131 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14252 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 288, 2\n",
      "LR fn, tp: 5, 2\n",
      "LR f1 score: 0.364\n",
      "LR cohens kappa score: 0.353\n",
      "LR average precision score: 0.451\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 289, 1\n",
      "GB fn, tp: 6, 1\n",
      "GB f1 score: 0.222\n",
      "GB cohens kappa score: 0.214\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 290, 0\n",
      "KNN fn, tp: 4, 3\n",
      "KNN f1 score: 0.600\n",
      "KNN cohens kappa score: 0.594\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1159/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.045825756949558344 max:0.19924858845171275\n",
      "-> create 1131 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14560 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 285, 5\n",
      "LR fn, tp: 3, 4\n",
      "LR f1 score: 0.500\n",
      "LR cohens kappa score: 0.486\n",
      "LR average precision score: 0.453\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 285, 5\n",
      "GB fn, tp: 5, 2\n",
      "GB f1 score: 0.286\n",
      "GB cohens kappa score: 0.268\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 285, 5\n",
      "KNN fn, tp: 3, 4\n",
      "KNN f1 score: 0.500\n",
      "KNN cohens kappa score: 0.486\n",
      "\n",
      "\n",
      "------ Step 3/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1160/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.03464101615137758 max:0.19924858845171275\n",
      "-> create 1132 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15508 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 289, 0\n",
      "LR fn, tp: 7, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: 0.000\n",
      "LR average precision score: 0.358\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 288, 1\n",
      "GB fn, tp: 7, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.006\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 288, 1\n",
      "KNN fn, tp: 6, 1\n",
      "KNN f1 score: 0.222\n",
      "KNN cohens kappa score: 0.214\n",
      "\n",
      "\n",
      "====== Step 4/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 4/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1159/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.03464101615137758 max:0.19924858845171275\n",
      "-> create 1131 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14548 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 290, 0\n",
      "LR fn, tp: 5, 2\n",
      "LR f1 score: 0.444\n",
      "LR cohens kappa score: 0.439\n",
      "LR average precision score: 0.767\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 289, 1\n",
      "GB fn, tp: 4, 3\n",
      "GB f1 score: 0.545\n",
      "GB cohens kappa score: 0.538\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 288, 2\n",
      "KNN fn, tp: 4, 3\n",
      "KNN f1 score: 0.500\n",
      "KNN cohens kappa score: 0.490\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1159/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.03464101615137758 max:0.2054263858417414\n",
      "-> create 1131 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14636 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 286, 4\n",
      "LR fn, tp: 6, 1\n",
      "LR f1 score: 0.167\n",
      "LR cohens kappa score: 0.150\n",
      "LR average precision score: 0.263\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 286, 4\n",
      "GB fn, tp: 6, 1\n",
      "GB f1 score: 0.167\n",
      "GB cohens kappa score: 0.150\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 286, 4\n",
      "KNN fn, tp: 5, 2\n",
      "KNN f1 score: 0.308\n",
      "KNN cohens kappa score: 0.292\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1159/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.03464101615137758 max:0.19924858845171275\n",
      "-> create 1131 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14476 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 285, 5\n",
      "LR fn, tp: 3, 4\n",
      "LR f1 score: 0.500\n",
      "LR cohens kappa score: 0.486\n",
      "LR average precision score: 0.550\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 286, 4\n",
      "GB fn, tp: 3, 4\n",
      "GB f1 score: 0.533\n",
      "GB cohens kappa score: 0.521\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 289, 1\n",
      "KNN fn, tp: 3, 4\n",
      "KNN f1 score: 0.667\n",
      "KNN cohens kappa score: 0.660\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1159/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.03464101615137758 max:0.19924858845171275\n",
      "-> create 1131 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14428 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 290, 0\n",
      "LR fn, tp: 4, 3\n",
      "LR f1 score: 0.600\n",
      "LR cohens kappa score: 0.594\n",
      "LR average precision score: 0.670\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 289, 1\n",
      "GB fn, tp: 4, 3\n",
      "GB f1 score: 0.545\n",
      "GB cohens kappa score: 0.538\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 290, 0\n",
      "KNN fn, tp: 4, 3\n",
      "KNN f1 score: 0.600\n",
      "KNN cohens kappa score: 0.594\n",
      "\n",
      "\n",
      "------ Step 4/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1160/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.042426406871192875 max:0.1923538406167134\n",
      "-> create 1132 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 10900 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 289, 0\n",
      "LR fn, tp: 5, 2\n",
      "LR f1 score: 0.444\n",
      "LR cohens kappa score: 0.439\n",
      "LR average precision score: 0.587\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 288, 1\n",
      "GB fn, tp: 4, 3\n",
      "GB f1 score: 0.545\n",
      "GB cohens kappa score: 0.537\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 289, 0\n",
      "KNN fn, tp: 5, 2\n",
      "KNN f1 score: 0.444\n",
      "KNN cohens kappa score: 0.439\n",
      "\n",
      "\n",
      "====== Step 5/5 =======\n",
      "-> Shuffling data\n",
      "-> Spliting data to slices\n",
      "\n",
      "------ Step 5/5: Slice 1/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1159/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.03464101615137758 max:0.19924858845171275\n",
      "-> create 1131 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15192 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 288, 2\n",
      "LR fn, tp: 3, 4\n",
      "LR f1 score: 0.615\n",
      "LR cohens kappa score: 0.607\n",
      "LR average precision score: 0.501\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 284, 6\n",
      "GB fn, tp: 4, 3\n",
      "GB f1 score: 0.375\n",
      "GB cohens kappa score: 0.358\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 287, 3\n",
      "KNN fn, tp: 3, 4\n",
      "KNN f1 score: 0.571\n",
      "KNN cohens kappa score: 0.561\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 2/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1159/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.03464101615137758 max:0.19924858845171275\n",
      "-> create 1131 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14536 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 289, 1\n",
      "LR fn, tp: 6, 1\n",
      "LR f1 score: 0.222\n",
      "LR cohens kappa score: 0.214\n",
      "LR average precision score: 0.236\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 288, 2\n",
      "GB fn, tp: 5, 2\n",
      "GB f1 score: 0.364\n",
      "GB cohens kappa score: 0.353\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 290, 0\n",
      "KNN fn, tp: 6, 1\n",
      "KNN f1 score: 0.250\n",
      "KNN cohens kappa score: 0.246\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 3/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1159/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.042426406871192875 max:0.19924858845171275\n",
      "-> create 1131 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 15120 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 290, 0\n",
      "LR fn, tp: 4, 3\n",
      "LR f1 score: 0.600\n",
      "LR cohens kappa score: 0.594\n",
      "LR average precision score: 0.744\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 289, 1\n",
      "GB fn, tp: 2, 5\n",
      "GB f1 score: 0.769\n",
      "GB cohens kappa score: 0.764\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 288, 2\n",
      "KNN fn, tp: 4, 3\n",
      "KNN f1 score: 0.500\n",
      "KNN cohens kappa score: 0.490\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 4/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1159/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.045825756949558344 max:0.1923538406167134\n",
      "-> create 1131 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14448 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 288, 2\n",
      "LR fn, tp: 5, 2\n",
      "LR f1 score: 0.364\n",
      "LR cohens kappa score: 0.353\n",
      "LR average precision score: 0.536\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 288, 2\n",
      "GB fn, tp: 5, 2\n",
      "GB f1 score: 0.364\n",
      "GB cohens kappa score: 0.353\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 290, 0\n",
      "KNN fn, tp: 5, 2\n",
      "KNN f1 score: 0.444\n",
      "KNN cohens kappa score: 0.439\n",
      "\n",
      "\n",
      "------ Step 5/5: Slice 5/5 -------\n",
      "-> Reset the GAN\n",
      "-> Train generator for synthetic samples\n",
      "Train 1160/28 points\n",
      "-> new disc\n",
      "-> calc distances\n",
      "-> statistics\n",
      "trained 28 points min:0.03464101615137758 max:0.2054263858417414\n",
      "-> create 1132 synthetic samples\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 14680 characters]\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-> test with 'LR'\n",
      "LR tn, fp: 285, 4\n",
      "LR fn, tp: 4, 3\n",
      "LR f1 score: 0.429\n",
      "LR cohens kappa score: 0.415\n",
      "LR average precision score: 0.443\n",
      "\n",
      "-> test with 'GB'\n",
      "GB tn, fp: 287, 2\n",
      "GB fn, tp: 5, 2\n",
      "GB f1 score: 0.364\n",
      "GB cohens kappa score: 0.353\n",
      "\n",
      "-> test with 'KNN'\n",
      "KNN tn, fp: 289, 0\n",
      "KNN fn, tp: 4, 3\n",
      "KNN f1 score: 0.600\n",
      "KNN cohens kappa score: 0.594\n",
      "\n",
      "### Exercise is done.\n",
      "\n",
      "-----[ LR ]-----\n",
      "maximum:\n",
      "LR tn, fp: 290, 5\n",
      "LR fn, tp: 7, 4\n",
      "LR f1 score: 0.727\n",
      "LR cohens kappa score: 0.723\n",
      "LR average precision score: 0.791\n",
      "\n",
      "\n",
      "average:\n",
      "LR tn, fp: 288.0, 1.8\n",
      "LR fn, tp: 4.48, 2.52\n",
      "LR f1 score: 0.435\n",
      "LR cohens kappa score: 0.425\n",
      "LR average precision score: 0.538\n",
      "\n",
      "\n",
      "minimum:\n",
      "LR tn, fp: 285, 0\n",
      "LR fn, tp: 3, 0\n",
      "LR f1 score: 0.000\n",
      "LR cohens kappa score: 0.000\n",
      "LR average precision score: 0.236\n",
      "\n",
      "\n",
      "-----[ GB ]-----\n",
      "maximum:\n",
      "GB tn, fp: 290, 6\n",
      "GB fn, tp: 7, 5\n",
      "GB f1 score: 0.769\n",
      "GB cohens kappa score: 0.764\n",
      "\n",
      "\n",
      "average:\n",
      "GB tn, fp: 287.6, 2.2\n",
      "GB fn, tp: 4.64, 2.36\n",
      "GB f1 score: 0.398\n",
      "GB cohens kappa score: 0.387\n",
      "\n",
      "\n",
      "minimum:\n",
      "GB tn, fp: 284, 0\n",
      "GB fn, tp: 2, 0\n",
      "GB f1 score: 0.000\n",
      "GB cohens kappa score: -0.006\n",
      "\n",
      "\n",
      "-----[ KNN ]-----\n",
      "maximum:\n",
      "KNN tn, fp: 290, 5\n",
      "KNN fn, tp: 6, 6\n",
      "KNN f1 score: 0.923\n",
      "KNN cohens kappa score: 0.921\n",
      "\n",
      "\n",
      "average:\n",
      "KNN tn, fp: 288.6, 1.2\n",
      "KNN fn, tp: 4.24, 2.76\n",
      "KNN f1 score: 0.495\n",
      "KNN cohens kappa score: 0.487\n",
      "\n",
      "\n",
      "minimum:\n",
      "KNN tn, fp: 285, 0\n",
      "KNN fn, tp: 1, 1\n",
      "KNN f1 score: 0.200\n",
      "KNN cohens kappa score: 0.189\n",
      "\n"
     ]
    }
   ],
   "source": [
    "runExerciseForSpheredNoise(\"folding_yeast6\", resultList)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "c5f16a70",
   "metadata": {},
   "outputs": [],
   "source": [
    "knn_dataset = [\"abalone9-18\",\"abalone_17_vs_7_8_9_10\",\"car-vgood\",\"folding_car_good\",\"folding_flare-F\",\"hypothyroid\",\"kddcup-guess_passwd_vs_satan\",\"kr-vs-k-three_vs_eleven\",\"kr-vs-k-zero-one_vs_draw\",\"shuttle-2_vs_5\",\"winequality-red-4\",\"yeast4\",\"yeast5\",\"yeast6\",\"ozone_level\",\"yeast_me2\",\"Average\"]\n",
    "knn_ProWRAS_f1 = [0.384,0.347,0.818,0.641,0.301,0.553,1.0,0.94,0.9,1.0,0.141,0.308,0.714,0.545,0.556,0.339,0.538]\n",
    "knn_ProWRAS_k = [0.35,0.328,0.81,0.622,0.263,0.528,1.0,0.938,0.896,1.0,0.093,0.268,0.704,0.531,0.526,0.305,0.515]\n",
    "knn_SimpleGAN_f1 = [0,0,0.442,0.160,0.008,0.574,0.971,0.944,0.859,0.930,0,0.092,0.580,0.442,0,0.074,0.380]\n",
    "knn_SimpleGAN_k = [0,0,0.432,0.151,0.005,0.559,0.970,0.942,0.855,0.929,0,0.088,0.571,0.432,0,0.070,0.399]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "cb5a2352",
   "metadata": {},
   "outputs": [],
   "source": [
    "lr_dataset = [\"abalone9-18\",\"abalone_17_vs_7_8_9_10\",\"car-vgood\",\"car_good\",\"flare-F\",\"hypothyroid\",\"kddcup-guess_passwd_vs_satan\",\"kr-vs-k-three_vs_eleven\",\"kr-vs-k-zero-one_vs_draw\",\"shuttle-2_vs_5\",\"winequality-red-4\",\"yeast4\",\"yeast5\",\"yeast6\",\"ozone_level\",\"yeast_me2\",\"Average\"]\n",
    "lr_ProWRAS_f1 = [0.488,0.315,0.407,0.103,0.341,0.446,0.99,0.928,0.853,1.0,0.158,0.308,0.591,0.326,0.347,0.295,0.472]\n",
    "lr_ProWRAS_k = [0.446,0.287,0.371,0.033,0.3,0.407,0.99,0.926,0.847,1.0,0.119,0.268,0.574,0.3,0.319,0.254,0.441]\n",
    "lr_SimpleGAN_f1 = [0.539,0.348,0.182,0.005,0.272,0.390,0.978,0.936,0.778,0.979,0.014,0.258,0.505,0.418,0.214,0.243,0.441]\n",
    "lr_SimpleGAN_k = [0.652,0.434,0.269,0.052,0.386,0.393,0.974,0.982,0.884,0.968,0.154,0.408,0.670,0.537,0.238,0.389,0.524]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "b16d45df",
   "metadata": {},
   "outputs": [],
   "source": [
    "gb_dataset = [\"abalone9-18\",\"abalone_17_vs_7_8_9_10\",\"car-vgood\",\"folding_car_good\",\"folding_flare-F\",\"hypothyroid\",\"kddcup-guess_passwd_vs_satan\",\"kr-vs-k-three_vs_eleven\",\"kr-vs-k-zero-one_vs_draw\",\"shuttle-2_vs_5\",\"winequality-red-4\",\"yeast4\",\"yeast5\",\"yeast6\",\"ozone_level\",\"wine_quality\",\"yeast_me2\",\"Average\"]\n",
    "gb_ProWRAS_f1 = [0.385,0.335,0.959,0.863,0.320,0.803,0.998,0.995,0.969,1.0,0.156,0.335,0.735,0.514,0.329,0.290,0.225,0.600]\n",
    "gb_ProWRAS_k = [0.341,0.310,0.957,0.857,0.291,0.794,0.998,0.995,0.967,1.0,0.115,0.303,0.726,0.501,0.303,0.248,0.328,0.589]\n",
    "gb_SimpleGAN_f1 = [0.332,0.226,0.929,0.670,0.183,0.774,0.991,0.996,0.970,0.986,0.068,0.338,0.687,0.442,0.140,0.229,0.332,0.516]\n",
    "gb_SimpleGAN_k = [0.305,0.216,0.926,0.659,0.168,0.764,0.991,0.996,0.969,0.986,0.056,0.322,0.679,0.432,0.130,0.215,0.318,0.507]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "5714b573",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.3497318384516972"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "resultList[\"folding_abalone_17_vs_7_8_9_10\"]['LR'].data[\"f1 score\"]\n",
    "resultList[\"folding_abalone_17_vs_7_8_9_10\"]['LR'].data[\"cohens kappa score\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "f26e532c",
   "metadata": {},
   "outputs": [],
   "source": [
    "def showDiagnose(score, algo, dataset, ProWRAS, SimpleGAN):\n",
    "    def gr(n):\n",
    "        if n in resultList:\n",
    "            return resultList[n][algo].data[score]\n",
    "        else:\n",
    "            return 0.0\n",
    "        \n",
    "    SphereNoise = [gr(\"folding_\" + n) or 0.0 for n in dataset]\n",
    "    SphereNoise[-1] = sum(SphereNoise) / (len(SphereNoise) - 1)\n",
    "    w = 0.2\n",
    "    bar1 = range(len(dataset))\n",
    "    bar2 = [i+w for i in bar1]\n",
    "    bar3 = [i+w for i in bar2]\n",
    "    plt.figure(figsize=(20, 8))\n",
    "    plt.bar(bar1,ProWRAS,w,label = \"ProWRAS\")\n",
    "    plt.bar(bar3,SimpleGAN,w,label = \"SimpleGan\")\n",
    "    plt.bar(bar2,SphereNoise,w,label = \"SphereNoise\")\n",
    "    plt.xlabel(\"Dataset\")\n",
    "    plt.ylabel(score)\n",
    "    plt.xticks(bar1,dataset)\n",
    "    plt.xticks(rotation=\"vertical\")\n",
    "    plt.legend()\n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "552a7b37",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 67440 characters]\n",
      "text/plain": [
       "<Figure size 1440x576 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "[encoded data, 70236 characters]\n",
      "text/plain": [
       "<Figure size 1440x576 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "showDiagnose(\"f1 score\", \"LR\", lr_dataset, lr_ProWRAS_f1, lr_SimpleGAN_f1)\n",
    "showDiagnose(\"cohens kappa score\", \"LR\", lr_dataset, lr_ProWRAS_k, lr_SimpleGAN_k)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "b8ae52b0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 71968 characters]\n",
      "text/plain": [
       "<Figure size 1440x576 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "[encoded data, 74604 characters]\n",
      "text/plain": [
       "<Figure size 1440x576 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "showDiagnose(\"f1 score\", \"GB\", gb_dataset, gb_ProWRAS_f1, gb_SimpleGAN_f1)\n",
    "showDiagnose(\"cohens kappa score\", \"GB\", gb_dataset, gb_ProWRAS_k, gb_SimpleGAN_k)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "6094ade0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 69536 characters]\n",
      "text/plain": [
       "<Figure size 1440x576 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "[encoded data, 72224 characters]\n",
      "text/plain": [
       "<Figure size 1440x576 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "showDiagnose(\"f1 score\", \"KNN\", knn_dataset, knn_ProWRAS_f1, knn_SimpleGAN_f1)\n",
    "showDiagnose(\"cohens kappa score\", \"KNN\", knn_dataset, knn_ProWRAS_k, knn_SimpleGAN_k)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "molecular-spectrum",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(False, False, False)\n"
     ]
    }
   ],
   "source": [
    "print((\n",
    "    knn_dataset == lr_dataset,\n",
    "    knn_dataset == gb_dataset,\n",
    "    gb_dataset == lr_dataset\n",
    "    ))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "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.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
