Skip to content

Conversation

@Quentin62
Copy link
Contributor

in scree_plot, components are sorted in alphabetic order resulting in a wrong order when there are more than 10 components

import pandas as pd
import numpy as np

import prince

n, p = 100, 15
x = pd.DataFrame(np.random.randint(0, 100, size=(n, p)))

pca = prince.PCA(n_components=x.shape[1])
pca.fit(x)

pca.scree_plot()

Before:
image

After:
image

@MaxHalford
Copy link
Owner

Great catch! I'll get it merged and publish a new version. Thanks a lot.

@MaxHalford MaxHalford merged commit a499cb4 into MaxHalford:master Nov 1, 2025
2 checks passed
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.

2 participants