Thanks for this wonderful library. I'm encountering an issue when trying to compute two intervals instead of one in the time series tutorial, but I might be wrong or missing something in my understanding.
Describe the bug
When attempting to compute two intervals instead of one by changing the alpha value from 0.05 to [0.1, 0.05] in the time series tutorial, a ValueError is raised. The error message indicates an issue with evaluating the truth value of an array in the conformity_scores.py file.
Replace the original alpha = 0.05 with alpha = [0.1, 0.05] on line 193 of the tutorial script.
Run the script.
See the error.
Expected behavior
The script should compute and return two prediction intervals without raising any errors.
Screenshots
N/A (the error message is provided below).
Desktop:
OS: Windows 10
IDE: PyCharm 2024.1 (Community Edition)
MAPIE Version: 0.8.6
Additional context
I tried to find out what is causing it and here are some of my findings:
In conformity_scores.py, the get_quantile function (line 213) receives an inconsistent formatting of alpha_np, sometimes receiving a simple NDArray and sometimes receiving an array of arrays.
Error traceback:
y_pred_enbpi_npfit, y_pis_enbpi_npfit = mapie_enbpi.predict(
File "C:\Users\pzaho\anaconda3\envs\dynamo\lib\site-packages\mapie\regression\time_series_regression.py", line 459, in predict
return super().predict(
File "C:\Users\pzaho\anaconda3\envs\dynamo\lib\site-packages\mapie\regression\regression.py", line 645, in predict
self.conformity_score_function_.get_bounds(
File "C:\Users\pzaho\anaconda3\envs\dynamo\lib\site-packages\mapie\conformity_scores\conformity_scores.py", line 454, in get_bounds
quantile_low = self.get_quantile(
File "C:\Users\pzaho\anaconda3\envs\dynamo\lib\site-packages\mapie\conformity_scores\conformity_scores.py", line 272, in get_quantile
quantile = signed * np.column_stack([
File "C:\Users\pzaho\anaconda3\envs\dynamo\lib\site-packages\mapie\conformity_scores\conformity_scores.py", line 276, in <listcomp>
) if not (unbounded and _alpha >= 1) else np.inf * np.ones(n_ref)
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Hello MAPIE team,
Thanks for this wonderful library. I'm encountering an issue when trying to compute two intervals instead of one in the time series tutorial, but I might be wrong or missing something in my understanding.
Describe the bug
When attempting to compute two intervals instead of one by changing the
alpha
value from0.05
to[0.1, 0.05]
in the time series tutorial, aValueError
is raised. The error message indicates an issue with evaluating the truth value of an array in theconformity_scores.py
file.To Reproduce
Steps to reproduce the behavior:
alpha = 0.05
withalpha = [0.1, 0.05]
on line 193 of the tutorial script.Expected behavior
The script should compute and return two prediction intervals without raising any errors.
Screenshots
N/A (the error message is provided below).
Desktop:
Additional context
I tried to find out what is causing it and here are some of my findings:
In conformity_scores.py, the get_quantile function (line 213) receives an inconsistent formatting of alpha_np, sometimes receiving a simple NDArray and sometimes receiving an array of arrays.
Error traceback: