Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsJul 13, 2026·3 min de lecture

ML.NET — Cross-Platform Machine Learning Framework for .NET

An open-source machine learning framework by Microsoft that lets .NET developers build, train, and deploy custom ML models without leaving the .NET ecosystem.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
ML.NET Overview
Commande d'installation directe
npx -y tokrepo@latest install bcdbac82-7e94-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

Introduction

ML.NET is Microsoft's open-source machine learning framework for .NET developers. It enables classification, regression, anomaly detection, recommendation, and time-series forecasting directly in C# or F# applications without requiring Python or external ML services.

What ML.NET Does

  • Trains custom ML models for classification, regression, clustering, anomaly detection, and ranking
  • Provides AutoML for automatic model selection and hyperparameter tuning
  • Imports pre-trained ONNX and TensorFlow models for inference in .NET apps
  • Offers a visual Model Builder tool in Visual Studio for code-free ML development
  • Runs inference on CPU with no GPU requirement for deployment scenarios

Architecture Overview

ML.NET uses a pipeline-based architecture where data transformations and trainers are chained together. Data flows through an IDataView abstraction that supports lazy evaluation and streaming for large datasets. The framework wraps native libraries for performance-critical operations while exposing a managed C# API.

Self-Hosting & Configuration

  • Install via NuGet: dotnet add package Microsoft.ML
  • Add domain-specific packages like Microsoft.ML.Vision or Microsoft.ML.TimeSeries as needed
  • Use Model Builder in Visual Studio for guided model training
  • Deploy trained models as part of ASP.NET Core APIs or Azure Functions
  • Export models in the ML.NET .zip format or consume ONNX models directly

Key Features

  • Native .NET integration with no Python dependency for training or inference
  • AutoML automatically selects the best algorithm and hyperparameters
  • ONNX model import enables using models trained in PyTorch or TensorFlow
  • Scales from desktop apps to cloud services with the same codebase
  • Supports .NET 6+ on Windows, Linux, and macOS

Comparison with Similar Tools

  • scikit-learn — Python-native with larger algorithm library; ML.NET stays within the .NET ecosystem
  • PyTorch/TensorFlow — Deep learning focused with GPU support; ML.NET targets traditional ML with CPU inference
  • Accord.NET — Older .NET ML library; ML.NET has stronger Microsoft backing and active development
  • ONNX Runtime — Pure inference engine; ML.NET adds training, data pipelines, and AutoML on top

FAQ

Q: Does ML.NET require a GPU? A: No, ML.NET runs on CPU. For deep learning with GPU, import ONNX or TensorFlow models.

Q: Can I use ML.NET in production? A: Yes, ML.NET is used in production at Microsoft for features in Bing, PowerPoint, and Excel.

Q: What data formats does ML.NET support? A: CSV, TSV, Parquet, SQL databases, and in-memory IEnumerable collections.

Q: How does AutoML work? A: AutoML tries multiple algorithms and hyperparameter combinations, then returns the best-performing pipeline.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires