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

LDA Printing flipped in y and x axis data on docs #225

Open
jgardona opened this issue Feb 20, 2024 · 0 comments
Open

LDA Printing flipped in y and x axis data on docs #225

jgardona opened this issue Feb 20, 2024 · 0 comments

Comments

@jgardona
Copy link

jgardona commented Feb 20, 2024

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

image

And here are the plots in my tests

image

@jgardona jgardona changed the title LDA Printing inverted y axis data on docs LDA Printing flipped in y and x axis data on docs Feb 21, 2024
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

No branches or pull requests

1 participant