Scripts2026年7月13日·1 分钟阅读

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.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
ML.NET Overview
直接安装命令
npx -y tokrepo@latest install bcdbac82-7e94-11f1-9bc6-00163e2b0d79 --target codex

先 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

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产