Closed priamai closed 8 months ago
Hi @priamai Your data's dtype is object
. Could you please convert it to numerics, e.g., data = data.astype(float)
, and try it again?
It is an array of float and booleans as you can see from my code. If I convert also the booleans to float, then it will assume is not categorical I think.
Generally, mixed-type data is not well supported yet in causal-learn. You may try to use Tetrad java or py-Tetrad implementations. See https://github.com/py-why/causal-learn/issues/31 and https://github.com/py-why/causal-learn/issues/43.
Specifically in your case, since there are only two categories (boolean), converting them to floats (0, 1) will not be an issue, and all the CI estimation results will hold the same.
In either way, setting your array's whole data type as object
is not a good idea here. Your may try ints and floats at different columns.
Hello Mark, oh that is a very relevant discussion, thanks for the hard work, I will start to learn py-tetrad as well. I converted to float as suggested, I am getting some runtime warnings as below:
I am not sure what are double scalars.
This seems to be a division by zero warning. Could you have a look at the raw data and check whether there are constant variables (e.g., some column is True
in all samples)?
Hello, you are damn right, some of the variables are static so I should remove them.
IMPRESSIONS 378
CLICKS 313
CONVERSIONS 62
AD_SPEND_USD 375
IS_MARKETING 1
REVENUE_USD 411
NUM_ORDERS 92
AOV_USD 409
IS_REVENUE 1
VISITORS 388
SESSIONS 431
IS_TRAFFIC 1
IS_WEEKEND 2
IS_CAMPAIGN 2
Hi there, this is my dataset, I just show a small sample of it (there are no Nans):
There are no NANS:
But when I run:
Error: