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

Skip to content

Incorrect documentation on scaling sparse data #7293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nlathia opened this issue Aug 30, 2016 · 2 comments
Closed

Incorrect documentation on scaling sparse data #7293

nlathia opened this issue Aug 30, 2016 · 2 comments
Milestone

Comments

@nlathia
Copy link

nlathia commented Aug 30, 2016

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')

@amueller
Copy link
Member

It was renamed to "with_mean". Can you fix that?

@amueller amueller added this to the 0.18 milestone Aug 30, 2016
@ogrisel
Copy link
Member

ogrisel commented Aug 31, 2016

Done in c931bf0, thanks for the report @nlathia.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants