Again, very similar to the corresponding classes for SVM and LogisticRegression.  We should refactor the code.