working TCC (Test response funciton)
This commit is contained in:
@ -1,12 +1,17 @@
|
||||
from lib.irt.item_response_function import ItemResponseFunction
|
||||
|
||||
# otherwise known as the Test Characteristic Curve (TCC)
|
||||
class TestResponseFunction():
|
||||
def __init__(self, irf):
|
||||
self.irf = irf
|
||||
def __init__(self, irt_model):
|
||||
self.irt_model = irt_model
|
||||
self.irf = ItemResponseFunction(irt_model)
|
||||
|
||||
def calculate(self, items, **kwargs):
|
||||
result = 0
|
||||
sum = 0
|
||||
|
||||
for item in items:
|
||||
result += irf.calculate(b_param=item.b_param, theta=kwargs['theta'])
|
||||
result = self.irf.calculate(b_param=item.b_param, theta=kwargs['theta'])
|
||||
item.irf = result
|
||||
sum += item.irf
|
||||
|
||||
return result
|
||||
return sum
|
||||
|
Reference in New Issue
Block a user