Skip to content

Commit

Permalink
[example] IRR-MIRT
Browse files Browse the repository at this point in the history
  • Loading branch information
tswsxk committed Jul 1, 2021
1 parent e5581ae commit 49ea5f8
Showing 1 changed file with 42 additions and 9 deletions.
51 changes: 42 additions & 9 deletions examples/IRR/MIRT.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"outputs": [
{
"name": "stderr",
Expand All @@ -101,7 +101,11 @@
"evaluating: 100%|██████████| 101/101 [00:00<00:00, 147.99it/s]\n",
"formatting item df: 100%|██████████| 10415/10415 [00:00<00:00, 11414.30it/s]\n",
"ranking metrics: 10415it [00:15, 673.20it/s]\n",
"Epoch 1: 59%|█████▉ | 429/727 [00:55<00:37, 7.94it/s]"
"Epoch 1: 100%|██████████| 727/727 [01:34<00:00, 7.67it/s]\n",
"evaluating: 100%|██████████| 101/101 [00:00<00:00, 162.69it/s]\n",
"formatting item df: 100%|██████████| 10415/10415 [00:00<00:00, 13177.35it/s]\n",
"ranking metrics: 10415it [00:14, 737.45it/s]\n",
"INFO:root:save parameters to IRR-MIRT.params\n"
]
},
{
Expand All @@ -115,7 +119,15 @@
"3 0.888882 0.675116 0.737681 0.686057 1.906961 10415\n",
"5 0.892384 0.674415 0.793843 0.711479 2.229573 10415\n",
"10 0.892711 0.673980 0.816039 0.720015 2.423428 10415\n",
"auc: 0.836789\tmap: 0.911223\tmrr: 0.902067\tcoverage_error: 3.008395\tranking_loss: 0.285400\tlen: 2.458569\tsupport: 10415\n"
"auc: 0.836789\tmap: 0.911223\tmrr: 0.902067\tcoverage_error: 3.008395\tranking_loss: 0.285400\tlen: 2.458569\tsupport: 10415\n",
"[Epoch 1] Loss: 2.538817, PointLoss: 0.651702, PairLoss: 4.425933\n",
"[Epoch 1]\n",
" ndcg@k precision@k recall@k f1@k len@k support@k\n",
"1 1.000000 0.670475 0.472193 0.523379 1.000000 10415\n",
"3 0.889095 0.675148 0.737989 0.686143 1.906961 10415\n",
"5 0.892053 0.674396 0.794098 0.711508 2.229573 10415\n",
"10 0.892339 0.674066 0.816177 0.720113 2.423428 10415\n",
"auc: 0.836738\tmap: 0.910856\tmrr: 0.901024\tcoverage_error: 3.007723\tranking_loss: 0.285489\tlen: 2.458569\tsupport: 10415\n"
]
}
],
Expand All @@ -137,24 +149,45 @@
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n",
"is_executing": true
"name": "#%%\n"
}
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"execution_count": 4,
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"INFO:root:load parameters from IRR-MIRT.params\n",
"evaluating: 100%|██████████| 218/218 [00:00<00:00, 258.54it/s]\n",
"formatting item df: 100%|██████████| 13682/13682 [00:01<00:00, 13198.37it/s]\n",
"ranking metrics: 13682it [00:22, 610.71it/s]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
" ndcg@k precision@k recall@k f1@k len@k support@k\n",
"1 1.000000 0.669200 0.371232 0.435331 1.000000 13682\n",
"3 0.862998 0.667434 0.663840 0.633772 2.268528 13682\n",
"5 0.869094 0.667705 0.770522 0.690039 2.981582 13682\n",
"10 0.869793 0.667432 0.844655 0.723425 3.723652 13682\n",
"auc: 0.770833\tmap: 0.870554\tmrr: 0.873113\tcoverage_error: 4.645888\tranking_loss: 0.315248\tlen: 4.075428\tsupport: 13682\n"
]
}
],
"source": [
"cdm.load(\"IRR-MIRT.params\")\n",
"print(cdm.eval(test_data))"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n",
"is_executing": true
"name": "#%%\n"
}
}
}
Expand Down

0 comments on commit 49ea5f8

Please sign in to comment.