Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024.1.12 Add new CAT Strategy #10

Merged
merged 12 commits into from
Jan 15, 2024
Prev Previous commit
Next Next commit
Merge branch 'master' into master
  • Loading branch information
Hhhhhhand authored Jan 13, 2024
commit 6df39833e0b3aa934360d759375de2880f424c86
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
You are viewing a condensed version of this merge commit. You can view the full changes here.