MCPcopy Index your code
hub / github.com/rushter/MLAlgorithms / predict_row

Method predict_row

mla/ensemble/tree.py:193–200  ·  view source on GitHub ↗

Predict single row.

(self, row)

Source from the content-addressed store, hash-verified

191 )
192
193 def predict_row(self, row):
194 """Predict single row."""
195 if not self.is_terminal:
196 if row[self.column_index] < self.threshold:
197 return self.left_child.predict_row(row)
198 else:
199 return self.right_child.predict_row(row)
200 return self.outcome
201
202 def predict(self, X):
203 result = np.zeros(X.shape[0])

Callers 2

predictMethod · 0.95
_predictMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected