spark-libFM
spark-libFM copied to clipboard
Use enum instead of int
task
is currently an int:
@param task 0 for Regression, and 1 for Binary Classification
Calling it looks like:
FMWithSGD.train(trainingData.rdd(), 1, numIterations);
Which is much less clear than something like:
FMWithSGD.train(trainingData.rdd(), REGRESSION, numIterations);
I would suggest using an enum instead of an int. This is exactly the type of case where enums are meant to be used.