def sum_distances(kmeans, X):
	"""
	Compute the sum of distances between each object and its cluster center

	Parameters:
		kmeans: an sklearn.cluster.KMeans object
		X: 2D array-like object containing the dataset to be clustered

	Returns:
		sum_dist: float- sum of distances from cluster centers
	"""

	distances = kmeans.transform(X)
	sum_dist = 0
	for i in distances:
		sum_dist = sum_dist + min(i)
	return sum_dist