'Predict class for X.
The predicted class of an input sample is a vote by the trees in
the forest, weighted by their probability estimates. That is,
the predicted class is the one with highest mean probability
estimate across the trees.
Parameters
X : array-like or sparse matrix of shape = [n_samples, n_features]
The input samples. Internally, its dtype will be converted to
``dtype=np.float32``. If a sparse matrix is provided, it will be
converted into a sparse ``csr_matrix``.
Returns
y : array of shape = [n_samples] or [n_samples, n_outputs]
The predicted classes.'

def predict(self, X):

    proba = self.predict_proba(X)
    if (self.n_outputs_ == 1):
        return self.classes_.take(np.argmax(proba, axis=1), axis=0)
    else:
        n_samples = proba[0].shape[0]
        predictions = np.zeros((n_samples, self.n_outputs_))
        for k in range(self.n_outputs_):
            predictions[:, k] = self.classes_[k].take(np.argmax(proba[k], axis=1), axis=0)
        return predictions
