Predict single row.
(self, row)
| 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]) |