title: Scikit-learn: overriding a class method in a classifier
body: <p>I am trying to override the predict_proba method of a classifier class. The easiest approach as far as I have <a href="http://lgiordani.com/blog/2014/05/19/method-overriding-in-python" rel="nofollow">seen</a> and if applicable is preprocessing the input to the base class method or postprocessing its output.</p>
  
  <pre><code>class RandomForestClassifierWrapper(RandomForestClassifier):
  
      def predict_proba(self, X):
          pre_process(X)
          ret = super(RandomForestClassifierWrapper, self).predict_proba(X)
          return post_process(ret)
  </code></pre>
  
  <p>However, what I want to do is copying a variable which is locally created in the base class method, processed and garbage-collected when the method returns. I am intending to process the intermediate result stored in this variable. Is there a straightforward way to do this without messing with the <a href="https://github.com/scikit-learn/scikit-learn/blob/bb39b49/sklearn/ensemble/forest.py#L478" rel="nofollow">base class internals</a>?</p>