Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<Discuss>How does BIC score calculate? #1705

Open
xy-whu opened this issue Nov 18, 2023 · 0 comments
Open

<Discuss>How does BIC score calculate? #1705

xy-whu opened this issue Nov 18, 2023 · 0 comments

Comments

@xy-whu
Copy link

xy-whu commented Nov 18, 2023

Subject of the issue

I just want to know how the BIC score really calculates. So i tried to use pgmpy to calculate the BIC score with an example dataset from a lecture. However, the results returned by pgmpy does not equal to the value provided in the lecture.

Your environment

  • pgmpy 0.1.24
  • Python 3.9.1
  • window 10

Steps to reproduce

import pandas as pd
import numpy as np
from pgmpy.models import BayesianNetwork
from pgmpy.estimators import BicScore
data={"M":[0,1,0,1,1,1,0,1,1,0,1,1],"C":[1,0,1,0,0,0,1,0,0,0,0,1]} 
data = pd.DataFrame(data)
ret=BicScore(data).score(BayesianNetwork([['M','C']]))
print(ret)

Expected behaviour

QQ图片20231118103159

According to the lecture, the BicScore value is -23.98
https://www.youtube.com/watch?v=QGRsmRgN0P8&t=236s

Actual behaviour

the BicScore value computed by pgmpy is -16.62903186274648

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant