The default iterations are set to 10. You can use an
MLClassifier
to train a general-purpose model and it will suggest which classifier is best: You can use that specific classifier and set the modelParameters property maxiterations to a number higher than 10.
struct MLDecisionTreeClassifier
A classifier that predicts the target by creating rules to split the data.
struct MLRandomForestClassifier
A classifier based on a collection of decision trees trained on subsets of the data.
struct MLBoostedTreeClassifier
A classifier based on a collection of decision trees combined with gradient boosting.
struct MLLogisticRegressionClassifier
A classifier that predicts a discrete target value as a function of data features.
struct MLSupportVectorClassifier
A classifier that predicts a binary target value by maximizing the separation between categories.
MLClassifier was able to build a model using the Logistic Regression classifier. I then used MLLogisticRegressionClassifier directly to build my model and set the maxiterations of the ModelParameter property to 100 iterations to improve the model.
Here is an example of how I set it.
//Set the model parameters property maxinterations
let modelParameters = MLLogisticRegressionClassifier.ModelParameters(validationData: top20Data, maxIterations: 100)
//create Model
let patientFlowML = try MLLogisticRegressionClassifier (trainingData: top20Data, targetColumn: "Result", featureColumns: nil, parameters: modelParameters)
Hope this helps.