3493897c7b0f2bee6f4b746d24d6b85377a08d6d,smac/smbo/rf_with_instances.py,RandomForestWithInstances,predict,#RandomForestWithInstances#Any#,114

Before Change


        else:
            // TODO: Use random forest data container for instances
            X_ = Xtest
            self.logger.warn("Instance feature support is not yet implemented.")
            //raise Exception("Not implemented!")

        mean = np.zeros(X_.shape[0])
        var = np.zeros(X_.shape[0])

After Change


        if self.instance_features is None or len(self.instance_features) == 0:
            X_ = Xtest
        else:
            nfeats = self.instance_features.shape[0]
            // TODO: Use random forest data container for instances
            X_ = np.hstack(
                (np.tile(Xtest, (nfeats, 1)), self.instance_features))

        mean = np.zeros(X_.shape[0])
        var = np.zeros(X_.shape[0])

        // TODO: Would be nice if the random forest supports batch predictions
        for i, x in enumerate(X_):
            mean[i], var[i] = self.rf.predict(x)

        mean = np.mean(mean)
        var = np.sum(var)  // TODO: is this correct?

        return mean, var
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: automl/SMAC3
Commit Name: 3493897c7b0f2bee6f4b746d24d6b85377a08d6d
Time: 2016-02-29
Author: lindauer@informatik.uni-freiburg.de
File Name: smac/smbo/rf_with_instances.py
Class Name: RandomForestWithInstances
Method Name: predict


Project Name: librosa/librosa
Commit Name: ed4b036702f46a57002b1fa946af84a9c822503e
Time: 2016-10-03
Author: brian.mcfee@nyu.edu
File Name: librosa/filters.py
Class Name:
Method Name: window_bandwidth


Project Name: pyannote/pyannote-audio
Commit Name: 87a1afc00f6700d1fc33f4bb7a803229987c645b
Time: 2017-05-15
Author: bredin@limsi.fr
File Name: pyannote/audio/embedding/segmentation.py
Class Name: Segmentation
Method Name: apply