MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / predict

Method predict

supervised_class2/adaboost.py:40–47  ·  view source on GitHub ↗
(self, X)

Source from the content-addressed store, hash-verified

38 self.alphas.append(alpha)
39
40 def predict(self, X):
41 # NOT like SKLearn API
42 # we want accuracy and exponential loss for plotting purposes
43 N, _ = X.shape
44 FX = np.zeros(N)
45 for alpha, tree in zip(self.alphas, self.models):
46 FX += alpha*tree.predict(X)
47 return np.sign(FX), FX
48
49 def score(self, X, Y):
50 # NOT like SKLearn API

Callers 6

scoreMethod · 0.95
rf_regression.pyFile · 0.45
knn_dt_demo.pyFile · 0.45
plot_decision_boundaryFunction · 0.45
fitMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected