Skip to content
All library documents

Comparing Scikit-Learn Classifiers and Exporting Models to ONNX

Article MQL5 articles

Summary

The article surveys classification estimators in Scikit-learn and explains a workflow for exporting supported models to ONNX for inference in MQL5. It uses Fisher’s Iris dataset, whose samples have four measurements and three species classes, as a common test problem. The described process creates models in Python, converts them where possible, runs the ONNX versions from MQL5, and compares predictions with the original models.

The article covers a broad range of classifier families, including support vector machines, neighbors, linear models, ensembles, naive Bayes, trees, and neural networks. It also identifies estimators that could not be converted in the presented setup. Accuracy is evaluated on the complete Iris dataset, but this is a small, nonfinancial benchmark and does not establish trading usefulness or out-of-sample performance. Conversion support and predictive behavior may also depend on the specific model and runtime.

Key ideas

  • Classification maps feature vectors to discrete classes, while model choice depends on the data and task.
  • The article demonstrates a Python-to-ONNX-to-MQL5 inference workflow using the Iris dataset.
  • It compares original Scikit-learn predictions with predictions from converted models.
  • Some classifier types are not supported by the conversion workflow described.
  • Iris classification results do not demonstrate performance on financial markets.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.