We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4215764 commit 8a4807eCopy full SHA for 8a4807e
src/pca.py
@@ -7,13 +7,11 @@
7
8
@st.cache_data
9
def get_pca_df(scaled, n=5):
10
-
11
- scaled_data = StandardScaler().fit_transform(scaled) #center-scaling the data for PCA
12
+
13
# calculating Principal components
14
pca = PCA(n_components=n)
15
pca_df = pd.DataFrame(
16
- data=pca.fit_transform(scaled_data),
+ data=pca.fit_transform(scaled),
17
columns=[f"PC{x}" for x in range(1, n + 1)]
18
)
19
pca_df.index = scaled.index
0 commit comments