DATA MUNGING
# How to reduce dimentionality using PCA in Python?

# How to reduce dimentionality using PCA in Python?

This recipe helps you reduce dimentionality using PCA in Python

In [1]:

```
## How to reduce dimentionality using PCA in Python
def Snippet_123():
print()
print(format('How to reduce dimentionality using PCA in Python','*^82'))
import warnings
warnings.filterwarnings("ignore")
# load libraries
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
from sklearn import datasets
# Load Digits Data And Make Sparse
digits = datasets.load_digits()
# Standardize the feature matrix
X = StandardScaler().fit_transform(digits.data)
print(); print(X)
# Conduct Principal Component Analysis
# Create a PCA that will retain 85% of the variance
pca = PCA(n_components=0.85, whiten=True)
# Conduct PCA
X_pca = pca.fit_transform(X)
print(); print(X_pca)
# Show results
print('Original number of features:', X.shape[1])
print('Reduced number of features:', X_pca.shape[1])
# Create a PCA with 2 components
pca = PCA(n_components=2, whiten=True)
# Conduct PCA
X_pca = pca.fit_transform(X)
print(); print(X_pca)
# Show results
print('Original number of features:', X.shape[1])
print('Reduced number of features:', X_pca.shape[1])
Snippet_123()
```

Deep Learning Project- Learn about implementation of a machine learning algorithm using autoencoders for anomaly detection.

Machine Learning Project in R- Predict the customer churn of telecom sector and find out the key drivers that lead to churn. Learn how the logistic regression model using R can be used to identify the customer churn in telecom dataset.

In this data science project in R, we are going to talk about subjective segmentation which is a clustering technique to find out product bundles in sales data.

In this data science project, we will predict the credit card fraud in the transactional dataset using some of the predictive models.

Data Science Project in R -Build a machine learning algorithm to predict the future sale prices of homes.

In this project, we are going to talk about H2O and functionality in terms of building Machine Learning models.

Deep Learning Project- Learn to apply deep learning paradigm to forecast univariate time series data.

In this deep learning project, you will build a classification system where to precisely identify human fitness activities.

In this project, we are going to work on Deep Learning using H2O to predict Census income.

The goal of this data science project is to build a predictive model and find out the sales of each product at a given Big Mart store.