the following code gives me the false positive rate and the false negative rate equal 0 and i need the true value of them and also i need the confusion matrix to be plotted
import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
import tensorflow_addons as tfa
import matplotlib.pyplot as plt
from sklearn.metrics import precision_score, recall_score, confusion_matrix
import time

num_classes = 2
input_shape = (1, 9)
learning_rate = 0.0001
weight_decay = 0.0001
batch_size = 128
num_epochs = 10
image_size = 72
patch_size = 6
num_patches = (image_size // patch_size) ** 2
projection_dim = 64
num_heads = 8
transformer_units = [
    projection_dim * 2,
    projection_dim,
]
transformer_layers = 4
mlp_head_units = [2048]

def mlp(x, hidden_units, dropout_rate):
    for units in hidden_units:
        x = layers.Dense(units, activation=keras.activations.gelu)(x)
        x = layers.Dropout(dropout_rate)(x)
    return x

def create_vit_classifier():
    inputs = keras.Input(shape=input_shape)
    encoded_patches = layers.Dense(units=64, activation=keras.activations.gelu)(inputs)
    for _ in range(transformer_layers):
        x1 = layers.LayerNormalization(epsilon=1e-6)(encoded_patches)
        attention_output = layers.MultiHeadAttention(num_heads=num_heads, key_dim=projection_dim, dropout=0.1)(x1, x1)
        x2 = layers.Add()([attention_output, encoded_patches])
        x3 = layers.LayerNormalization(epsilon=1e-6)(x2)
        x3 = mlp(x3, hidden_units=transformer_units, dropout_rate=0.1)
        encoded_patches = layers.Add()([x3, x2])
    representation = layers.LayerNormalization(epsilon=1e-6)(encoded_patches)
    representation = layers.Flatten()(representation)
    representation = layers.Dropout(0.5)(representation)
    features = mlp(representation, hidden_units=mlp_head_units, dropout_rate=0.5)
    logits = layers.Dense(num_classes)(features)
    model = keras.Model(inputs=inputs, outputs=logits)
    return model

def run_experiment(model):
    optimizer = tfa.optimizers.AdamW(learning_rate=learning_rate, weight_decay=weight_decay)
    model.compile(optimizer=optimizer,
                  loss=keras.losses.SparseCategoricalCrossentropy(from_logits=True),
                  metrics=[keras.metrics.SparseCategoricalAccuracy(name="accuracy")])

    checkpoint_filepath = "/tmp/checkpoint.weights.h5"
    checkpoint_callback = keras.callbacks.ModelCheckpoint(
        checkpoint_filepath,
        monitor="val_accuracy",
        save_best_only=True,
        save_weights_only=True,
    )

    start_time = time.time()  # Start the timer
    history = model.fit(
        np.expand_dims(x, axis=1),
        y,
        batch_size=batch_size,
        epochs=num_epochs,
        validation_split=0.2,
        callbacks=[checkpoint_callback],
    )
    end_time = time.time()  # Stop the timer

    model.load_weights(checkpoint_filepath)
    loss, accuracy = model.evaluate(np.expand_dims(x2, axis=1), y2)
    print(f"Test accuracy: {round(accuracy * 100, 2)}%")

    # Predictions and metrics calculation
    y_pred_logits = model.predict(np.expand_dims(x2, axis=1))
    y_pred = np.argmax(y_pred_logits, axis=-1)

    # Calculate precision, recall, confusion matrix
    precision = precision_score(y2, y_pred, average='macro')
    recall = recall_score(y2, y_pred, average='macro')
    cm = confusion_matrix(y2, y_pred)
    tn, fp, fn, tp = cm.ravel() if cm.size == 4 else (0, 0, 0, 0)

    fpr = fp / (fp + tn) if (fp + tn) > 0 else 0
    fnr = fn / (fn + tp) if (fn + tp) > 0 else 0

    print(f"Test precision: {precision:.2f}")
    print(f"Test recall: {recall:.2f}")
    print(f"False Positive Rate: {fpr:.2f}")
    print(f"False Negative Rate: {fnr:.2f}")
    print(f"Running time: {end_time - start_time:.2f} seconds")

    return history

vit_classifier = create_vit_classifier()
print("One finished")
history = run_experiment(vit_classifier)

def plot_history(item):
    plt.plot(history.history[item], label="train_" + item)
    plt.plot(history.history["val_" + item], label="val_" + item)
    plt.xlabel("Epochs")
    plt.ylabel(item)
    plt.title("Train and Validation {} Over Epochs".format(item), fontsize=14)
    plt.legend()
    plt.grid()
    plt.show()

plot_history("loss")