Skip to content

Instantly share code, notes, and snippets.

@jamescalam
Created January 12, 2020 11:39
Show Gist options
  • Save jamescalam/6a6c89e58a3998e553f2a01377e3aa83 to your computer and use it in GitHub Desktop.
Save jamescalam/6a6c89e58a3998e553f2a01377e3aa83 to your computer and use it in GitHub Desktop.
Example code snippet for Naive Bayes fundamentals article, part [3]
def mean(x):
return sum(x) / len(x) # calculate mean (in reality use np.mean(x))
less_mean = mean(less)
more_mean = mean(more) # calculate mean for both models
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment