Accenture Interview Question

write a code for calculating f1 score without using sklearn library.