Created
January 12, 2020 11:42
-
-
Save jamescalam/eb79cda53ff1a079a2671daccfc9805d to your computer and use it in GitHub Desktop.
Example code snippet for Naive Bayes fundamentals article, part [4]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def std(x, mu): | |
# calculate standard deviation (in reality np.std(x)) | |
return np.sqrt(sum(np.power(np.subtract(x, mu), 2)) / len(x)) | |
std_less = np.std(less, mean_less) | |
std_more = np.std(more, mean_more) # calculate standard deviation for both models |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment