01e68e64b745ebc5ef4a3b8c52e2ee9f3cac4cfb,mla/ensemble/random_forest.py,RandomForestRegressor,_predict,#RandomForestRegressor#Any#,70

Before Change


        predictions = np.zeros(X.shape[0])

        for i in range(X.shape[0]):
            row_pred = sum([tree.classify(X[i, :]) for tree in self.trees])
            row_pred /= self.n_estimators
            predictions[i] = row_pred
        return predictions

After Change



    def _predict(self, X=None):
        predictions = np.zeros((X.shape[0], self.n_estimators))
        for i, tree in enumerate(self.trees):
            predictions[:, i] = tree.predict(X)
        return predictions.mean(axis=1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: rushter/MLAlgorithms
Commit Name: 01e68e64b745ebc5ef4a3b8c52e2ee9f3cac4cfb
Time: 2016-10-17
Author: me@rushter.com
File Name: mla/ensemble/random_forest.py
Class Name: RandomForestRegressor
Method Name: _predict


Project Name: kengz/SLM-Lab
Commit Name: d670e94d3f8e938858e938b1d3efeac5389a26d3
Time: 2017-12-17
Author: lgraesser@users.noreply.github.com
File Name: slm_lab/experiment/control.py
Class Name: Session
Method Name: run_episode


Project Name: calico/basenji
Commit Name: c791c40c9781cfd445a5741ca289d40bd81713a4
Time: 2019-06-24
Author: drk@calicolabs.com
File Name: basenji/seqnn.py
Class Name: SeqNN
Method Name: build_model


Project Name: scikit-learn-contrib/DESlib
Commit Name: 8115a167b0f280a62aa0d5560709ab9790d96e15
Time: 2020-05-19
Author: rafaelmenelau@gmail.com
File Name: deslib/util/aggregation.py
Class Name:
Method Name: weighted_majority_voting_rule