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
Fix an issue with PCA not working with Float32 arrays #11
Fix an issue with PCA not working with Float32 arrays #11
Conversation
Those build failures seem to be due to issues in JSON.jl and not the PR. |
@@ -74,7 +74,7 @@ end | |||
|
|||
const default_pca_pratio = 0.99 | |||
|
|||
function check_pcaparams{T<:FloatingPoint}(d::Int, mean::Vector{T}, md::Int, pr::T) | |||
function check_pcaparams{T<:FloatingPoint}(d::Int, mean::Vector{T}, md::Int, pr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pr
should still retain FloatingPoint
type declaration (here and in the functions below)
Thanks for the comments! I've added more tests, removed convert and put FloatingPoint there. |
@maximsch2 Thanks. Could you please also update the declaration of |
b4500f9
to
ea1239c
Compare
Fixed & squashed. I've tried reproducing the error that travis gets, but I don't get it here. |
Added a fix for deprecated FloatingPoint in pca.jl as well. Tests pass locally for me, on 0.3 on Travis and 0.5-dev on Travis seems to be broken in an unrelated way. |
I believe the test failure on the nightlies was caused by JuliaLang/julia#13465 /cc @andreasnoack please have a look |
Wow. That is a lot of warnings, but I found the error, and it is indeed because of JuliaLang/julia#13465. I'll have to take another look at the deprecation logic. |
I believe JuliaLang/julia#13505 should fix this issue |
which is handled in #11. Also enable testing on 0.3 and 0.4.
which is handled in #11. Also enable testing on 0.3 and 0.4.
@maximsch2 Would you try to rebase your branch on top of master and push force to your fork. I've made some changes to the |
3f9c244
to
1b49be2
Compare
Hm, now the test fails on 0.4 on Linux (it works on OS X on travis as well as on Ubuntu 14.04 locally here). It looks like that's probably just a rounding error. Do we really need that check? |
Maybe the check will catch a blunder some day, but I don't this it is that important. You could also fix the test error by limiting the number of principal components to |
1b49be2
to
2b0ef61
Compare
Added |
Fix an issue with PCA not working with Float32 arrays
Thanks. |
Awesome, thanks! |
Call to
fit(PCA, X)
fails ifX
isFloat32
array. This pull request adds a test and fixes it. I'm also fixingpcacov
andpcasvd
as they seem to have the same issue.