Make correlation history tracking optional
@@ -37,12 +37,14 @@ class Correlation(Metric):
if isinstance(labels, np.ndarray):
labels = labels.tolist()
+ if hasattr(self, '_per_batch_history'):
batch_corr = self._correlation(labels, predictions)
self._per_batch_history.append(batch_corr)
self._predictions += predictions
self._labels += labels
+ if hasattr(self, '_history'):
corr = self._correlation(self._labels, self._predictions)
self._history.append(corr)
