Issue 1:
We should extend the preprocessing.Scaler / preprocessing.scale utilities to feature-wise scale sparse matrices to unit scale without trying to center the data first. This work should be done in a consistent way with the RowNormalizer refactoring (re-use low level cython functions).

Issue 2:
Please help me with my installation.

I followed the guideline to install sklearn and numpy, but when I ran the nosetest, it kept showing the following testing message, and finally a failed message also cited below:

" nose.tools.assert_equal(filter_args(ff, ['y'], (1, )),"
.......................................................................
"Ran 1603 tests in 92.776s
FAILED (SKIP=14, failures=1) "

Because the nosetest log is messy, I tried to excerpt non-repetitive paragraph for your diagnosis.

I very appreciate your kind help.

Microsoft Windows [版本 6.1.7601]

Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Windows\system32>python -c "import sklearn; sklearn.test()"

Running unit tests and doctests for sklearn

NumPy version 1.7.0

NumPy is installed in C:\Python27\lib\site-packages\numpy

Python version 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)

]

nose version 1.2.1

I: Seeding RNGs with 369887653

Converged after 58 iterations.

...............................................................C:\Python27\lib\s

ite-packages\sklearn\manifold\spectral_embedding.py:225: UserWarning: Graph is n

ot fully connected, spectral embedding may not works as expected.

