From b9692035a7bea5d1dcabea1a567f37262e6dec86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francesc=20Mart=C3=AD=20Escofet?= <154450563+FrancescMartiEscofetQC@users.noreply.github.com> Date: Mon, 6 May 2024 08:52:41 +0200 Subject: [PATCH] Fix error message in `CrossFitEstimator` (#58) --- metalearners/cross_fit_estimator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metalearners/cross_fit_estimator.py b/metalearners/cross_fit_estimator.py index e3bd0df..d475604 100644 --- a/metalearners/cross_fit_estimator.py +++ b/metalearners/cross_fit_estimator.py @@ -184,8 +184,8 @@ def _predict_in_sample( if len(X) != sum(len(fold) for fold in self._test_indices): raise ValueError( "Trying to predict in-sample on data that is unlike data encountered in training." - f"Training data included {len(self._test_indices)} observations while prediction " - f"data includes {len(X)} observations." + f"Training data included {sum(len(fold) for fold in self._test_indices)} " + f"observations while prediction data includes {len(X)} observations." ) n_outputs = self._n_outputs(method) predictions = self._initialize_prediction_tensor(