-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import pytest | ||
import tensorflow as tf | ||
import numpy as np | ||
from tf_mnist import model, x_test, y_test, ROC_curves | ||
|
||
def test_model_evaluation(): | ||
score = model.evaluate(x_test, y_test, verbose=0) | ||
assert score[1] > 0.90, "Accuracy should be higher than 90%" | ||
|
||
def test_predictions(): | ||
predictions = model.predict(x_test) | ||
assert predictions.shape[0] == len(x_test), "Prediction shape mismatch" | ||
|
||
def test_ROC_curves(): | ||
predictions = model.predict(x_test) | ||
FPR, TPR, AUC = ROC_curves(y_test, predictions, 10) | ||
assert len(FPR) == 10, "FPR length mismatch" | ||
assert len(TPR) == 10, "TPR length mismatch" | ||
assert len(AUC) == 10, "AUC length mismatch" |