Skip to content

Commit

Permalink
Merge pull request #44 from georgian-io/akash/bugfix
Browse files Browse the repository at this point in the history
Fix(.): Resolve issue in evaluation.
  • Loading branch information
akashsara authored May 30, 2023
2 parents c0dd884 + 769f1f1 commit bd5bf14
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions notebooks/text_w_tabular_classification.ipynb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand All @@ -14,6 +15,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand All @@ -24,6 +26,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand All @@ -34,6 +37,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -118,6 +122,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -217,6 +222,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -262,6 +268,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -291,9 +298,9 @@
"output_type": "stream",
"text": [
"Downloading womens-ecommerce-clothing-reviews.zip to /content\n",
"\r",
"\r\n",
" 0% 0.00/2.79M [00:00<?, ?B/s]\n",
"\r",
"\r\n",
"100% 2.79M/2.79M [00:00<00:00, 88.6MB/s]\n",
"Archive: womens-ecommerce-clothing-reviews.zip\n",
" inflating: Womens Clothing E-Commerce Reviews.csv \n",
Expand All @@ -309,6 +316,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -464,6 +472,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -717,6 +726,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -758,6 +768,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -880,6 +891,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -941,6 +953,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -1075,6 +1088,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -1286,6 +1300,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -1317,8 +1332,9 @@
")\n",
"\n",
"def calc_classification_metrics(p: EvalPrediction):\n",
" pred_labels = np.argmax(p.predictions, axis=1)\n",
" pred_scores = softmax(p.predictions, axis=1)[:, 1]\n",
" predictions = p.predictions[0]\n",
" pred_labels = np.argmax(predictions, axis=1)\n",
" pred_scores = softmax(predictions, axis=1)[:, 1]\n",
" labels = p.label_ids\n",
" if len(np.unique(labels)) == 2: # binary classification\n",
" roc_auc_pred_score = roc_auc_score(labels, pred_scores)\n",
Expand Down Expand Up @@ -1370,6 +1386,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -1572,6 +1589,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
Expand Down Expand Up @@ -1780,19 +1798,7 @@
"outputs": [
{
"data": {
"application/javascript": [
"\n",
" (async () => {\n",
" const url = await google.colab.kernel.proxyPort(6006, {\"cache\": true});\n",
" const iframe = document.createElement('iframe');\n",
" iframe.src = url;\n",
" iframe.setAttribute('width', '100%');\n",
" iframe.setAttribute('height', '800');\n",
" iframe.setAttribute('frameborder', 0);\n",
" document.body.appendChild(iframe);\n",
" })();\n",
" "
],
"application/javascript": "\n (async () => {\n const url = await google.colab.kernel.proxyPort(6006, {\"cache\": true});\n const iframe = document.createElement('iframe');\n iframe.src = url;\n iframe.setAttribute('width', '100%');\n iframe.setAttribute('height', '800');\n iframe.setAttribute('frameborder', 0);\n document.body.appendChild(iframe);\n })();\n ",
"text/plain": [
"<IPython.core.display.Javascript object>"
]
Expand Down

0 comments on commit bd5bf14

Please sign in to comment.