forked from bigdata-ustc/EduKTM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] add README.md for load_data.py
- Loading branch information
Showing
2 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
## AKT load_data.py | ||
|
||
This script is used for loading data from a txt file. | ||
|
||
### Data Format | ||
|
||
The data format in txt file could be: | ||
|
||
1. without problem_id | ||
``` | ||
seqlen | ||
question_id_1,question_id_2,question_id_3 | ||
answer_1, answer_2, answer_3 | ||
``` | ||
for example: | ||
``` | ||
7 | ||
83,83,83,83,20,84,19 | ||
0,1,1,1,1,1,1 | ||
``` | ||
2. with problem_id | ||
``` | ||
seqlen | ||
problem_id_1,problem_id_2,problem_id_3 | ||
question_id_1,question_id_2,question_id_3 | ||
answer_1, answer_2, answer_3 | ||
``` | ||
for example: | ||
``` | ||
7 | ||
13060,12972,13087,13057,3758,13366,3605 | ||
83,83,83,83,20,84,19 | ||
0,1,1,1,1,1,1 | ||
``` | ||
It will be translated to following format: | ||
```python | ||
# without problem_id | ||
tuple(question_array, question_answer_array, student_id_array) | ||
question_array: np_array(np_array, np_array, ...) | ||
question_answer_array: np_array(np_array, np_array, ...) | ||
student_id_array: np_array(1, 2, ...) | ||
# with problem_id | ||
tuple(question_array, question_answer_array, problem_array) | ||
question_array: np_array(np_array, np_array, ...) | ||
question_answer_array: np_array(np_array, np_array, ...) | ||
problem_array: np_array(np_array, np_array, ...) | ||
``` | ||
|
||
### Usage | ||
|
||
```python | ||
from scripts.AKT import DATA, PID_DATA | ||
|
||
model_type = 'pid' | ||
n_question = 123 | ||
n_pid = 17751 | ||
seqlen = 200 | ||
|
||
if model_type == 'pid': | ||
dat = PID_DATA(n_question=n_question, seqlen=seqlen, separate_char=',') | ||
else: | ||
dat = DATA(n_question=n_question, seqlen=seqlen, separate_char=',') | ||
|
||
train_data = dat.load_data('../../data/2009_skill_builder_data_corrected/train_pid.txt') | ||
|
||
q, qa, p = train_data | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters