pgmpy icon indicating copy to clipboard operation
pgmpy copied to clipboard

Bayesian model value error

Open SakthiMahendran opened this issue 2 years ago • 6 comments

"Value Error: variable names in the model must be identical to the values in the columns of data" is raised though the names are identical

SakthiMahendran avatar May 13 '23 12:05 SakthiMahendran

IMG-20230513-WA0002.jpg

But the values are 100% Identical with the values in the CSV file.

I also tried it with the "ByassNetwork" class and it also throws the same error.

SakthiMahendran avatar May 13 '23 12:05 SakthiMahendran

@SakthiMahendran Thanks for reporting this. It's hard for me to guess why this is happening without looking at your code. Would it be possible to share it (or a minimal reproducible example)?

ankurankan avatar May 15 '23 09:05 ankurankan

@SakthiMahendran Thanks for reporting this. It's hard for me to guess why this is happening without looking at your code. Would it be possible to share it (or a minimal reproducible example)?

IMG-20230513-WA0001.jpg

Here is the code

SakthiMahendran avatar May 15 '23 10:05 SakthiMahendran

@SakthiMahendran Could you also share the first few lines of the heart.csv or the output of heartDisease.columns file? The error thrown in your case usually happens when the node names of your model doesn't exactly match the column names, so you could also double check that they match exactly using something like set(list(heartDisease.columns)) == set(list(Model.nodes()))

ankurankan avatar May 15 '23 12:05 ankurankan

@SakthiMahendran Could you also share the first few lines of the heart.csv or the output of heartDisease.columns file? The error thrown in your case usually happens when the node names of your model doesn't exactly match the column names, so you could also double check that they match exactly using something like set(list(heartDisease.columns)) == set(list(Model.nodes()))

Sorry for the delay I will check it in this weekend

SakthiMahendran avatar May 24 '23 11:05 SakthiMahendran

It seems that the result is false and I am not sure about it.

let me show this to the author of the code.

SakthiMahendran avatar May 28 '23 11:05 SakthiMahendran