Machine Learning at Microsoft with ML .NET

Zeeshan Ahmed, Saeed Amizadeh, Mikhail Bilenko, Rogan Carr, Wei-Sheng Chin, Yael Dekel, Xavier Dupré, Vadim Eksarevskiy, Eric Erhardt, Costin Eseanu, Senja Filipi, Tom Finley, Abhishek Goswami, Monte Hoover, Scott Inglis, Matteo Interlandi, Shon Katzenberger, Najeeb Kazmi, Gleb Krivosheev, Pete Luferenko, Ivan Matantsev, Sergiy Matusevych, Shahab Moradi, Gani Nazirov, Justin Ormont, Gal Oshri, Artidoro Pagnoni, Jignesh Parmar, Prabhat Roy, Sarthak Shah, Mohammad Zeeshan Siddiqui, Markus Weimer, Shauheen Zahirazami, Yiwen ZhuKDD 2019 · DOI

Abstract

Machine Learning is transitioning from an art and science into a technology available to every developer. In the near future, every application on every platform will incorporate trained models to encode data-based decisions that would be impossible for developers to author. This presents a significant engineering challenge, since currently data science and modeling are largely decoupled from standard software development processes. This separation makes incorporating machine learning capabilities inside applications unnecessarily costly and difficult, and furthermore discourage developers from embracing ML in first place. In this paper we present ML.NET, a framework developed at Microsoft over the last decade in response to the challenge of making it easy to ship machine learning models in large software applications. We present its architecture, and illuminate the application demands that shaped it. Specifically, we introduce DataView, the core data abstraction of ML.NET which allows it to capture full predictive pipelines efficiently and consistently across training and inference lifecycles. We close the paper with a surprisingly favorable performance study of ML.NET compared to more recent entrants, and a discussion of some lessons learned.

Introduction

Traditionally, a significant barrier exists between data science experimentation and software engineering. While data scientists favor Python-based environments like Scikit-learn for research, these tools often struggle with production constraints. Key challenges include memory limits where datasets must fit entirely in RAM, performance bottlenecks due to Python's Global Interpreter Lock (GIL), and the "rewrite tax"—the necessity of porting research models to C++ or C# for production deployment to meet latency and reliability requirements. ML.NET was developed to bridge this gap, offering a model-agnostic framework capable of running across diverse environments, from large data centers to IoT devices.

Architecture and the DataView Abstraction

The cornerstone of ML.NET is the DataView, a schematized, immutable, and lazily evaluated data abstraction. Drawing inspiration from relational databases, DataView implements three critical concepts to handle large-scale data efficiently:

  1. Cursoring: Instead of loading entire datasets into memory, ML.NET uses an iterator model to stream data, enabling the processing of datasets far exceeding available RAM.
  2. Compositional Pipelines: Every stage, from featurization to classification, is integrated into a single Directed Acyclic Graph (DAG). This ensures identical code paths for training and inference, eliminating model skew.
  3. JIT-Compiled Getters: To optimize CPU efficiency, the framework utilizes lambda functions that are Just-In-Time (JIT) compiled by the .NET runtime, creating high-performance execution paths.

To support the Python ecosystem, Microsoft introduced NimbusML, a bridge that allows data scientists to leverage ML.NET’s high-performance components within a familiar Scikit-learn-style interface.

Architecture of NimbusML bridging Python and ML.NET

Evaluation and Performance

ML.NET was evaluated against three large-scale, real-world datasets: Criteo (45M records, ~10GB binary classification), Amazon Review (17M records, ~9GB text classification), and Flight Delay (1M records, ~1GB regression).

The results highlight ML.NET's efficiency in high-demand scenarios:

  • Speed and Scalability: On the Criteo dataset, ML.NET’s streaming API (NimbusML-DV) completed training in approximately 10 minutes, whereas Scikit-learn required over two days. Furthermore, ML.NET successfully processed the Amazon Review dataset, which caused memory overflow errors in both Scikit-learn and H2O.
  • Accuracy: ML.NET consistently matched or outperformed other frameworks, benefiting from efficient implementations of state-of-the-art algorithms like LightGBM.
  • Multi-core Efficiency: Unlike many Python-based libraries limited by the GIL, ML.NET demonstrates superior scale-up performance by effectively utilizing multiple CPU cores.
Scale-up performance across multiple CPU cores for Amazon and Criteo datasets

Conclusion

ML.NET demonstrates that applying relational database principles—such as columnar access, lazy evaluation, and buffer sharing—to machine learning pipelines can yield significant performance gains. By unifying the training and prediction code paths, it mitigates common production errors and reduces the engineering overhead of deploying models. While the framework initially focused on classical ML, its extensibility and performance make it a robust solution for integrating data-driven decisions into large-scale software applications.

Summary updated

BibTeX
@inproceedings{ahmed2019machine,
  author = {Zeeshan Ahmed and Saeed Amizadeh and Mikhail Bilenko and Rogan Carr and Wei-Sheng Chin and Yael Dekel and Xavier Dupré and Vadim Eksarevskiy and Eric Erhardt and Costin Eseanu and Senja Filipi and Tom Finley and Abhishek Goswami and Monte Hoover and Scott Inglis and Matteo Interlandi and Shon Katzenberger and Najeeb Kazmi and Gleb Krivosheev and Pete Luferenko and Ivan Matantsev and Sergiy Matusevych and Shahab Moradi and Gani Nazirov and Justin Ormont and Gal Oshri and Artidoro Pagnoni and Jignesh Parmar and Prabhat Roy and Sarthak Shah and Mohammad Zeeshan Siddiqui and Markus Weimer and Shauheen Zahirazami and Yiwen Zhu},
  title = {{Machine Learning at Microsoft with ML .NET}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2019},
  doi = {10.1145/3292500.3330667},
}
Figure