UChicago-Computational-Content-Analysis / Readings-Responses-2024-Winter

1 stars 0 forks source link

Chi2 Divergence Error #60

Closed ana-yurt closed 10 months ago

ana-yurt commented 10 months ago

When I ran the Chi2 divergence in HW2 Ex 7, I got the error:

ValueError: For each axis slice, the sum of the observed frequencies must agree with the sum of the expected frequencies to a relative tolerance of 1e-08, but the percent differences are:
0.25315591948140564

Seems related to this issue: https://github.com/scipy/scipy/issues/14298. Looks like some normalization of the inputs is needed, but I am not sure how since we are passing two token lists—should we instead use probs arrays? Or should we instead use the other three divergence measures? Thanks!

ana-yurt commented 10 months ago

Sorry, I mistakenly created a new issue instead of commenting under the question issue.