scikit-learn/scikit-learn — pull request #2745 by arjoly (2014-01-13 17:53:53+00:00)
Title: Optimize mean square criterion

The mse criterion could be simplified and optimized. The main idea is to avoid an online algorithm to compute the mean.

The speedup is particularly good with binary input features (because we have to made many call to the update method) as in the following script.
``` python
from __future__ import division, print_function
from functools import partial
from timeit import timeit
import numpy as np
from sklearn.tree import DecisionTreeRegressor

np.random.seed(0)
X = np.random.randint(0, 2, size=(10000, 500))
y = np.random.uniform(size=(10000, 50))
estimator = DecisionTreeRegressor(random_state=0)
chrono = timeit(partial(estimator.fit, X=X, y=y), number=1)
print("chrono = {}".format(chrono))
```

The results are on my box
```
this branch = 9.73273801804 s
master = 17.0945119858 s
```