Updated training code to use CreateCentroids static methods.