Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Machine Learning by (19k points)
In my understanding, I thought PCA can be performed only for continuous features. But while trying to understand the difference between one-hot encoding and label encoding came through a post on the following link:

It states that one hot encoding followed by PCA is a very good method, which basically means PCA is applied for categorical features. Hence confused, please suggest me on the same.

1 Answer

0 votes
by (33.1k points)

PCA is commonly used on binary data (e.g. one-hot encoded data) that does not mean it is a good thing, or it will work very well.

PCA can be implemented for continuous variables. It tries to minimize variance (=squared deviations). The concept of squared deviations breaks down when you have binary variables.

You can use PCA. You get an output. It even is a least-squared output - it's not as if PCA would segfault on such data. It works, but it is just much less meaningful than you'd want it to be, and supposedly less meaningful than e.g. frequent pattern mining.

Hope this answer helps you! For more details on this, study PCA.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...