add b param to irt model
This commit is contained in:
parent
ebccd9522a
commit
b2c3f0df79
@ -2,7 +2,7 @@ import csv
|
|||||||
import io
|
import io
|
||||||
import re
|
import re
|
||||||
|
|
||||||
def items_csv_to_dict(items_csv_reader):
|
def items_csv_to_dict(items_csv_reader, irt_model):
|
||||||
items = []
|
items = []
|
||||||
headers = []
|
headers = []
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ def items_csv_to_dict(items_csv_reader):
|
|||||||
for key, col in enumerate(headers):
|
for key, col in enumerate(headers):
|
||||||
if key == 0:
|
if key == 0:
|
||||||
item[col] = row[key]
|
item[col] = row[key]
|
||||||
# b param
|
# b param - tmep fix! use irt model b param for proper reference
|
||||||
elif key == (1 - len(headers)):
|
elif key == (1 - len(headers)):
|
||||||
item['b_param'] = row[key]
|
item['b_param'] = row[key]
|
||||||
elif key > 1:
|
elif key > 1:
|
||||||
@ -25,7 +25,7 @@ def items_csv_to_dict(items_csv_reader):
|
|||||||
'value': row[key],
|
'value': row[key],
|
||||||
'type': 'metadata'
|
'type': 'metadata'
|
||||||
})
|
})
|
||||||
print(row(1 - len(headers)))
|
|
||||||
items.append(item)
|
items.append(item)
|
||||||
|
|
||||||
return items
|
return items
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
from models.attribute import Attribute
|
from models.attribute import Attribute
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
from typing import Dict
|
||||||
|
|
||||||
class IRTModel(BaseModel):
|
class IRTModel(BaseModel):
|
||||||
a_param: float
|
a_param: float
|
||||||
b_param: float
|
b_param: Dict = {"schema_bson_id": str, "field_bson_id": str}
|
||||||
c_param: float
|
c_param: float
|
||||||
model: str
|
model: str
|
||||||
|
@ -33,7 +33,7 @@ class LoftService(Base):
|
|||||||
items_csv_reader = csv_helper.file_stream_reader(items_csv)
|
items_csv_reader = csv_helper.file_stream_reader(items_csv)
|
||||||
|
|
||||||
# add items to attributes dict
|
# 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...')
|
logging.info('Processed Attributes...')
|
||||||
|
|
||||||
return attributes
|
return attributes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user