1---2name: mlnet3description: Use ML.NET to train, evaluate, or integrate machine-learning models into .NET applications with realistic data preparation, inference, and deployment expectations. USE FOR: ML.NET integration; local model training or retraining; inference pipelines, model loading, evaluation, and deployment review. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.4---56# ML.NET78## Trigger On910- integrating machine learning into a .NET application11- training or retraining ML.NET models from local data12- reviewing inference pipelines, model loading, or AutoML-generated code1314## Workflow15161. Start from the prediction task and data quality, not the algorithm or package list.172. Separate training code from inference code so the production path stays lean and predictable.183. Review feature engineering, normalization, label quality, and evaluation metrics before trusting model output.194. Use Model Builder or the ML.NET CLI when they speed up exploration, but inspect the generated C# before treating it as production architecture.205. Plan how the model is loaded, versioned, and refreshed in the application lifecycle.216. Validate with representative datasets and explicit evaluation, not only with a sample that happens to run.2223## Deliver2425- ML.NET pipelines that fit the prediction task26- production-usable inference integration27- evaluation evidence tied to the business scenario2829## Validate3031- model quality is measured, not assumed32- training and inference responsibilities are separated33- deployment and versioning expectations are explicit3435## References3637- [patterns.md](references/patterns.md) - Data loading, training pipelines, evaluation metrics, deployment strategies, and feature engineering patterns38- [examples.md](references/examples.md) - Complete examples for sentiment analysis, price prediction, image classification, anomaly detection, recommendations, clustering, fraud detection, text classification, object detection, and AutoML