A set of type stubs for popular Python packages. These are works in progress from the Microsoft Python team and others, with the intent that they are contributed to typeshed or to the associated packages once sufficiently complete.
MIT License
252
stars
99
forks
source link
Add overload function for sklearn to deal with sparse matrices #316
Got in the situation where I used some rescaling with StandardScaler and numpy arrays, and pylance kept saying me that the output was possibly a sparse matrix.
I added overload for functions and classes in sklearn/preprocessing/_data.pyi to indicate that the output of those functions is only sparse when the input is itself sparse (up to some details, depending on the functions).
Got in the situation where I used some rescaling with
StandardScaler
and numpy arrays, and pylance kept saying me that the output was possibly a sparse matrix.I added overload for functions and classes in sklearn/preprocessing/_data.pyi to indicate that the output of those functions is only sparse when the input is itself sparse (up to some details, depending on the functions).