(self, X=None)
| 85 | self.trees.append(Tree(criterion=self.criterion)) |
| 86 | |
| 87 | def _predict(self, X=None): |
| 88 | y_shape = np.unique(self.y).shape[0] |
| 89 | predictions = np.zeros((X.shape[0], y_shape)) |
| 90 | |
| 91 | for i in range(X.shape[0]): |
| 92 | row_pred = np.zeros(y_shape) |
| 93 | for tree in self.trees: |
| 94 | row_pred += tree.predict_row(X[i, :]) |
| 95 | |
| 96 | row_pred /= self.n_estimators |
| 97 | predictions[i, :] = row_pred |
| 98 | return predictions |
| 99 | |
| 100 | |
| 101 | class RandomForestRegressor(RandomForest): |
nothing calls this directly
no test coverage detected