forked from bigdata-ustc/EduCAT
-
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.
- Loading branch information
Showing
5 changed files
with
57 additions
and
30 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
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
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,31 @@ | ||
import numpy as np | ||
|
||
from CAT.strategy.abstract_strategy import AbstractStrategy | ||
from CAT.model import AbstractModel | ||
from CAT.dataset import AdapTestDataset | ||
|
||
|
||
class MFIStrategy(AbstractStrategy): | ||
|
||
def __init__(self): | ||
super().__init__() | ||
|
||
@property | ||
def name(self): | ||
return 'Maximum Fisher Information Strategy' | ||
|
||
def adaptest_select(self, model: AbstractModel, adaptest_data: AdapTestDataset): | ||
assert hasattr(model, 'get_theta'), \ | ||
'the models must implement get_theta method' | ||
assert hasattr(model, 'get_iif'), \ | ||
'the models must implement get_iif method' | ||
selection = {} | ||
for sid in range(adaptest_data.num_students): | ||
theta = model.get_theta(sid) | ||
untested_questions = np.array(list(adaptest_data.untested[sid])) | ||
untested_iif = [] | ||
for qid in untested_questions: | ||
untested_iif.append(model.get_iif(sid, qid)) | ||
j = np.argmax(untested_iif) | ||
selection[sid] = untested_questions[j] | ||
return selection |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from .abstract_strategy import AbstractStrategy | ||
from .random_strategy import RandomStrategy | ||
from .random_strategy import RandomStrategy | ||
from .MFI_strategy import MFIStrategy |
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