Get Accuracy Method
Functions
get_accuracy(model, X, Y)
Calculate the accuracy of the model's predictions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model |
Sequential
|
The neural network model. |
required |
X |
ndarray
|
Input data, shape (n_features, n_samples). |
required |
Y |
ndarray
|
True labels in one-hot encoded format, shape (n_classes, n_samples). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
The accuracy of the model's predictions, as a value between 0 and 1. |
Example
Note
- This function assumes that the model's output and true labels are in one-hot encoded format.
- The accuracy is calculated as the ratio of correct predictions to total predictions.