add b param to irt model

This commit is contained in:
Josh Burman 2021-11-30 21:12:08 +00:00
parent ebccd9522a
commit b2c3f0df79
4 changed files with 6 additions and 6 deletions

View File

@ -2,7 +2,7 @@ import csv
import io
import re
def items_csv_to_dict(items_csv_reader):
def items_csv_to_dict(items_csv_reader, irt_model):
items = []
headers = []
@ -16,7 +16,7 @@ def items_csv_to_dict(items_csv_reader):
for key, col in enumerate(headers):
if key == 0:
item[col] = row[key]
# b param
# b param - tmep fix! use irt model b param for proper reference
elif key == (1 - len(headers)):
item['b_param'] = row[key]
elif key > 1:
@ -25,7 +25,7 @@ def items_csv_to_dict(items_csv_reader):
'value': row[key],
'type': 'metadata'
})
print(row(1 - len(headers)))
items.append(item)
return items

View File

@ -1,5 +1,4 @@
from pydantic import BaseModel
from typing import Optional
from models.attribute import Attribute

View File

@ -1,7 +1,8 @@
from pydantic import BaseModel
from typing import Dict
class IRTModel(BaseModel):
a_param: float
b_param: float
b_param: Dict = {"schema_bson_id": str, "field_bson_id": str}
c_param: float
model: str

View File

@ -33,7 +33,7 @@ class LoftService(Base):
items_csv_reader = csv_helper.file_stream_reader(items_csv)
# add items to attributes dict
attributes['items'] = service_helper.items_csv_to_dict(items_csv_reader)
attributes['items'] = service_helper.items_csv_to_dict(items_csv_reader, attributes['irt_model'])
logging.info('Processed Attributes...')
return attributes