Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Hhhhhhand authored Jan 13, 2024
2 parents 6044fbd + af7d596 commit 6df3983
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CAT/strategy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
from .BECAT_strategy import BECATstrategy
from .BOBCAT_strategy import BOBCAT
from .NCAT_strategy import NCATs

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Computerized Adaptive Testing Package, including the following models and strate
* Bounded Ability Estimation Adaptive Testing (BECAT) strategy
* Bilevel Optimization-Based Computerized Adaptive Testing (BOBCAT) strategy
* Neural Computerized Adaptive Testing (NCAT) strategy

* Multidimensional Item Response Theory (MIRT)
* D-Optimality (D-opt) strategy
* Multivariate Kullback-Leibler Information (MKLI) strategy
Expand Down
6 changes: 6 additions & 0 deletions scripts/test.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@
"for strategy in strategies:\n",
" avg =[]\n",
" model = CAT.model.IRTModel(**config)\n",
" model = CAT.model.NCDModel(**config)\n",
" model.init_model(test_data)\n",
" if strategy.name == 'BOBCAT':\n",
" model.adaptest_load_BOBCAT(ckpt_path,bobcat_policy_path)\n",
Expand Down Expand Up @@ -277,12 +278,14 @@
" tmp[selected_questions[sid]] = real[sid][selected_questions[sid]]\n",
" S_sel[sid].append(tmp)\n",
" elif it == 1 and strategy.name == 'BECAT Strategy':\n",
" if it == 1 and strategy.name == 'BECAT Strategy':\n",
" for sid in range(test_data.num_students):\n",
" untested_questions = np.array(list(test_data.untested[sid]))\n",
" random_index = random.randint(0, len(untested_questions)-1)\n",
" selected_questions[sid] = untested_questions[random_index]\n",
" S_sel[sid].append(untested_questions[random_index])\n",
" elif strategy.name == 'BECAT Strategy': \n",
" elif strategy.name == 'BECAT Strategy': \n",
" selected_questions = strategy.adaptest_select(model, test_data,S_sel)\n",
" for sid in range(test_data.num_students):\n",
" S_sel[sid].append(selected_questions[sid])\n",
Expand All @@ -291,6 +294,9 @@
" \n",
" for student, question in selected_questions.items():\n",
" test_data.apply_selection(student, question) \n",
" for student, question in selected_questions.items():\n",
" test_data.apply_selection(student, question)\n",
" \n",
" # update models\n",
" model.adaptest_update(test_data)\n",
" # evaluate models\n",
Expand Down

0 comments on commit 6df3983

Please sign in to comment.