lingam icon indicating copy to clipboard operation
lingam copied to clipboard

LiM runs into an exception when using the option only_global=False

Open phyk opened this issue 2 years ago • 3 comments

When using the LiM implementation, I run it on larger datasets and everything works, as long as I don't use the option only_global=False. Whenever it is set, I get the following message: ValueError: Unknown label type: continuous. Maybe you are trying to fit a classifier, which expects discrete classes on a regression target with continuous values. In case of running it on with only_global=True, everything works. I checked my data and from what I can see, I correctly define the discrete_indicator to contain all discrete features.

Can you help me out here?

phyk avatar Dec 15 '23 11:12 phyk

It looks like the error was from the local search procedure, especially from the calculation from the "_loss" function or the "_bic_scoring" function. Maybe you could debug the code to see if there is anything strange.

Thanks for your interest! If any problems, please let us know.

YanaZeng avatar Dec 16 '23 02:12 YanaZeng

I found the error on my end, i miscalculated the discrete_indicator array (indicating continuous instead of binary columns).

When investigating the issue another question arose: is the discrete_indicator field ignored in case the parameter only_global is set to True?

phyk avatar Dec 21 '23 11:12 phyk

In the case where the parameter only_global is set to True, the discrete_indicator field is used as well. It is used to compute the objective function. If you miscalculated the discrete_indicator array, the code can work but might not work well, I think.

YanaZeng avatar Dec 22 '23 13:12 YanaZeng