Here you should add something like:

<pre>
if self.copy:
   X = X - self.mean_
</pre>

as if X hasn't been modified in-place, it need to be centered.