-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Added variation coefficient #654
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
Added variation coefficient #654
Conversation
| """ | ||
| mean = np.mean(x) | ||
| if mean != 0: | ||
| return np.std(x) / np.mean(x) |
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.
You could save some computing time (even though not really needed) by using your already calculated mean here
| @set_property("fctype", "simple") | ||
| def variation_coefficient(x): | ||
| """ | ||
| Returns the variation coefficient of x |
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.
Could you include a short sentence on what the variant coefficient is (e.g. std / mean)?
|
Nice! Thanks for this PR! Just two very small comments |
…ime of variation coefficient by reusing precomputed mean
|
I completed the description and added your review on code. |
Added coefficient of variation to have a relative value for standard deviation.
variation_coefficient = np.std(X) / np.mean(X)
Main problem is that we cannot compute the variable when the mean is 0, I chose to return missing value in this case.