Skip to content
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

Implemented order attribute for hclust. #59

Merged
merged 2 commits into from May 7, 2016

Conversation

slundberg
Copy link
Contributor

Before the order attribute was just a placeholder. This implements it and adds it to the testing file to ensure it produces the same results as the R code. (I didn't look at R when writing the few lines to implement this)

@ahwillia
Copy link
Contributor

+1, I'd like to use this.

@diegozea diegozea mentioned this pull request Mar 8, 2016
@slundberg
Copy link
Contributor Author

Any status on this? Thanks!

@diegozea
Copy link

diegozea commented May 7, 2016

@kmsquire this is fine :)
The change it's simple and gives the same order than R's hclust
i.e.:

julia> for i in 1:10
           ie = Symmetric(rand(100,100))
           bool = hclust(ie, :single).order .== rcopy(R"""hclust(as.dist($ie), method="single")""")[:order]
           println(mean(bool))
       end
1.0
1.0
1.0
1.0
1.0
1.0
1.0
1.0
1.0
1.0

julia> for i in 1:10
           ie = Symmetric(rand(100,100))
           bool = hclust(ie, :complete).order .== rcopy(R"""hclust(as.dist($ie), method="complete")""")[:order]
           println(mean(bool))
       end
1.0
1.0
1.0
1.0
1.0
1.0
1.0
1.0
1.0
1.0

julia> for i in 1:10
           ie = Symmetric(rand(100,100))
           bool = hclust(ie, :average).order .== rcopy(R"""hclust(as.dist($ie), method="average")""")[:order]
           println(mean(bool))
       end
1.0
1.0
1.0
1.0
1.0
1.0
1.0
1.0
1.0
1.0

@kmsquire
Copy link
Contributor

kmsquire commented May 7, 2016

Thanks @diegosea!

I noticed that this function dispatches on a keyword argument. It might be more Julian if it used multiple dispatch (although sometimes the current method is better).

@kmsquire kmsquire merged commit c183367 into JuliaStats:master May 7, 2016
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.

None yet

4 participants