Skip to content

Commit

Permalink
[fix] answer time processing problem
Browse files Browse the repository at this point in the history
  • Loading branch information
sone47 committed Aug 25, 2021
1 parent 861c7f4 commit a28fa02
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 24 deletions.
30 changes: 15 additions & 15 deletions examples/LPKT/LPKT.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
" return q_matrix\n",
"\n",
"batch_size = 32\n",
"n_at = 9632\n",
"n_it = 2890\n",
"n_at = 1326\n",
"n_it = 2839\n",
"n_question = 102\n",
"n_exercise = 3162\n",
"seqlen = 500\n",
Expand Down Expand Up @@ -111,60 +111,60 @@
"name": "stderr",
"output_type": "stream",
"text": [
"Training: 100%|██████████| 31/31 [16:34<00:00, 32.09s/it]\n",
"Testing: 0%| | 0/13 [00:00<?, ?it/s]"
"Training: 100%|██████████| 61/61 [17:57<00:00, 17.66s/it]\n",
"Testing: 0%| | 0/26 [00:00<?, ?it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[Epoch 0] LogisticLoss: 0.747071\n"
"[Epoch 0] LogisticLoss: 0.643005\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Testing: 100%|██████████| 13/13 [01:14<00:00, 5.76s/it]\n",
"Training: 0%| | 0/31 [00:00<?, ?it/s]"
"Testing: 100%|██████████| 26/26 [01:26<00:00, 3.33s/it]\n",
"Training: 0%| | 0/61 [00:00<?, ?it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[Epoch 0] auc: 0.647351, accuracy: 0.624059\n"
"[Epoch 0] auc: 0.680518, accuracy: 0.662649\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Training: 100%|██████████| 31/31 [15:22<00:00, 29.76s/it]\n",
"Testing: 0%| | 0/13 [00:00<?, ?it/s]"
"Training: 100%|██████████| 61/61 [16:59<00:00, 16.72s/it]\n",
"Testing: 0%| | 0/26 [00:00<?, ?it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[Epoch 1] LogisticLoss: 0.628299\n"
"[Epoch 1] LogisticLoss: 0.596969\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Testing: 100%|██████████| 13/13 [01:20<00:00, 6.20s/it]\n",
"Testing: 100%|██████████| 26/26 [01:25<00:00, 3.27s/it]\n",
"INFO:root:save parameters to lpkt.params\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[Epoch 1] auc: 0.663860, accuracy: 0.670790\n"
"[Epoch 1] auc: 0.717534, accuracy: 0.682302\n"
]
}
],
Expand Down Expand Up @@ -203,14 +203,14 @@
"output_type": "stream",
"text": [
"INFO:root:load parameters from lpkt.params\n",
"Testing: 100%|██████████| 13/13 [01:20<00:00, 6.23s/it]"
"Testing: 100%|██████████| 26/26 [01:18<00:00, 3.04s/it]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"auc: 0.670790, accuracy: 0.663860\n"
"auc: 0.717543, accuracy: 0.682427\n"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions examples/LPKT/LPKT.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def generate_q_matrix(path, n_skill, n_problem, gamma=0.0):
return q_matrix

batch_size = 32
n_at = 9632
n_it = 2890
n_at = 1326
n_it = 2839
n_question = 102
n_exercise = 3162
seqlen = 500
Expand Down
16 changes: 9 additions & 7 deletions examples/LPKT/prepare_dataset.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
"data = pd.read_csv(\n",
" '../../data/anonymized_full_release_competition_dataset/anonymized_full_release_competition_dataset.csv',\n",
" usecols=['startTime', 'timeTaken', 'studentId', 'skill', 'problemId', 'correct']\n",
").dropna(subset=['skill', 'problemId']).sort_values('startTime')"
").dropna(subset=['skill', 'problemId']).sort_values('startTime')\n",
"\n",
"data.timeTaken = data.timeTaken.astype(int)"
]
},
{
Expand All @@ -44,7 +46,7 @@
"text": [
"number of skills: 102\n",
"number of problems: 3162\n",
"number of answer time: 9632\n"
"number of answer time: 1326\n"
]
}
],
Expand All @@ -56,7 +58,7 @@
"# question id from 1 to #num_skill\n",
"skill2id = { p: i+1 for i, p in enumerate(skills) }\n",
"problem2id = { p: i+1 for i, p in enumerate(problems) }\n",
"at2id = { int(a): i + 1 for i, a in enumerate(at) }\n",
"at2id = { a: i for i, a in enumerate(at) }\n",
"\n",
"print(\"number of skills: %d\" % len(skills))\n",
"print(\"number of problems: %d\" % len(problems))\n",
Expand Down Expand Up @@ -88,7 +90,7 @@
" item = 43200\n",
" it.add(item)\n",
"\n",
"it2id = { a: i + 1 for i, a in enumerate(it) }\n",
"it2id = { a: i for i, a in enumerate(it) }\n",
"print(\"number of interval time: %d\" % len(it))"
],
"metadata": {
Expand Down Expand Up @@ -126,7 +128,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"parse student sequence:\t: 100%|██████████| 1709/1709 [00:03<00:00, 495.23it/s]\n"
"parse student sequence:\t: 100%|██████████| 1709/1709 [00:03<00:00, 534.71it/s]\n"
]
}
],
Expand Down Expand Up @@ -187,8 +189,8 @@
"name": "stderr",
"output_type": "stream",
"text": [
"write into file: 100%|██████████| 1196/1196 [00:00<00:00, 1638.25it/s]\n",
"write into file: 100%|██████████| 513/513 [00:00<00:00, 1795.56it/s]\n"
"write into file: 100%|██████████| 1196/1196 [00:00<00:00, 1661.06it/s]\n",
"write into file: 100%|██████████| 513/513 [00:00<00:00, 1757.38it/s]\n"
]
}
],
Expand Down

0 comments on commit a28fa02

Please sign in to comment.