-
Notifications
You must be signed in to change notification settings - Fork 86
Open
Description
Hello, good evening.
The LDA comparison with PCA in docs are plotting LDA flipped in Y and X axis. This happens with this example
https://juliastats.org/MultivariateStats.jl/stable/lda/
iris = dataset("datasets", "iris")
X = Matrix(iris[1:2:end,1:4])'
X_labels = Vector(iris[1:2:end,5])
pca = fit(PCA, X; maxoutdim=2)
Ypca = predict(pca, X)
lda = fit(MulticlassLDA, X, X_labels; outdim=2)
Ylda = predict(lda, X)
p = plot(layout=(1,2), size=(800,300))
for s in ["setosa", "versicolor", "virginica"]
points = Ypca[:,X_labels.==s]
scatter!(p[1], points[1,:],points[2,:], label=s, legend=:bottomleft)
points = Ylda[:,X_labels.==s]
scatter!(p[2], points[1,:],points[2,:], label=s, legend=:bottomleft)
end
plot!(p[1], title="PCA")
plot!(p[2], title="LDA")
And here are the plots from example
And here are the plots in my tests
Metadata
Metadata
Assignees
Labels
No labels