DIGITS-CNN/cars/confusions.ipynb

716 lines
67 KiB
Plaintext
Raw Normal View History

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
2021-04-16 23:59:20 +01:00
"id": "34b0345b",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import pandas as pd\n",
"import seaborn as sns\n",
"import matplotlib as mpl\n",
"from matplotlib import pyplot as plt"
]
},
{
"cell_type": "markdown",
2021-04-16 23:59:20 +01:00
"id": "75b9f701",
"metadata": {},
"source": [
"# Render Confusion Matrices\n",
"\n",
"DIGITs generates confusion matrix tables, need to render as is, not generate using scikit-learn's func"
]
},
{
"cell_type": "code",
"execution_count": 2,
2021-04-16 23:59:20 +01:00
"id": "10521209",
"metadata": {},
"outputs": [],
"source": [
"frame = pd.read_csv('architecture-investigations/fc/3-layers/1024/conf.csv', index_col=0)\n",
"accuracy_col = frame.pop('Per-class accuracy')"
]
},
{
"cell_type": "code",
2021-04-16 23:59:20 +01:00
"execution_count": 19,
"id": "02c2844f",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"50.0% 0.5\n",
"25.0% 0.25\n",
"30.0% 0.3\n",
"100.0% 1.0\n",
"71.43% 0.7142857142857143\n",
"44.44% 0.4444444444444444\n",
"62.5% 0.625\n",
"0.0% 0.0\n",
"50.0% 0.5\n",
"20.0% 0.2\n",
"\n",
"MAP = 49.3%\n"
]
}
],
"source": [
"normalised_array = np.ndarray((196, 196))\n",
"for idx, row in enumerate(frame.to_numpy()):\n",
" normalised_array[idx, :] = row / np.sum(row)\n",
"\n",
"# check correct accuracy\n",
"for acc, (idx, row) in zip(accuracy_col, enumerate(normalised_array[:10])):\n",
" print(acc, row[idx])\n",
"\n",
"class_acc_counter = 0\n",
"for idx, row in enumerate(normalised_array):\n",
" class_acc_counter += row[idx]\n",
" \n",
"print(f\"\\nMAP = {class_acc_counter*100/196:.4}%\")"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "91132579",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>AM General Hummer SUV 2000</th>\n",
" <th>Acura RL Sedan 2012</th>\n",
" <th>Acura TL Sedan 2012</th>\n",
" <th>Acura TL Type-S 2008</th>\n",
" <th>Acura TSX Sedan 2012</th>\n",
" <th>Acura Integra Type R 2001</th>\n",
" <th>Acura ZDX Hatchback 2012</th>\n",
" <th>Aston Martin V8 Vantage Convertible 2012</th>\n",
" <th>Aston Martin V8 Vantage Coupe 2012</th>\n",
" <th>Aston Martin Virage Convertible 2012</th>\n",
" <th>...</th>\n",
" <th>Toyota Camry Sedan 2012</th>\n",
" <th>Toyota Corolla Sedan 2012</th>\n",
" <th>Toyota 4Runner SUV 2012</th>\n",
" <th>Volkswagen Golf Hatchback 2012</th>\n",
" <th>Volkswagen Golf Hatchback 1991</th>\n",
" <th>Volkswagen Beetle Hatchback 2012</th>\n",
" <th>Volvo C30 Hatchback 2012</th>\n",
" <th>Volvo 240 Sedan 1993</th>\n",
" <th>Volvo XC90 SUV 2007</th>\n",
" <th>smart fortwo Convertible 2012</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>AM General Hummer SUV 2000</th>\n",
" <td>6</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Acura RL Sedan 2012</th>\n",
" <td>0</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>2</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Acura TL Sedan 2012</th>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>3</td>\n",
" <td>0</td>\n",
" <td>2</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Acura TL Type-S 2008</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>3</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Acura TSX Sedan 2012</th>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>5</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Volkswagen Beetle Hatchback 2012</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>5</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Volvo C30 Hatchback 2012</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>4</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Volvo 240 Sedan 1993</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>10</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Volvo XC90 SUV 2007</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>7</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>smart fortwo Convertible 2012</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>10</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>196 rows × 196 columns</p>\n",
"</div>"
],
"text/plain": [
" AM General Hummer SUV 2000 \\\n",
"AM General Hummer SUV 2000 6 \n",
"Acura RL Sedan 2012 0 \n",
"Acura TL Sedan 2012 0 \n",
"Acura TL Type-S 2008 0 \n",
"Acura TSX Sedan 2012 0 \n",
"... ... \n",
"Volkswagen Beetle Hatchback 2012 0 \n",
"Volvo C30 Hatchback 2012 0 \n",
"Volvo 240 Sedan 1993 0 \n",
"Volvo XC90 SUV 2007 0 \n",
"smart fortwo Convertible 2012 0 \n",
"\n",
" Acura RL Sedan 2012 Acura TL Sedan 2012 \\\n",
"AM General Hummer SUV 2000 0 0 \n",
"Acura RL Sedan 2012 2 1 \n",
"Acura TL Sedan 2012 1 3 \n",
"Acura TL Type-S 2008 0 0 \n",
"Acura TSX Sedan 2012 1 0 \n",
"... ... ... \n",
"Volkswagen Beetle Hatchback 2012 0 0 \n",
"Volvo C30 Hatchback 2012 0 0 \n",
"Volvo 240 Sedan 1993 0 0 \n",
"Volvo XC90 SUV 2007 0 0 \n",
"smart fortwo Convertible 2012 0 0 \n",
"\n",
" Acura TL Type-S 2008 Acura TSX Sedan 2012 \\\n",
"AM General Hummer SUV 2000 0 0 \n",
"Acura RL Sedan 2012 0 2 \n",
"Acura TL Sedan 2012 0 2 \n",
"Acura TL Type-S 2008 3 0 \n",
"Acura TSX Sedan 2012 0 5 \n",
"... ... ... \n",
"Volkswagen Beetle Hatchback 2012 0 0 \n",
"Volvo C30 Hatchback 2012 0 0 \n",
"Volvo 240 Sedan 1993 0 0 \n",
"Volvo XC90 SUV 2007 0 0 \n",
"smart fortwo Convertible 2012 0 0 \n",
"\n",
" Acura Integra Type R 2001 \\\n",
"AM General Hummer SUV 2000 0 \n",
"Acura RL Sedan 2012 0 \n",
"Acura TL Sedan 2012 0 \n",
"Acura TL Type-S 2008 0 \n",
"Acura TSX Sedan 2012 0 \n",
"... ... \n",
"Volkswagen Beetle Hatchback 2012 0 \n",
"Volvo C30 Hatchback 2012 0 \n",
"Volvo 240 Sedan 1993 0 \n",
"Volvo XC90 SUV 2007 0 \n",
"smart fortwo Convertible 2012 0 \n",
"\n",
" Acura ZDX Hatchback 2012 \\\n",
"AM General Hummer SUV 2000 0 \n",
"Acura RL Sedan 2012 0 \n",
"Acura TL Sedan 2012 0 \n",
"Acura TL Type-S 2008 0 \n",
"Acura TSX Sedan 2012 0 \n",
"... ... \n",
"Volkswagen Beetle Hatchback 2012 0 \n",
"Volvo C30 Hatchback 2012 0 \n",
"Volvo 240 Sedan 1993 0 \n",
"Volvo XC90 SUV 2007 0 \n",
"smart fortwo Convertible 2012 0 \n",
"\n",
" Aston Martin V8 Vantage Convertible 2012 \\\n",
"AM General Hummer SUV 2000 0 \n",
"Acura RL Sedan 2012 0 \n",
"Acura TL Sedan 2012 0 \n",
"Acura TL Type-S 2008 0 \n",
"Acura TSX Sedan 2012 0 \n",
"... ... \n",
"Volkswagen Beetle Hatchback 2012 0 \n",
"Volvo C30 Hatchback 2012 0 \n",
"Volvo 240 Sedan 1993 0 \n",
"Volvo XC90 SUV 2007 0 \n",
"smart fortwo Convertible 2012 0 \n",
"\n",
" Aston Martin V8 Vantage Coupe 2012 \\\n",
"AM General Hummer SUV 2000 0 \n",
"Acura RL Sedan 2012 0 \n",
"Acura TL Sedan 2012 0 \n",
"Acura TL Type-S 2008 0 \n",
"Acura TSX Sedan 2012 0 \n",
"... ... \n",
"Volkswagen Beetle Hatchback 2012 0 \n",
"Volvo C30 Hatchback 2012 0 \n",
"Volvo 240 Sedan 1993 0 \n",
"Volvo XC90 SUV 2007 0 \n",
"smart fortwo Convertible 2012 0 \n",
"\n",
" Aston Martin Virage Convertible 2012 ... \\\n",
"AM General Hummer SUV 2000 0 ... \n",
"Acura RL Sedan 2012 0 ... \n",
"Acura TL Sedan 2012 0 ... \n",
"Acura TL Type-S 2008 0 ... \n",
"Acura TSX Sedan 2012 0 ... \n",
"... ... ... \n",
"Volkswagen Beetle Hatchback 2012 0 ... \n",
"Volvo C30 Hatchback 2012 0 ... \n",
"Volvo 240 Sedan 1993 0 ... \n",
"Volvo XC90 SUV 2007 0 ... \n",
"smart fortwo Convertible 2012 0 ... \n",
"\n",
" Toyota Camry Sedan 2012 \\\n",
"AM General Hummer SUV 2000 0 \n",
"Acura RL Sedan 2012 0 \n",
"Acura TL Sedan 2012 0 \n",
"Acura TL Type-S 2008 0 \n",
"Acura TSX Sedan 2012 0 \n",
"... ... \n",
"Volkswagen Beetle Hatchback 2012 0 \n",
"Volvo C30 Hatchback 2012 0 \n",
"Volvo 240 Sedan 1993 0 \n",
"Volvo XC90 SUV 2007 0 \n",
"smart fortwo Convertible 2012 0 \n",
"\n",
" Toyota Corolla Sedan 2012 \\\n",
"AM General Hummer SUV 2000 0 \n",
"Acura RL Sedan 2012 0 \n",
"Acura TL Sedan 2012 0 \n",
"Acura TL Type-S 2008 0 \n",
"Acura TSX Sedan 2012 0 \n",
"... ... \n",
"Volkswagen Beetle Hatchback 2012 0 \n",
"Volvo C30 Hatchback 2012 0 \n",
"Volvo 240 Sedan 1993 0 \n",
"Volvo XC90 SUV 2007 0 \n",
"smart fortwo Convertible 2012 0 \n",
"\n",
" Toyota 4Runner SUV 2012 \\\n",
"AM General Hummer SUV 2000 0 \n",
"Acura RL Sedan 2012 0 \n",
"Acura TL Sedan 2012 0 \n",
"Acura TL Type-S 2008 0 \n",
"Acura TSX Sedan 2012 0 \n",
"... ... \n",
"Volkswagen Beetle Hatchback 2012 0 \n",
"Volvo C30 Hatchback 2012 0 \n",
"Volvo 240 Sedan 1993 0 \n",
"Volvo XC90 SUV 2007 0 \n",
"smart fortwo Convertible 2012 0 \n",
"\n",
" Volkswagen Golf Hatchback 2012 \\\n",
"AM General Hummer SUV 2000 0 \n",
"Acura RL Sedan 2012 0 \n",
"Acura TL Sedan 2012 0 \n",
"Acura TL Type-S 2008 0 \n",
"Acura TSX Sedan 2012 0 \n",
"... ... \n",
"Volkswagen Beetle Hatchback 2012 0 \n",
"Volvo C30 Hatchback 2012 0 \n",
"Volvo 240 Sedan 1993 0 \n",
"Volvo XC90 SUV 2007 0 \n",
"smart fortwo Convertible 2012 0 \n",
"\n",
" Volkswagen Golf Hatchback 1991 \\\n",
"AM General Hummer SUV 2000 0 \n",
"Acura RL Sedan 2012 0 \n",
"Acura TL Sedan 2012 0 \n",
"Acura TL Type-S 2008 0 \n",
"Acura TSX Sedan 2012 0 \n",
"... ... \n",
"Volkswagen Beetle Hatchback 2012 0 \n",
"Volvo C30 Hatchback 2012 0 \n",
"Volvo 240 Sedan 1993 0 \n",
"Volvo XC90 SUV 2007 0 \n",
"smart fortwo Convertible 2012 0 \n",
"\n",
" Volkswagen Beetle Hatchback 2012 \\\n",
"AM General Hummer SUV 2000 0 \n",
"Acura RL Sedan 2012 0 \n",
"Acura TL Sedan 2012 0 \n",
"Acura TL Type-S 2008 0 \n",
"Acura TSX Sedan 2012 0 \n",
"... ... \n",
"Volkswagen Beetle Hatchback 2012 5 \n",
"Volvo C30 Hatchback 2012 1 \n",
"Volvo 240 Sedan 1993 0 \n",
"Volvo XC90 SUV 2007 0 \n",
"smart fortwo Convertible 2012 0 \n",
"\n",
" Volvo C30 Hatchback 2012 \\\n",
"AM General Hummer SUV 2000 0 \n",
"Acura RL Sedan 2012 0 \n",
"Acura TL Sedan 2012 0 \n",
"Acura TL Type-S 2008 0 \n",
"Acura TSX Sedan 2012 0 \n",
"... ... \n",
"Volkswagen Beetle Hatchback 2012 0 \n",
"Volvo C30 Hatchback 2012 4 \n",
"Volvo 240 Sedan 1993 0 \n",
"Volvo XC90 SUV 2007 0 \n",
"smart fortwo Convertible 2012 0 \n",
"\n",
" Volvo 240 Sedan 1993 Volvo XC90 SUV 2007 \\\n",
"AM General Hummer SUV 2000 0 0 \n",
"Acura RL Sedan 2012 0 0 \n",
"Acura TL Sedan 2012 0 0 \n",
"Acura TL Type-S 2008 0 0 \n",
"Acura TSX Sedan 2012 0 0 \n",
"... ... ... \n",
"Volkswagen Beetle Hatchback 2012 0 0 \n",
"Volvo C30 Hatchback 2012 0 0 \n",
"Volvo 240 Sedan 1993 10 0 \n",
"Volvo XC90 SUV 2007 0 7 \n",
"smart fortwo Convertible 2012 0 0 \n",
"\n",
" smart fortwo Convertible 2012 \n",
"AM General Hummer SUV 2000 1 \n",
"Acura RL Sedan 2012 0 \n",
"Acura TL Sedan 2012 0 \n",
"Acura TL Type-S 2008 0 \n",
"Acura TSX Sedan 2012 0 \n",
"... ... \n",
"Volkswagen Beetle Hatchback 2012 0 \n",
"Volvo C30 Hatchback 2012 0 \n",
"Volvo 240 Sedan 1993 0 \n",
"Volvo XC90 SUV 2007 0 \n",
"smart fortwo Convertible 2012 10 \n",
"\n",
"[196 rows x 196 columns]"
]
},
2021-04-16 23:59:20 +01:00
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"frame"
]
},
{
"cell_type": "code",
2021-04-16 23:59:20 +01:00
"execution_count": 14,
"id": "72eacc1e",
"metadata": {},
"outputs": [
{
"data": {
2021-04-16 23:59:20 +01:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkcAAAJSCAYAAADJWGHfAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Z1A+gAAAACXBIWXMAAAsTAAALEwEAmpwYAAA00UlEQVR4nO3df5AcZ33n8c9Xu0hYRrItBJJXsizrJ0ic2cMyWimEKPZdbAxXRuUqfogjwIVT4CBXUZILPw5iHH7kuLqcCAkBBAGTBAE+cyLEuGywXa4cZ62RdLVRkIxkSUi2tJJsYfxTRvLsPvfHTPc8Ws3s9Mz09M/3q0qlZ3t7pr/T80zPs99vdz/mnBMAAACqpqQdAAAAQJYwOAIAAPAwOAIAAPAwOAIAAPAwOAIAAPAwOAIAAPAwOAIQKzO7wMz+0cyeMrP/1cXzvMPMfhhnbGkxs183s31pxwEgGuM+R0A5mdkGSX8g6RWSnpE0IunTzrkfd/m875T0e5LWOucq3caZdWbmJC11zh1IOxYA8SBzBJSQmf2BpM9J+oykOZIWSPprSTfG8PSXS9pfhoFRF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in4yG7crhRxKJqRP9CxdIynaMQNEU+XMXvDbp3NfXabanKFmi8dcNSpKm/HgkXNZsXyH74n7vyBwBAAB4GBwBAAB4ClNWa+TEmnr7JbflI0VKKjclQ1fW28O704ujZE5trH9IZ2/ZnlocRf7cFfm1dcMvpwXYV/kV93tH5ggAAMDD4AgAAMBTmPsctVK55qqw3X/frp5uK02dvk72DwAgqqIcS7nPEQAAQAQMjgAAADylKav57h4
"text/plain": [
2021-04-16 23:59:20 +01:00
"<Figure size 864x720 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
2021-04-16 23:59:20 +01:00
"fig, ax = plt.subplots(figsize=(12, 10)\n",
"# , dpi=400\n",
" )\n",
"\n",
2021-04-16 23:59:20 +01:00
"ax.matshow(normalised_array)\n",
"\n",
2021-04-16 23:59:20 +01:00
"ax.set_title('Confusion matrix')\n",
"# plt.colorbar(ax=ax)\n",
"plt.show()"
]
},
{
"cell_type": "code",
2021-04-16 23:59:20 +01:00
"execution_count": 26,
"id": "831a9fab",
"metadata": {},
"outputs": [
{
"data": {
2021-04-16 23:59:20 +01:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnkAAAJDCAYAAAB36AJqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Z1A+gAAAACXBIWXMAAAsTAAALEwEAmpwYAAA7EUlEQVR4nO3df5xWZZ3/8fdHQWRmQEgkCyzRTDIspfBH+8WKiNS2Rb+5kahpXxWDcvuulUu7Wa3uD2t3/VZ+hRRMTaVwtxWsaCWiVr6tIoakSGAotg1WoIkwM4iDc33/mDmHI8w99z1z3+ec65zr9fTBw2vOfe5zrnPuc5+55vM513WZc04AAAAol4PyrgAAAAAaj0YeAABACdHIAwAAKCEaeQAAACVEIw8AAKCEaOQBAACUEI08oKTMbKiZfd/MXjSzf61jOxeY2fJG1i0vZjbZzDblXQ8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h07VJnctGx+VTz5sqSVrbkX7vWwAAUDsf0rXtz5yXaRun+eh/o3ctAAAA6leqZ/Iuu2jfFGgnDu3+/9qOnCoDFIAP42VVU4Q6ohi4lrJz+tCLJUkP7r4j55r0gWfyAAAAUESliuQBAADUwhgnL/+OF+Obp8flje1L+/3+y4/YN47egu3zcqlD0fTneEM7NwDCxj2vMXzoeNGx+UOZtnGa3vR9xskDAABIXQCRPJ7JAwAAKCHv07WNdOObL43LVz55a5/rPnXuKXH52HsfTq1OAACExod07e6NH8i0jTN0/P2MkwcAAID68UweAAAITwDP5HmZrh3XMq3X5Vvalme232r7mjFiX6/dh/durvl
"text/plain": [
"<Figure size 864x720 with 2 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"plt.figure(figsize=(12, 10)\n",
"# , dpi=400\n",
" )\n",
2021-04-16 23:59:20 +01:00
"sns.heatmap(normalised_array, xticklabels=False, yticklabels=False, cmap='inferno')\n",
"\n",
"plt.title('Confusion matrix')\n",
"plt.show()"
]
}
],
"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.9.2"
}
},
"nbformat": 4,
"nbformat_minor": 5
}