Closed rebeccaherman1 closed 8 months ago
Can you propose a patch?
@jakobrunge please let me know if you'd like me to propose this separately in the development branch as well
Solved in master now.
@jakobrunge Now it seems that the stored observation_array
after fitting a causal_effects
instance is stored so that the 0-th axis is the vector and the 1st axis is time, which seems backwards. I notice a lot of transposes in the code for Transform the data if needed
in get_general_fitted_model
. I don't know why all of it is there. Are we sure those transposes are meant to be there?
I'm sorry I did not look into the code in other places more thoroughly before.
On second thought, it does actually look like you are accessing the array assuming that the 0th axis moves over different variables rather than the first. So, maybe there's no problem here. Just seems un-intuitive to me, and it also seems to require lots of additional code logic that may have contributed to making the original bug more likely to happen.
I'm getting a broadcasting error when I add
data_transform=sklearn.preprocessing.StandardScaler()
tofit_total_effect
andtransform_interventions_and_prediction=True
topredict_total_effect
. It appears that the call toreshape(-1,1)
is putting the number of features on the 0th axis and the number of samples on the first, which is reversed compared to the documentation in sklearn. I think perhaps it should be removed or replaced withreshape(1,-1)
.https://github.com/jakobrunge/tigramite/blob/a409b37d3d290ec99c5c62ab6417a7ba18421329/tigramite/models.py#L335C96-L335C111