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