{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%matplotlib inline\n", "\n", "import pandas as pd\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import seaborn as sns\n", "from random import sample\n", "\n", "from itertools import chain\n", "from random import sample \n", "import scipy\n", "\n", "import sklearn.model_selection as skl" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## First read in the dataframe. You'll notice it's similar to the dataframe that you ended the final solution with in Lesson 2, Exercise 4, only with more data:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | Unnamed: 0 | \n", "Finding Labels | \n", "Patient ID | \n", "Patient Age | \n", "Patient Gender | \n", "Atelectasis | \n", "Cardiomegaly | \n", "Consolidation | \n", "Edema | \n", "Effusion | \n", "Emphysema | \n", "Fibrosis | \n", "Hernia | \n", "Infiltration | \n", "Mass | \n", "No Finding | \n", "Nodule | \n", "Pleural_Thickening | \n", "Pneumonia | \n", "Pneumothorax | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "1 | \n", "Cardiomegaly|Emphysema | \n", "1 | \n", "57 | \n", "M | \n", "0.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "
1 | \n", "2 | \n", "No Finding | \n", "2 | \n", "77 | \n", "M | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "
2 | \n", "3 | \n", "Atelectasis | \n", "3 | \n", "79 | \n", "M | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "
3 | \n", "4 | \n", "Cardiomegaly|Edema|Effusion | \n", "4 | \n", "55 | \n", "F | \n", "0.0 | \n", "1.0 | \n", "0.0 | \n", "1.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "
4 | \n", "5 | \n", "Consolidation|Mass | \n", "5 | \n", "68 | \n", "M | \n", "0.0 | \n", "0.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "