Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Incorrect documentation on scaling sparse data #7293

Closed
@nlathia

Description

@nlathia

Description

In Section 4.3.1.2. Scaling sparse data the docs suggest to scale sparse data by using with_centering=False:

[...] scale and StandardScaler can accept scipy.sparse matrices as input,
as long as with_centering=False is explicitly passed to the constructor. 

However, this param is no longer available (the closest relevant discussion that I could find is in #2514, which was closed as merged in #4828 and #4125) and, naturally, trying to use it will result in a TypeError in StandardScaler's __init__().

What is the correct way to do this now? Is this with_mean=False? I can submit a fix for the docs once this is confirmed.

Versions

Darwin-15.6.0-x86_64-i386-64bit
('Python', '2.7.12 |Anaconda custom (x86_64)| (default, Jul 2 2016, 17:43:17) \n[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)]')
('NumPy', '1.10.4')
('SciPy', '0.17.0')
('Scikit-Learn', '0.17.1')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions