Aifred-Health/VulcanAI

Run test single continuous breaks if only one value is predicted.

nirtiac opened this issue · 3 comments

Run test single continuous breaks if only one value is predicted.

I am having this same issue with the error of " setting an array element with a sequence. "

image

getting problem with VulcanAI/vulcanai/models/metrics.py
line 586: targets = np.array([v[1] for v in data_loader.dataset])

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

I found a way to solve this error. It turns out that when we really want to have a NumPy array containing both strings and floats, you could use the dtype object, which allows the array to hold arbitrary Python objects.

So, I did just a simple change and it works for me
VulcanAI/vulcanai/models/metrics.py
line 586: targets = np.array([v[1] for v in data_loader.dataset], dtype=object)

image

#203 In this pull request I have updated the code. Please have a look. Thank you.