scikit-learn/scikit-learn — pull request #2255 by SnippyHolloW (2013-07-26 12:06:34+00:00)
Title: [MRG] Nudge images (to enhance small datasets)

This PR is just to do something that we did in examples/plot_rbm_logistic_classification.py e.g. at https://github.com/vene/scikit-learn/commit/f37668f148e4460d3eb6892313845f8975e6c95a , less readably but faster (maybe it could be even faster if we did not ask for n_samples but I guess this is convenient to have).

Should I check arrays (for inputs)?

Example:
```python
from sklearn.datasets.samples_generator import make_nudged_dataset
glider = np.array([
[0, 0, 1, 1, 0, 1, 0, 1, 1],
[1, 0, 0, 0, 1, 1, 1, 1, 0],
[0, 1, 0, 0, 0, 1, 1, 1, 1],
[1, 0, 1, 0, 1, 1, 0, 1, 0],
[0, 0, 1, 1, 0, 1, 0, 1, 1]])
X, y = make_nudged_dataset(glider, np.array([0 for i in
xrange(glider.shape[0])]),
images_shape=(3, 3))
print(X.shape)
```