
<SYSTEM_TASK:>
Given the following text problem statement, write Python code to implement the functionality described below in problem statement
<END_TASK>
<USER_TASK:>
Problem:
Sklearn Principle Component Analysis - PCA Example

<ASSISTANT_TASK:>
Python Code::
from sklearn.decomposition import PCA
# Step 1: Initalise and fit PCA for 4 dimensions
pca = PCA(n_components=4)
pca.fit(X_train)
# Step 2: Transform data
X_train = pd.DataFrame(pca.transform(X_train))
X_test = pd.DataFrame(pca.transform(X_test))
# Step 3: Print out explained variance ratio
print(pca.explained_variance_ratio_)

<END_TASK>
