oguerrer / ppi

The model of Policy Priority Inference
MIT License
10 stars 5 forks source link

ppi.calibrate ValueError np.array has inhomogenous shape #4

Closed r-leyshon closed 1 year ago

r-leyshon commented 1 year ago

Hi Omar, thanks for sharing your codebase. I have been re-running the notebooks to reproduce and understand the work. I encounter an error in tutorials/02 - model calibration.ipynb. I suspect this may be caused by us using different versions of numpy (I am on numpy 1.24.1). Please note that I am re-running with the data as provided within the repository and the following setup:

joblib              1.2.0
matplotlib          3.5.0
numpy               1.24.1
pandas              1.5.2
session_info        1.0.0
-----
Python 3.9.12 (main, Jun  1 2022, 06:36:29) [Clang 12.0.0 ]
macOS-10.16-x86_64-i386-64bit
-----
Session information updated at 2023-02-24 07:30

The error resulting from ppi.calibrate():

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (10, 6) + inhomogeneous part.

Investigating the input parameter dimensions, I get the following:

oguerrer commented 1 year ago

Fixed it. The problem was that I was converting a tupple with several matrices of different sizes into an array, and that is not compatible anymore with newer versions of Numpy.