Commit 0e59269a authored by markus's avatar markus
Browse files

update

parent a7060022
......@@ -26,7 +26,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
......@@ -129,7 +129,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 21,
"metadata": {},
"outputs": [],
"source": [
......@@ -137,7 +137,7 @@
"embeddings = load_embeddings_from_file(\"../data/embeddings/embeddings_carcinogenesis_transr_16dim.tsv\")\n",
"\n",
"# Combine positive and negative results\n",
"pos, neg = extract_resources(learning_problems, 1)\n",
"pos, neg = extract_resources(learning_problems, 2)\n",
"all_res = pos + neg\n",
"all_res_embeddings = np.array([embeddings[x] for x in all_res])\n",
"\n",
......@@ -146,18 +146,19 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 22,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Positive cluster label: 0\nNegative cluster label: 1\nTrue positives: 86\nTrue negatives: 11028\nFalse positives: 11237\nFalse negatives: 21\nAccuracy: 0.49678169139996425\nPrecision: 0.007595160293208514\nRecall: 0.8037383177570093\nF1-Score: 0.01504811898512686\n"
"Positive cluster label: 0\nNegative cluster label: 1\nTrue positives: 78\nTrue negatives: 10979\nFalse positives: 11246\nFalse negatives: 69\nAccuracy: 0.4942338637582693\nPrecision: 0.00688802543270929\nRecall: 0.5306122448979592\nF1-Score: 0.013599511812396478\n"
]
}
],
"source": [
"\n",
"# Identify cluster with majority positive examples\n",
"positives_label = 1 if sum(clustering.labels_[:len(pos)]) > len(pos)/2 else 0\n",
"negatives_label = 1 - 1 * positives_label\n",
......@@ -173,13 +174,6 @@
"print(\"False negatives: \" + str(FN))\n",
"print_metrics(TP, TN, FP, FN)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
]
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment