<jupyter_start><jupyter_text>Test Images<jupyter_code>model = load_model('model_adv.h5')
import os
train_generator.class_indices
y_actual = []
y_test = []
for i in os.listdir("./CovidDataset/Val/Normal/"):
  img = image.load_img("./CovidDataset/Val/Normal/"+i, target_size=(224,224))
  img = image.img_to_array(img)
  img = np.expand_dims(img, axis=0)
  p = model.predict_classes(img)
  y_test.append(p[0,0])
  y_actual.append(1)
for i in os.listdir("./CovidDataset/Val/Covid/"):
  img = image.load_img("./CovidDataset/Val/Covid/"+i, target_size=(224,224))
  img = image.img_to_array(img)
  img = np.expand_dims(img, axis=0)
  p = model.predict_classes(img)
  y_test.append(p[0,0])
  y_actual.append(0)
y_actual = np.array(y_actual)
y_test = np.array(y_test)
from sklearn.metrics import confusion_matrix
cm = confusion_matrix(y_actual, y_test)
import seaborn as sns
sns.heatmap(cm, cmap="plasma", annot=True)<jupyter_output><empty_output><jupyter_text>**True Positives:** All people having Covid-19 (30), have been correctly classified.**False Negatives:** Patients that were positive but were classified as negative, we get a zero (0) in this column, indicating that our classifier did a good job in classifying patients who actually had COVID-19.**True negatives:** Patients which were normal and were classified as normal, we get a value of 28 in this cell, indicating our classifier correctly diagnosed 28/30 people who didn't have COVID-19 as normal.False Positives: Two normal patients were falsely classified as COVID +ve by our classifier.;-; A good classifier in this case, satisfies two parameters:*   True positive and true negative should be high*   False positive and false negative should be close to zero.Our classifier does well on both these fronts and hence I am satisfied with its overall performance.<jupyter_code><jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10675965665236052, 'fraction_numerical': 0.019313304721030045, 'mean_word_length': 5.566901408450704, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '551766', 'license': 'MIT', 'n_tokens_mistral': 623, 'n_tokens_neox': 596, 'n_words': 189, 'path': 'Covid_19_Prediction_from_X_Ray.ipynb', 'repo_name': 'anmolpant/Detecting-COVID-19-from-X-Ray', 'size': '1864'}