Commit a4e52106 authored by Bannier Delphine's avatar Bannier Delphine
Browse files

update evaluation

parent 61dd2e62
This diff is collapsed.
...@@ -41,11 +41,10 @@ def evaluate_mlp(model,df, trainAttrX, trainY,sc): ...@@ -41,11 +41,10 @@ def evaluate_mlp(model,df, trainAttrX, trainY,sc):
print("mean difference : {:.2f}%, std: {:.2f}%".format(mean, std)) print("mean difference : {:.2f}%, std: {:.2f}%".format(mean, std))
return preds return preds
def compute_score(y_true, y_pred): def compute_score(y_true, y_pred, sigma):
sigma = ( y_true - y_pred ) #########
fvc_pred = y_pred fvc_pred = y_pred
sigma_clip = np.maximum(sigma, 70) sigma_clip = np.maximum(sigma, 70)
delta = np.minimum(abs(y_true - fvc_pred),1000) delta = np.minimum(abs(y_true - fvc_pred),1000)
sq2 = math.sqrt(2) sq2 = math.sqrt(2)
metric = -(delta / sigma_clip)*sq2 - np.log(sigma_clip* sq2) metric = -(delta / sigma_clip)*sq2 - np.log(sigma_clip* sq2)
return (sigma, np.mean(metric)) return (np.mean(metric))
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment