coded the kmeans based on TransformActionModel