Created
July 18, 2022 14:03
-
-
Save neelindresh/8493888fa2fc90effcb4aa7d3812a06d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def validate(model,testx,testy): | |
prediction=model(testx) | |
prediction=torch.where(prediction>.5,1,0) | |
accu=accuracy_score(prediction.detach().numpy(),test_y.unsqueeze(1).detach().numpy()) | |
f1=f1_score(prediction.detach().numpy(),test_y.unsqueeze(1).detach().numpy()) | |
return {"accuracy":accu,"f1":f1} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment