Skip to content

[MRG] FIX Use float64 instead of float. #5356

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

Merged
merged 1 commit into from
Oct 8, 2015

Conversation

raghavrv
Copy link
Member

@raghavrv raghavrv commented Oct 7, 2015

Attempting to fix #4914 (#5235)

Note: This fix is useful but does not fix #4914

Thanks to @giorgiop!!

@raghavrv raghavrv changed the title FIX Use float64 instead of float. [MRG] FIX Use float64 instead of float. Oct 7, 2015
@ogrisel
Copy link
Member

ogrisel commented Oct 7, 2015

LGTM. Let's wait for appveyor to complete.

@ogrisel
Copy link
Member

ogrisel commented Oct 7, 2015

Unfortunately it can still randomly fail even with this fix:

https://ci.appveyor.com/project/amueller/scikit-learn/build/1.0.1025/job/jliou8eykp4k911m

@raghavrv raghavrv force-pushed the ridge_appveyor_failure branch from 085f2c9 to 86be478 Compare October 7, 2015 15:11
@ogrisel
Copy link
Member

ogrisel commented Oct 8, 2015

So this is not fixing the original issue but it's a good practice to fix the precision level we expect from the input data and not rely on possibly platform specific defaults. Merging.

ogrisel added a commit that referenced this pull request Oct 8, 2015
[MRG] FIX Use float64 instead of float.
@ogrisel ogrisel merged commit ba3caf4 into scikit-learn:master Oct 8, 2015
@giorgiop
Copy link
Contributor

giorgiop commented Oct 8, 2015

If one would like to fix those over all sklearn, it's easy to find them.

git grep dtype=np.float,
sklearn/cluster/hierarchical.py:    inertia = np.empty(len(coord_row), dtype=np.float, order='C')
sklearn/cluster/hierarchical.py:        ini = np.empty(n_additions, dtype=np.float, order='C')
sklearn/linear_model/ridge.py:        X, y = check_X_y(X, y, ['csr', 'csc', 'coo'], dtype=np.float,
sklearn/preprocessing/data.py:                 dtype=np.float, sparse=True, handle_unknown='error'):

@raghavrv raghavrv deleted the ridge_appveyor_failure branch October 8, 2015 21:09
@raghavrv
Copy link
Member Author

raghavrv commented Oct 9, 2015

git grep "dtype=np.float[^36]" rather! And here's a PR for that - #5375

@giorgiop
Copy link
Contributor

giorgiop commented Oct 9, 2015

They are many more than I thought :)

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

Successfully merging this pull request may close these issues.

Random failure on sklearn.linear_model.tests.test_ridge:test_class_weight_vs_sample_weight under Windows
3 participants