add b param to irt model
This commit is contained in:
parent
ebccd9522a
commit
b2c3f0df79
app
@ -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
|
||||
|
@ -1,5 +1,4 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
|
||||
from models.attribute import Attribute
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user