Practical overview
When it fits
Use Sharplearning when building supervised classification or regression workflows in C#/.NET and you want algorithm, validation and model-selection packages under a shared interface.
Who it is for
- C#/.NET developers adding machine-learning workflows to applications.
- Developers who need classification or regression models and supporting validation or tuning tools.
Documented uses
- Train a model from observations and target values, then predict outcomes for new observations.
- Compare or tune learners using cross-validation, metrics and optimization methods.
- Parse and serialize CSV data or apply feature transformations as part of a workflow.
- Save a trained model for use by another application.
Requirements & limits
The repository is public and MIT-licensed. The README recommends installing packages through NuGet.
- The project is organized into separate NuGet packages for learners, validation, optimization, containers, input/output and feature transformations.
- The README says algorithms and models share an interface, supporting replacement of one with another.
- The XGBoost package is identified as x64-only and supports CPU and GPU learning.
- Getting-started guides, XML documentation and a separate examples repository are referenced.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Train and use a classification random forest model
Create a classification random forest, train it, predict observations, and save the model.
Before you start
- C# .NET project using SharpLearning
- Training observations and targets, plus test observations
Steps
Create a learner with
new ClassificationRandomForestLearner(trees: 100).Train it with
learner.Learn(observations, targets)to obtain a model.Predict with
model.Predict(testObservations).Save the model using
model.Save(() => new StreamWriter("randomforest.xml")).
Expected outcome
A trained classification model produces predictions and is saved to `randomforest.xml`.
Guide limitations
- The example does not describe how to install SharpLearning or prepare observations and targets.
- The example does not document loading the saved model or evaluating prediction quality.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 15 November 2026
- Original website title
- mdabros/SharpLearning · Official homepage title · retained in its source language

