Commit d3cb929b64e6c1f7a17f0bac8841d0e37cf41a07

Authored by dsotofor
1 parent 522cc08fe8
Exists in main

change in Beta initialization

Showing 1 changed file with 2 additions and 2 deletions Inline Diff

from Prediction import Prediction 1 1 from Prediction import Prediction
import numpy as np 2 2 import numpy as np
import pandas as pd 3 3 import pandas as pd
import random 4 4 import random
from sklearn.metrics import mean_squared_error 5 5 from sklearn.metrics import mean_squared_error
from sklearn.metrics import mean_absolute_error 6 6 from sklearn.metrics import mean_absolute_error
from sklearn.metrics import median_absolute_error 7 7 from sklearn.metrics import median_absolute_error
from math import sqrt 8 8 from math import sqrt
9 9
#Prediction of complexity level (the number of levels is variable) 10 10 #Prediction of complexity level (the number of levels is variable)
#Each row is a complexity level, each pair [,] is the note and the time for a question (test with 3 levels) 11 11 #Each row is a complexity level, each pair [,] is the note and the time for a question (test with 3 levels)
12 12
dataI=pd.read_csv('dataInitial.csv', sep=' ', header=0) 13 13 dataI=pd.read_csv('dataInitial.csv', sep=' ', header=0)
data=pd.read_csv('data.csv', sep=' ', header=0) 14 14 data=pd.read_csv('data.csv', sep=' ', header=0)
v1=[] 15 15 v1=[]
v2=[] 16 16 v2=[]
n=0 17 17 n=0
#for name,dr in dataI.iterrows(): 18 18 #for name,dr in dataI.iterrows():
for i in range(1): 19 19 for i in range(1):
20 20
#initialization of Beta distribution for all the complexity levels (test with 5 levels) 21 21 #initialization of Beta distribution for all the complexity levels (test with 5 levels)
betap=[[1,1],[1,2],[1,3],[1,4],[1,5]] 22 22 betap=[[2,1],[1,2],[1,3],[1,4],[1,5]]
23 23
#Parameters: previous grades and times, a-priori paameters for beta distribution in each complexity level, step for change beta parameters, value of penalization for time and value of limit between win and loss 24 24 #Parameters: previous grades and times, a-priori paameters for beta distribution in each complexity level, step for change beta parameters, value of penalization for time and value of limit between win and loss
pred=Prediction(dataI.iloc[i,:], data.iloc[i,:], betap, 0.2, 1/16, 6) 25 25 pred=Prediction(dataI.iloc[i,:], data.iloc[i,:], betap, 0.2, 1/16, 6)