
<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:
Clustering Data Using K-Means

<ASSISTANT_TASK:>
Python Code::
from sklearn.cluster import KMeans
# Step 1: Initalise kmeans clustering model for 5 clusters and 
# fit on training data
k_means = KMeans(n_clusters=5,
                 random_state=101)
k_means.fit(X_train)
# Step 2: Predict cluster for training and test data and add results
# as a column to the respective dataframes
X_train['cluster'] = k_means.predict(X_train)
X_test['cluster'] =  k_means.predict(X_test)
# Step 3: Print out cluster center arrays and inertia value
print('Cluster Centers:', k_means.cluster_centers_)
print('Inertia:', k_means.inertia_)

<END_TASK>
