Article Outline
Python pil example 'f1'
python f1
Python pil example: f1
tp = total - fp - fn
beta = 10
f1_score = float(((1 + beta**2) * tp)) / ((1 + beta**2)*tp + beta**2 * fn + fp)
if(1 - f1_score < min):
min = 1 - f1_score
#print(the min state)
print(state)
return {
'loss': 1-f1_score,
'status': STATUS_OK,
'eval_time':time.time()
}
Python links
- Learn Python: https://pythonbasics.org/
- Python Tutorial: https://pythonprogramminglanguage.com