dont round off the targets

This commit is contained in:
Adrian Manteza 2022-03-17 17:12:47 +00:00
parent d4729cf812
commit 05c5dc3856
3 changed files with 10 additions and 18 deletions

View File

@ -15,14 +15,10 @@ class Bundle(BaseModel):
type: str
def tif(self, irt_model: IRTModel, theta: float) -> float:
val = TestInformationFunction(irt_model).calculate(self.items, theta=theta)
return round(val, 2)
return TestInformationFunction(irt_model).calculate(self.items, theta=theta)
def trf(self, irt_model: IRTModel, theta: float) -> float:
val = TestResponseFunction(irt_model).calculate(self.items, theta=theta)
return round(val, 2)
return TestResponseFunction(irt_model).calculate(self.items, theta=theta)
def tif_trf_sum(self, solver_run):
return self.__trf_sum(solver_run) + self.__tif_sum(solver_run)

View File

@ -14,14 +14,10 @@ class Item(BaseModel):
b_param: float = 0.00
def iif(self, solver_run, theta):
val = ItemInformationFunction(solver_run.irt_model).calculate(b_param=self.b_param, theta=theta)
return round(val, 2)
return ItemInformationFunction(solver_run.irt_model).calculate(b_param=self.b_param, theta=theta)
def irf(self, solver_run, theta):
val = ItemResponseFunction(solver_run.irt_model).calculate(b_param=self.b_param, theta=theta)
return round(val, 2)
return ItemResponseFunction(solver_run.irt_model).calculate(b_param=self.b_param, theta=theta)
def get_attribute(self, ref_attribute):
for attribute in self.attributes:

View File

@ -8,15 +8,15 @@ class Target(BaseModel):
drift: float = 0.0
@classmethod
def max_drift(cls):
return 120 # let it drift...
def max_drift(cls) -> int:
return 15 # 15% elasticity, let it drift...
@classmethod
def max_drift_increment(cls):
return 10 # 10%
def max_drift_increment(cls) -> int:
return 1 # 10%
def minimum(self, drift_percent = 0.0) -> float:
return round(self.value - (self.value * drift_percent), 2)
return self.value - (self.value * drift_percent)
def maximum(self, drift_percent = 0.0) -> float:
return round(self.value + (self.value * drift_percent), 2)
return self.value + (self.value * drift_percent)