warnings.warn("Graph is not fully connected, spectral embedding"

..2.17927109077 55.4082834902

........None

.FFFFFFFFF.........S...............S............................................

..............S.........................................................S..F....

......................................SSS.......................C:\Python27\lib

site-packages\sklearn\externals\joblib\test\test_func_inspect.py:122: UserWarnin

g: Cannot inspect object <functools.partial object at 0x07500900>, ignore list w

ill not work.

nose.tools.assert_equal(filter_args(ff, ['y'], (1, )),

................................................................................

................................................................................

................................................................................

................................................................................

.............................___________________________________________________

test_memory setup

test_memory teardown

..._____________________________________________________________________________

[Memory] Calling sklearn.externals.joblib.test.test_hashing.KlassWithCachedMetho

d.f...

f({ '#s12069__c_maps.nii.gz': [33],

'#s12158__c_maps.nii.gz': [33],

'#s12258__c_maps.nii.gz': [33],

'#s12277__c_maps.nii.gz': [33],

'#s12300__c_maps.nii.gz': [33],

'#s12401__c_maps.nii.gz': [33],

'#s12430__c_maps.nii.gz': [33],

'#s13817__c_maps.nii.gz': [33],

'#s13903__c_maps.nii.gz': [33],

'#s13916__c_maps.nii.gz': [33],

'#s13981__c_maps.nii.gz': [33],

'#s13982__c_maps.nii.gz': [33],

'#s13983__c_maps.nii.gz': [33]})

________________________________________________________________f - 0.0s, 0.0min

._______________________________________________________________________________

_

[Memory] Calling sklearn.externals.joblib.test.test_hashing.KlassWithCachedMetho

d.f...

f(set([ '#s12069__c_maps.nii.gz',

'#s12158__c_maps.nii.gz',

'#s12258__c_maps.nii.gz',

'#s12277__c_maps.nii.gz',

'#s12300__c_maps.nii.gz',

'#s12401__c_maps.nii.gz',

'#s12430__c_maps.nii.gz',

'#s13817__c_maps.nii.gz',

'#s13903__c_maps.nii.gz',

'#s13916__c_maps.nii.gz',

'#s13981__c_maps.nii.gz',

'#s13982__c_maps.nii.gz',

'#s13983__c_maps.nii.gz']))

________________________________________________________________f - 0.0s, 0.0min

..______________________________________________________________________________

__

test_memory setup

.............[Memory] 0.0s, 0.0min: Loading sklearn.externals.joblib.test.tes

t_memory.f-alias from c:\users\navicat\appdata\local\temp\tmpydjb57\joblib\sklea

rn\externals\joblib\test\test_memory\f-alias\48c4a83e3726da917be80d0e1edc1be1

_____________________________________________f-alias cache loaded - 0.0s, 0.0min

...[Memory] 0.0s, 0.0min: Loading sklearn.externals.joblib.test.test_memory.f

-alias from c:\users\navicat\appdata\local\temp\tmpydjb57\joblib\sklearn\externa

ls\joblib\test\test_memory\f-alias\48c4a83e3726da917be80d0e1edc1be1

_____________________________________________f-alias cache loaded - 0.0s, 0.0min

................................................................................

........................________________________________________________________

test_memory teardown

._______________________________________________________________________________

_

setup numpy_pickle

.....................................C:\Python27\lib\site-packages\sklearn\exter

nals\joblib\test\test_numpy_pickle.py:197: Warning: file "c:\users\navicat\appda

ta\local\temp\tmpfsyive\test.pkl96" appears to be a zip, ignoring mmap_mode "r"

flag passed

numpy_pickle.load(this_filename, mmap_mode='r')

.....___________________________________________________________________________

teardown numpy_pickle

.............S......C:\Python27\lib\site-packages\sklearn\feature_selection\univ

ariate_selection.py:327: UserWarning: Duplicate scores. Result may depend on fea

ture ordering.There are probably duplicate features, or you used a classificatio

n score for a regression task.

warn("Duplicate scores. Result may depend on feature ordering."

...........C:\Python27\lib\site-packages\numpy\lib\utils.py:139: DeprecationWarn

ing: cs_graph_components is deprecated!

In the future, use csgraph.connected_components. Note that this new function has

a slightly different interface: see the docstring for more information.

warnings.warn(depdoc, DeprecationWarning)

C:\Python27\lib\site-packages\numpy\lib\utils.py:139: DeprecationWarning: cs_gr aph_components is deprecated!

In the future, use csgraph.connected_components. Note that this new function has

a slightly different interface: see the docstring for more information.

warnings.warn(depdoc, DeprecationWarning)

.C:\Python27\lib\site-packages\numpy\lib\utils.py:139: DeprecationWarning: cs_g raph_components is deprecated!

In the future, use csgraph.connected_components. Note that this new function has

a slightly different interface: see the docstring for more information.

warnings.warn(depdoc, DeprecationWarning)

C:\Python27\lib\site-packages\numpy\lib\utils.py:139: DeprecationWarning: cs_gr aph_components is deprecated!

In the future, use csgraph.connected_components. Note that this new function has

a slightly different interface: see the docstring for more information.

warnings.warn(depdoc, DeprecationWarning)

.C:\Python27\lib\site-packages\numpy\lib\utils.py:139: DeprecationWarning: cs_g raph_components is deprecated!

In the future, use csgraph.connected_components. Note that this new function has

a slightly different interface: see the docstring for more information.

warnings.warn(depdoc, DeprecationWarning)

C:\Python27\lib\site-packages\numpy\lib\utils.py:139: DeprecationWarning: cs_gr aph_components is deprecated!

In the future, use csgraph.connected_components. Note that this new function has

a slightly different interface: see the docstring for more information.

warnings.warn(depdoc, DeprecationWarning)

........................................................................C:\Pytho

n27\lib\site-packages\sklearn\feature_selection\univariate_selection.py:109: Run

timeWarning: invalid value encountered in divide

f = msb / msw

.......................F...............S...................C:\Python27\lib\site-

packages\sklearn\linear_model\least_angle.py:233: UserWarning: Regressors in act

ive set degenerate. Dropping a regressor, after 2 iterations, i.e. alpha=6.870e-

02, with an active set of 2 regressors, and the smallest cholesky pivot element

being 2.220e-16

% (n_iter, alpha, n_active, diag))

...---

................................................................................

...............................................................C:\Python27\lib\s

ite-packages\nose\util.py:14: DeprecationWarning: The compiler package is deprec

ated and removed in Python 3.x.

from compiler.consts import CO_GENERATOR

C:\Python27\lib\site-packages\nose\util.py:14: DeprecationWarning: The compiler

package is deprecated and removed in Python 3.x.

from compiler.consts import CO_GENERATOR

...........................C:\Python27\lib\site-packages\sklearn\linear_model\te

sts\test_sparse_coordinate_descent.py:104: UserWarning: With alpha=0, this algor

ithm does not converge well. You are advised to use the LinearRegression estimat

or

clf.fit(X, Y)

....C:\Python27\lib\site-packages\sklearn\linear_model\coordinate_descent.py:666

: UserWarning: precompute is ignored for sparse data

warnings.warn("precompute is ignored for sparse data")

C:\Python27\lib\site-packages\sklearn\linear_model\coordinate_descent.py:288: Us

erWarning: Objective did not converge for target 0, you might want to increase t

he number of iterations

' to increase the number of iterations')

....................C:\Python27\lib\site-packages\numpy\core_methods.py:57: Run

timeWarning: invalid value encountered in double_scalars

ret = ret / float(rcount)

............................................................................C:\P

ython27\lib\site-packages\sklearn\utils\extmath.py:244: RuntimeWarning: underflo

w encountered in exp

out = np.log(np.sum(np.exp(arr - vmax), axis=0))

C:\Python27\lib\site-packages\sklearn\mixture\dpgmm.py:42: RuntimeWarning: under

flow encountered in exp

v = np.exp(v - out)

..........................................C:\Python27\lib\site-packages\sklearn

mixture\gmm.py:307: RuntimeWarning: underflow encountered in exp

responsibilities = np.exp(lpr - logprob[:, np.newaxis])

..................................................F.......C:\Python27\lib\site-p

ackages\sklearn\utils__init__.py:71: DeprecationWarning: Class NuSVC is depreca

ted; to be removed in v0.14;

use sklearn.svm.NuSVC instead

warnings.warn(msg, category=DeprecationWarning)

.C:\Python27\lib\site-packages\sklearn\utils__init__.py:71: DeprecationWarning:

Class NuSVR is deprecated; to be removed in v0.14;

use sklearn.svm.NuSVR instead

warnings.warn(msg, category=DeprecationWarning)

.C:\Python27\lib\site-packages\sklearn\utils__init__.py:71: DeprecationWarning:

Class SVC is deprecated; to be removed in v0.14;

use sklearn.svm.SVC instead

warnings.warn(msg, category=DeprecationWarning)

.C:\Python27\lib\site-packages\sklearn\utils__init__.py:71: DeprecationWarning:

Class SVR is deprecated; to be removed in v0.14;

use sklearn.svm.SVR instead

warnings.warn(msg, category=DeprecationWarning)

.......................................

C:\Windows\system32>nosetests sklearn --exe

................................................................................

.............................................................C:\Python27\lib\sit

e-packages\sklearn\manifold\spectral_embedding.py:225: UserWarning: Graph is not

fully connected, spectral embedding may not works as expected.

warnings.warn("Graph is not fully connected, spectral embedding"

......C:\Python27\lib\site-packages\sklearn\manifold\spectral_embedding.py:225:

UserWarning: Graph is not fully connected, spectral embedding may not works as e

xpected.

warnings.warn("Graph is not fully connected, spectral embedding"

......................S........S.................S......S.......................

................................................................................

S.........S.....................................................................

......................................S....S....................................

.........................................SSS........................C:\Python27

lib\site-packages\sklearn\externals\joblib\test\test_func_inspect.py:122: UserWa

rning: Cannot inspect object <functools.partial object at 0x04A099C0>, ignore li

st will not work.

nose.tools.assert_equal(filter_args(ff, ['y'], (1, )),

....................................S.SS........................................

................................................................................

.......................C:\Python27\lib\site-packages\sklearn\externals\joblib\te

st\test_func_inspect.py:122: UserWarning: Cannot inspect object <functools.parti

al object at 0x04A099C0>, ignore list will not work.

nose.tools.assert_equal(filter_args(ff, ['y'], (1, )),

................................................................................

................................................................................

................................................................................

................................................................................

................................................................................

................................................................................

................................................................................

................................................................................

................................................................................

................................................................................

................................................................................

...........S..............S.....................................................

................................................................................

.........................................................................S...S..

................................................................................

................................................................................

................................................................................

................................................................................

................................................................................

................................................................................

................................................................................

................................................................................

..................................................................FF............

................................................................................

....................................................C:\Python27\lib\site-package

s\sklearn\manifold\spectral_embedding.py:225: UserWarning: Graph is not fully co

nnected, spectral embedding may not works as expected.

warnings.warn("Graph is not fully connected, spectral embedding"

................C:\Python27\lib\site-packages\sklearn\manifold\spectral_embeddin

g.py:225: UserWarning: Graph is not fully connected, spectral embedding may not

works as expected.

warnings.warn("Graph is not fully connected, spectral embedding"

...............S...............S.S................S.............................

.......................................................................S........

.....................S..........................................................

............................S...........S.......................................

..........................SSS......................C:\Python27\lib\site-packages

\sklearn\externals\joblib\test\test_func_inspect.py:122: UserWarning: Cannot ins

pect object <functools.partial object at 0x04A099C0>, ignore list will not work.

nose.tools.assert_equal(filter_args(ff, ['y'], (1, )),

................................................................................

................................................................................

................................................................................

................................................................................

.........................................................SSS....................

.....C:\Python27\lib\site-packages\sklearn\externals\joblib\test\test_func_inspe

ct.py:122: UserWarning: Cannot inspect object <functools.partial object at 0x04A

099C0>, ignore list will not work.

FAIL: Test the sparse LinearSVC with the iris dataset

Traceback (most recent call last):

File "C:\Python27\lib\site-packages\nose\case.py", line 197, in runTest

self.test(*self.arg)

File "C:\Python27\lib\site-packages\sklearn\svm\tests\test_sparse.py", line 17

3, in test_linearsvc_iris

clf.predict(iris.data.todense()), sp_clf.predict(iris.data))

File "C:\Python27\lib\site-packages\numpy\testing\utils.py", line 812, in asse

rt_array_almost_equal

header=('Arrays are not almost equal to %d decimals' % decimal))

File "C:\Python27\lib\site-packages\numpy\testing\utils.py", line 645, in asse

rt_array_compare

raise AssertionError(msg)

AssertionError:

Arrays are not almost equal to 6 decimals

(mismatch 0.666666666667%)

x: array([2, 1, 0, 2, 0, 2, 0, 1, 1, 1, 2, 1, 1, 1, 1, 0, 1, 1, 0, 0, 2, 1, 0,

0, 2, 0, 0, 1, 1, 0, 2, 2, 0, 2, 2, 1, 0, 2, 1, 1, 2, 0, 2, 0, 0, 1,

2, 2, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 0, 2, 1, 1, 1, 1, 2, 0,...

y: array([2, 1, 0, 2, 0, 2, 0, 1, 1, 1, 2, 1, 1, 1, 1, 0, 1, 1, 0, 0, 2, 1, 0,

0, 2, 0, 0, 1, 1, 0, 2, 2, 0, 2, 2, 1, 0, 2, 1, 1, 2, 0, 2, 0, 0, 1,

2, 2, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 0, 2, 1, 1, 1, 1, 2, 0,...

Ran 1603 tests in 92.776s

FAILED (SKIP=14, failures=1)

.........................S.................S....................................

.....C:\Python27\lib\site-packages\sklearn\manifold\spectral_embedding.py:225: U

serWarning: Graph is not fully connected, spectral embedding may not works as ex

pected.

warnings.warn("Graph is not fully connected, spectral embedding"

............................................................S...........S.......

.................S.............................................S................

....................................................S...........................

...........................SSS......................C:\Python27\lib\site-package

s\sklearn\externals\joblib\test\test_func_inspect.py:122: UserWarning: Cannot in

spect object <functools.partial object at 0x049F99C0>, ignore list will not work

.