fixes for clarity

This commit is contained in:
Josh Burman 2021-11-24 16:24:14 +00:00
parent da17748103
commit 19f6f35856
6 changed files with 18 additions and 4 deletions

View File

@ -9,10 +9,9 @@ def build_constraints(solver_run, problem, items):
min = constraint.minimum
max = constraint.maximum
con = dict(zip([item.id for item in solver_run.items],
con = dict(zip([item.id for item in solver_run.items],
[item.attribute_exists(attribute)
for item in solver_run.items]))
# print([con[item.id] * items[item.id] for item in solver_items])
problem += lpSum([con[item.id]
* items[item.id]
for item in solver_run.items]) >= round(total_form_items * (min / 100)), f'{attribute.id} - {attribute.value} - min'
@ -20,4 +19,4 @@ def build_constraints(solver_run, problem, items):
* items[item.id]
for item in solver_run.items]) <= round(total_form_items * (max / 100)), f'{attribute.id} - {attribute.value} - max'
return problem
return problem

View File

@ -4,6 +4,9 @@ class ItemInformationFunction():
def __init__(self, irt_model):
self.model_data = irt_model
# determines the amount of information for a given question at a given theta (ability level)
# further detailed on page 161, equation 4 here:
# https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5978482/pdf/10.1177_0146621615613308.pdf
def calculate(self, **kwargs):
if self.model_data.model == '3PL':
p = ThreeParameterLogistic(self.model_data, kwargs).result()

View File

@ -6,6 +6,10 @@ class ThreeParameterLogistic:
self.e = 2.71828
self.theta = kwargs['theta']
# contains the primary 3pl function, determining the probably of an inidividual
# that an individual at a certain theta would get a particular question correct
# detailed further on page 161, equation 1 here:
# https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5978482/pdf/10.1177_0146621615613308.pdf
def result(self):
a = self.model_params.a_param
c = self.model_params.c_param

View File

@ -5,6 +5,10 @@ class TestInformationFunction():
self.irt_model = irt_model
self.iif = ItemInformationFunction(irt_model)
# determins the amount of information
# at a certain theta (ability level) of the sum of a question set correct
# detailed further on page 166, equation 4 here:
# https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5978482/pdf/10.1177_0146621615613308.pdf
def calculate(self, items, **kwargs):
sum = 0

View File

@ -6,6 +6,10 @@ class TestResponseFunction():
self.irt_model = irt_model
self.irf = ItemResponseFunction(irt_model)
# determins the probably of an inidividual
# at a certain theta (ability level) would get a sum of questions correct
# detailed further on page 166, equation 3 here:
# https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5978482/pdf/10.1177_0146621615613308.pdf
def calculate(self, items, **kwargs):
sum = 0

View File

@ -1,6 +1,6 @@
import os, json, random, io, logging
from pulp import *
from pulp import LpProblem, LpVariable, LpMinimize, LpStatus, lpSum
from helpers import aws_helper, tar_helper, csv_helper, service_helper, solver_helper