Skip to content

Commit def07cf

Browse files
committed
Updated imports and requirements.txt
1 parent d53d75b commit def07cf

File tree

5 files changed

+23
-102
lines changed

5 files changed

+23
-102
lines changed

src/experiments/OOD-adj-scores/0_Train_Models.ipynb

+8-8
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,9 @@
1313
"import sys\n",
1414
"sys.path.insert(0, \"../\")\n",
1515
"\n",
16-
"\n",
1716
"from autogluon.vision import ImagePredictor, ImageDataset\n",
1817
"import numpy as np\n",
1918
"import pandas as pd\n",
20-
"import pickle\n",
21-
"import datetime\n",
22-
"from pathlib import Path\n",
23-
"from sklearn.ensemble import IsolationForest\n",
24-
"from sklearn.model_selection import StratifiedKFold\n",
25-
"from sklearn.metrics import roc_auc_score\n",
26-
"from sklearn.model_selection import train_test_split\n",
2719
"\n",
2820
"pd.set_option('display.max_rows', None)\n",
2921
"pd.set_option('display.max_columns', None)\n",
@@ -207,6 +199,14 @@
207199
" \n",
208200
" _ = train_ag_model(train_dataset, dataset_name=dataset, model=model, epochs=100)"
209201
]
202+
},
203+
{
204+
"cell_type": "code",
205+
"execution_count": null,
206+
"id": "ec1ed3e1",
207+
"metadata": {},
208+
"outputs": [],
209+
"source": []
210210
}
211211
],
212212
"metadata": {

src/experiments/OOD-adj-scores/1_Evaluate_All_OOD_Experiments.ipynb

-9
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,9 @@
2121
"from autogluon.vision import ImagePredictor, ImageDataset\n",
2222
"import numpy as np\n",
2323
"import pandas as pd\n",
24-
"import pickle\n",
25-
"import datetime\n",
26-
"from pathlib import Path\n",
2724
"\n",
2825
"import seaborn as sns\n",
29-
"from sklearn.model_selection import StratifiedKFold\n",
3026
"from sklearn.metrics import roc_auc_score\n",
31-
"from sklearn.model_selection import train_test_split\n",
32-
"from IPython.display import HTML\n",
33-
"from matplotlib import pyplot as plt\n",
3427
"from cleanlab.count import get_confident_thresholds\n",
3528
"from cleanlab.internal.label_quality_utils import get_normalized_entropy\n",
3629
"\n",
@@ -455,8 +448,6 @@
455448
},
456449
"outputs": [],
457450
"source": [
458-
"# export to latex\n",
459-
"\n",
460451
"# write to Latex file\n",
461452
"with open(f\"{model}_ood_auroc.tex\", \"w\") as tf:\n",
462453
" tf.write(df_results[cols].rename(columns=cols_rename_dict).to_latex(index=False, float_format=\"%.4f\"))"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
autogluon==0.4.0
2+
numpy==1.22.4
3+
pandas==1.3.5
4+
scikit-learn==1.0.2
5+
torch==1.10.1+cu113
6+
torchvision==0.11.2+cu113
7+
torchaudio==0.10.1+cu113
8+
cleanlab
9+
seaborn
10+
cifar2png
11+

src/experiments/OOD/0_Train_Models.ipynb

+4-81
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,9 @@
1313
"import sys\n",
1414
"sys.path.insert(0, \"../\")\n",
1515
"\n",
16-
"\n",
1716
"from autogluon.vision import ImagePredictor, ImageDataset\n",
1817
"import numpy as np\n",
1918
"import pandas as pd\n",
20-
"import pickle\n",
21-
"import datetime\n",
22-
"from pathlib import Path\n",
23-
"from sklearn.ensemble import IsolationForest\n",
24-
"from sklearn.model_selection import StratifiedKFold\n",
25-
"from sklearn.metrics import roc_auc_score\n",
26-
"from sklearn.model_selection import train_test_split\n",
2719
"\n",
2820
"pd.set_option('display.max_rows', None)\n",
2921
"pd.set_option('display.max_columns', None)\n",
@@ -40,7 +32,7 @@
4032
},
4133
{
4234
"cell_type": "code",
43-
"execution_count": 2,
35+
"execution_count": null,
4436
"id": "5c9b59b4-c51c-4cdb-a958-46f227cdb5d8",
4537
"metadata": {},
4638
"outputs": [],
@@ -63,7 +55,7 @@
6355
},
6456
{
6557
"cell_type": "code",
66-
"execution_count": 3,
58+
"execution_count": null,
6759
"id": "cde63994-e833-4f87-93b6-e05b3c7ba479",
6860
"metadata": {},
6961
"outputs": [],
@@ -96,79 +88,10 @@
9688
},
9789
{
9890
"cell_type": "code",
99-
"execution_count": 7,
91+
"execution_count": null,
10092
"id": "1ae79a8d-bb68-46d5-b4b9-1f082da7d695",
10193
"metadata": {},
102-
"outputs": [
103-
{
104-
"data": {
105-
"text/html": [
106-
"<div>\n",
107-
"<style scoped>\n",
108-
" .dataframe tbody tr th:only-of-type {\n",
109-
" vertical-align: middle;\n",
110-
" }\n",
111-
"\n",
112-
" .dataframe tbody tr th {\n",
113-
" vertical-align: top;\n",
114-
" }\n",
115-
"\n",
116-
" .dataframe thead th {\n",
117-
" text-align: right;\n",
118-
" }\n",
119-
"</style>\n",
120-
"<table border=\"1\" class=\"dataframe\">\n",
121-
" <thead>\n",
122-
" <tr style=\"text-align: right;\">\n",
123-
" <th></th>\n",
124-
" <th>image</th>\n",
125-
" <th>label</th>\n",
126-
" </tr>\n",
127-
" </thead>\n",
128-
" <tbody>\n",
129-
" <tr>\n",
130-
" <th>0</th>\n",
131-
" <td>/Data/cifar100_png/train/apple/0001.png</td>\n",
132-
" <td>0</td>\n",
133-
" </tr>\n",
134-
" <tr>\n",
135-
" <th>1</th>\n",
136-
" <td>/Data/cifar100_png/train/apple/0002.png</td>\n",
137-
" <td>0</td>\n",
138-
" </tr>\n",
139-
" <tr>\n",
140-
" <th>2</th>\n",
141-
" <td>/Data/cifar100_png/train/apple/0003.png</td>\n",
142-
" <td>0</td>\n",
143-
" </tr>\n",
144-
" <tr>\n",
145-
" <th>3</th>\n",
146-
" <td>/Data/cifar100_png/train/apple/0004.png</td>\n",
147-
" <td>0</td>\n",
148-
" </tr>\n",
149-
" <tr>\n",
150-
" <th>4</th>\n",
151-
" <td>/Data/cifar100_png/train/apple/0005.png</td>\n",
152-
" <td>0</td>\n",
153-
" </tr>\n",
154-
" </tbody>\n",
155-
"</table>\n",
156-
"</div>"
157-
],
158-
"text/plain": [
159-
" image label\n",
160-
"0 /Data/cifar100_png/train/apple/0001.png 0\n",
161-
"1 /Data/cifar100_png/train/apple/0002.png 0\n",
162-
"2 /Data/cifar100_png/train/apple/0003.png 0\n",
163-
"3 /Data/cifar100_png/train/apple/0004.png 0\n",
164-
"4 /Data/cifar100_png/train/apple/0005.png 0"
165-
]
166-
},
167-
"execution_count": 7,
168-
"metadata": {},
169-
"output_type": "execute_result"
170-
}
171-
],
94+
"outputs": [],
17295
"source": [
17396
"# Check out a dataset\n",
17497
"cifar_100_train_dataset.head()"

src/experiments/OOD/1_Evaluate_All_OOD_Experiments.ipynb

-4
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,12 @@
1919
"from autogluon.vision import ImagePredictor, ImageDataset\n",
2020
"import numpy as np\n",
2121
"import pandas as pd\n",
22-
"import pickle\n",
23-
"import datetime\n",
24-
"from pathlib import Path\n",
2522
"import umap\n",
2623
"import seaborn as sns\n",
2724
"from sklearn.ensemble import IsolationForest\n",
2825
"from sklearn.model_selection import StratifiedKFold\n",
2926
"from sklearn.metrics import roc_auc_score\n",
3027
"from sklearn.model_selection import train_test_split\n",
31-
"from IPython.display import HTML\n",
3228
"from matplotlib import pyplot as plt\n",
3329
"from cleanlab.internal.label_quality_utils import get_normalized_entropy\n",
3430
"\n",

0 commit comments

Comments
 (0)