We used the sample data provided with Spark, which is in LIBSVM format, to run the SVM classification recipe. After reading the file, we used SVMWithSGD.train to train the model and then proceeded to predict the data into two sets of labeled output, 0 and 1. We used the BinaryClassificationMetrics metric to measure the performance. We focused on a popular metric, the area under the ROC curve, using metrics.areaUnderROC() to measure performance.
The Signature for this method constructor is as follows:
new SVMWithSGD()
Defaults for Parameters:
- stepSize= 1.0
- numIterations= 100
- regParm= 0.01
- miniBatchFraction= 1.0
It is suggested that the readers should experiment with various parameters in order to get the best settings.