Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/lazyprogrammer/machine_learning_examples
/ score
Method
score
supervised_class/bayes.py:32–34 ·
view source on GitHub ↗
(self, X, Y)
Source
from the content-addressed store, hash-verified
30
self.priors[c] = float(len(Y[Y == c])) / len(Y)
31
32
def
score(self, X, Y):
33
P = self.predict(X)
34
return
np.mean(P == Y)
35
36
def
predict(self, X):
37
N, D = X.shape
Callers
1
bayes.py
File · 0.45
Calls
1
predict
Method · 0.95
Tested by
no test coverage detected