-
Notifications
You must be signed in to change notification settings - Fork 473
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
[fix] Calculate major frequency percentage properly #1264
Conversation
Model Benchmark
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice job in improving readability
""" | ||
dominant_frequencies = [freq for freq in frequencies if freq in filter_list] | ||
dominant_distribution = [distribution[np.where(frequencies == freq)] for freq in dominant_frequencies] | ||
return sum(dominant_distribution) / sum(distribution) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@noxan Can we ensure that we never divide by zero? I am not too deep into this function, but thought we should think abou it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would mean the dataset is empty
Fix for #1233