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

7.3代码错误 #9

Open
3000ye opened this issue Aug 12, 2023 · 0 comments
Open

7.3代码错误 #9

3000ye opened this issue Aug 12, 2023 · 0 comments

Comments

@3000ye
Copy link

3000ye commented Aug 12, 2023

不知道是否为版本问题,7.3中的39、40行代码需要改成下面这样才能运行:

# 计算正样本中,该属性每个取值的数量,并且加1,即拉普拉斯平滑
xi1_value_count = pd.value_counts(xi1).reindex(unique_value, fill_value=0) + 1
# 计算反样本中,该属性每个取值的数量,并且加1,即拉普拉斯平滑
xi0_value_count = pd.value_counts(xi0).reindex(unique_value, fill_value=0) + 1

附上我的pandas版本:2.0.3

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