+ 1
Welcome to the matrix
Anyone help me with this code. It's passing all test cases except last one. https://code.sololearn.com/cKw6xLFhLpj6/?ref=app
6 Respostas
+ 7
Akhil Techie
Your program is correct. You just need to do some changes...I hope you will understand where was the problem.
https://code.sololearn.com/cA0a10A6A9A1/?ref=app
+ 6
ANS :
tp, fp, fn, tn = [int(x) for x in input().split()]
ac = (tp + tn) / (tp+fp+fn+tn)
pr = tp / (tp + fp)
re = tp / (tp + fn)
f1 = (2 * pr * re) / (pr + re)
output = [ac, pr, re, f1]
for i in output:
print(round(i, 4))
+ 1
I Am AJ ! Got it thank you ☺️
0
first of all u try.
tp, fp, fn, tn = [int(x) for x in input().split()]
ac = (tp + tn) / (tp+fp+fn+tn)
pr = tp / (tp + fp)
re = tp / (tp + fn)
f1 = (2 * pr * re) / (pr + re)
output = [ac, pr, re, f1]
for i in output:
print(round(i, 4))
0
IT WORKS 100%
tp, fp, fn, tn = [int(x) for x in input().split()]
precision = tp/(tp+fp)
recall = tp/(tp+fn)
f1 = 2*((precision*recall)/(precision+recall))
print(round((tp+tn)/(tp+fn+tn+fp),4))
print(round((precision),4))
print(round((recall),4))
print(round((f1),4))
- 1
Thank you for your code, but I wanted to know why my code is not working with the format specifiers 😁😁