It would be good to refactor this into a class with setN(), setM(), etc methods on it and have just a wrapper method that calls it here, similar to our other ML algorithms. The reason for that design is that we might add arguments to an algorithm later on, and it's easier to do that on a class with setter methods and default values. Otherwise we'd have to keep making methods here with more and more parameters, which might not make sense.