![]() Step 1 − Import Python’s sklearn and pandas libraries along with the related submodules. It takes only one parameter - the number of principal components we want as output.įurther, it returns the new dataset with principal components as a table when used along with the fit(), DataFrame() and head() functions as we will see in the example. Here, PCA is the class that performs dimension reduction and pca is the object created from it. PCA is based on the concept of feature extraction, which says that when the data in a higher dimensional space is mapped to the one in lower dimensional space, the variance of the latter should be maximum. ![]() PCA or Principal Component Analysis helps in removing those dimensions from the dataset that do not help in optimizing the results thereby creating a smaller and simpler dataset with most of the original and useful information. ![]() To do this, we use a dimension reduction algorithm called PCA. Thus, it becomes important to eliminate such features from the dataset. However, not all of them contribute to giving an efficient output and simply cause the ML Model to perform poorly because of the increased size and complexity. ![]() Any dataset used in Machine Learning algorithms may have a number of dimensions. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |