Commit 941ec3b8d76a77b430987a829d6541b5e58d6f78
1 parent
def93cca24
Exists in
main
first
Showing 1 changed file with 28 additions and 0 deletions Side-by-side Diff
Main.py
View file @
941ec3b
1 | +from Prediction import Prediction | |
2 | +import numpy as np | |
3 | +import pandas as pd | |
4 | +import random | |
5 | +from sklearn.metrics import mean_squared_error | |
6 | +from sklearn.metrics import mean_absolute_error | |
7 | +from sklearn.metrics import median_absolute_error | |
8 | +from math import sqrt | |
9 | + | |
10 | +#Prediction of complexity level (the number of levels is variable) | |
11 | +#Each row is a complexity level, each pair [,] is the note and the time for a question (test with 3 levels) | |
12 | + | |
13 | +dataI=pd.read_csv('dataInitial.csv', sep=' ', header=0) | |
14 | +data=pd.read_csv('data.csv', sep=' ', header=0) | |
15 | +v1=[] | |
16 | +v2=[] | |
17 | +n=0 | |
18 | +#for name,dr in dataI.iterrows(): | |
19 | +for i in range(1): | |
20 | + | |
21 | + #initialization of Beta distribution for all the complexity levels (test with 5 levels) | |
22 | + betap=[[1,1],[1,2],[1,3],[1,4],[1,5]] | |
23 | + | |
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 | |
25 | + pred=Prediction(dataI.iloc[i,:], data.iloc[i,:], betap, 0.2, 1/16, 6) | |
26 | + pred.CalculateGradePenalization() | |
27 | + pred.Calculate() | |
28 | + pred.CalculateSW() |