
<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 Kmeans Elbow Method - Plotting Inertia With Matplotlib

<ASSISTANT_TASK:>
Python Code::
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
# Step 1: Set range of clusters to try and 
# create inertia values dictionary
clusters_range = (1,10)
inertia_values = {}
# Step 2: For each set of clusters fit a kmeans algorithm and add
# inertia value to interia values dictionary
for clusters in range(clusters_range[0], clusters_range[1] + 1):
    k_means = KMeans(n_clusters=clusters,
                     random_state=101)
    k_means.fit(X_train)
    inertia_values[str(clusters)] = k_means.inertia_
# Step 3: Plot inertia values dictionary to assess optimum
# number of clusters to use
plt.figure(figsize=(10,6))
plt.plot(inertia_values.keys(),
         inertia_values.values(),
         marker='o')
plt.title('KMeans Clustering Elbow Method')
plt.ylabel('Inertia')
plt.xlabel('Clusters')
plt.show()

<END_TASK>
