<jupyter_start><jupyter_text>Test Images<jupyter_code>model_name = f'model_CNN_{audioType}_epochs_lr_new'
model = load_model('models/' + model_name + '.h5')
y_actual = []
y_test = []
for class_ in classes:
    class_path = os.path.join(test_path, class_)
    for i in os.listdir(class_path):
        img = image.load_img(os.path.join(class_path, 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])
        y_actual.append(train_generator.class_indices[class_])
y_actual = np.array(y_actual)
y_test = np.array(y_test)
cm = confusion_matrix(y_actual, y_test)
print(cm)
sns.heatmap(cm, cmap = 'plasma', annot = True, fmt = ".1f")
print('Accuracy: ', accuracy_score(y_actual, y_test))
print(classification_report(y_actual, y_test))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14074914869466515, 'fraction_numerical': 0.011350737797956867, 'mean_word_length': 4.919463087248322, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '309327', 'license': 'BSD-4-Clause-UC', 'n_tokens_mistral': 346, 'n_tokens_neox': 337, 'n_words': 54, 'path': 'model_cnn/COVID_CNN.ipynb', 'repo_name': 'nikhilkmr300/sop-covid', 'size': '881'}