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