CreateML maxIterations

Hey all,


I was playing around with the createML and createMLUI options and received some odd output. It seems that no matter what I set as the number of my maxIterations, the training will always end after 10 iterations, printing: Completed (iteration limit has been reached)


This happens while using the convenient UI from the CreateMLUI builder but also while using createML with for example maxIterations: 20.


Is this just an output error, and the model is indeed running my determined 20 iterations or is it simply not working at the moment?

Replies

Did you ever get anywhere with this? I'm encountering a similar problem.

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.