|
4 | 4 | import matplotlib.pyplot as plt |
5 | 5 | from pydeepflow.activations import activation, activation_derivative |
6 | 6 | from pydeepflow.losses import get_loss_function, get_loss_derivative |
7 | | -from pydeepflow.metrics import precision_score, recall_score, f1_score, confusion_matrix,mean_absolute_error, mean_squared_error, r2_score |
| 7 | +from pydeepflow.metrics import precision_score, recall_score, f1_score, confusion_matrix,mean_absolute_error, mean_squared_error, r2_score, root_mean_squared_error |
8 | 8 | from pydeepflow.device import Device |
9 | 9 | from pydeepflow.regularization import Regularization |
10 | 10 | from pydeepflow.checkpoints import ModelCheckpoint |
@@ -817,7 +817,7 @@ def evaluate(self, X, y, metrics=['loss', 'accuracy']): |
817 | 817 | y (np.ndarray): The true labels for evaluation. |
818 | 818 | metrics (list, optional): A list of metrics to calculate. |
819 | 819 | Defaults to ['loss', 'accuracy']. |
820 | | - Available metrics: 'loss', 'accuracy', 'precision', 'recall', 'f1_score', 'confusion_matrix'. |
| 820 | + Available metrics: 'loss', 'accuracy', 'precision', 'recall', 'f1_score', 'confusion_matrix', 'root_mean_squared_error'. |
821 | 821 |
|
822 | 822 | Returns: |
823 | 823 | dict: A dictionary where keys are the metric names and values are the computed scores. |
@@ -856,6 +856,9 @@ def evaluate(self, X, y, metrics=['loss', 'accuracy']): |
856 | 856 | if 'r2_score' in metrics: |
857 | 857 | results['r2_score'] = r2_score(y, predictions) |
858 | 858 |
|
| 859 | + if 'root_mean_squared_error' in metrics: |
| 860 | + results['root_mean_squared_error'] = root_mean_squared_error(y, predictions) |
| 861 | + |
859 | 862 |
|
860 | 863 |
|
861 | 864 | return results |
@@ -1740,6 +1743,9 @@ def evaluate(self, X, y, metrics=['loss', 'accuracy']): |
1740 | 1743 |
|
1741 | 1744 | if 'r2_score' in metrics: |
1742 | 1745 | results['r2_score'] = r2_score(y, predictions) |
| 1746 | + |
| 1747 | + if 'root_mean_squared_error' in metrics: |
| 1748 | + results['root_mean_squared_error'] = root_mean_squared_error(y, predictions) |
1743 | 1749 |
|
1744 | 1750 | return results # Removed confusion_matrix for simplification/dependency reasons |
1745 | 1751 |
|
|
0 commit comments