PCA without data normalization performes better than after normalization, why?

I have this spotify dataset with around 100k records and 28 fetures mixed of numerical(descrete and continuous) and binary, some of the numerical variables have so many zero values.
I want to perform machine learning classification classifying 113 genres which is so many. I want to have robust Principal Component Analysis to improve my model. But I am confused why normalized data(I use Standard Scaler) performs much worse accuracy than without normalization.

At first, after data preprocessing I perform simple decision tree classifier (after hyperparameter tuning) and get 43% of accuracy.

  • Then I perform Principle Component Analysis(PCA) to reduce the number of features so I can cluster the data to reduce the number of classes and detect and visualize the outliers more easily.

  • As I know that before depploying PCA, my data needs to be normalized(I used StandardScaler here). However I discover that without normalization the performance of my decision tree classifier with 1 dimension PCA improveS to 51%. And on the opposite with normalization it decreases to only 5% accuracy with 2 Dimension, here I need to.

How it is possible? How can I improve the algorithm performance?

My code


pca = PCA(n_components=20) # I try many values here as the accuracy increase with more components
pca.fit(X_train_norm)
X_train_pca = pca.transform(X_train_norm)

# Decision Tree
X_test_pca = pca.transform(X_test_norm)

dt = DecisionTreeClassifier(min_samples_leaf = 3,random_state=42)
dt.fit(X_train_pca, y_train)

y_pred = dt.predict(X_test_pca)

print('Accuracy %s' % accuracy_score(y_test, y_pred))
print('F1-score %s' % f1_score(y_test, y_pred, average=None))
print(classification_report(y_test, y_pred))

pca_all = PCA(n_components=25)
pca_all.fit(X_train_norm)
X_train_pca = pca_all.transform(X_train_norm)
explained_variance = pca_all.explained_variance_ratio_

plt.figure(figsize=(10, 6))
plt.bar(range(len(explained_variance)), explained_variance, alpha=0.7, align='center', 
        label='Individual explained variance')
plt.step(range(len(explained_variance)), np.cumsum(explained_variance), where='mid', 
         label='Cumulative explained variance')
plt.xlabel('Principal Component Index')
plt.ylabel('Explained Variance Ratio')
plt.legend(loc='best')
plt.title('Explained Variance by Principal Components with Normalization')
plt.grid()
plt.show()

I attach data distribution for the pca after standardizaztion (round shape), and without normalization (elbow shape). The colors represents the genres. Also the variance explanability of my PCA [enter image description here](https://i.sstatic.net/HaDoNROy.png)enter image description hereenter image description here

New contributor

azzure19 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật