Have you tried ML.NET?
It's a new machine learning framework made specifically for .NET developers.

ML.NET

An open source and cross-platform machine learning framework

Get started Model Builder

Supported on Windows, Linux, and macOS

//Step 1. Create a ML Context
var ctx = new MLContext();

//Step 2. Read in the input data for model training
IDataView dataReader = ctx.Data
    .LoadFromTextFile<MyInput>(dataPath, hasHeader: true);

//Step 3. Build your estimator
IEstimator<ITransformer> est = ctx.Transforms.Text
    .FeaturizeText("Features", nameof(SentimentIssue.Text))
    .Append(ctx.BinaryClassification.Trainers
        .LbfgsLogisticRegression("Label", "Features"));

//Step 4. Train your Model
ITransformer trainedModel = est.Fit(dataReader);

//Step 5. Make predictions using your model
var predictionEngine = ctx.Model
    .CreatePredictionEngine<MyInput, MyOutput>(trainedModel);

var sampleStatement = new MyInput { Text = "This is a horrible movie" };

var prediction = predictionEngine.Predict(sampleStatement);
//Step 1: Create a ML Context
let ctx = MLContext()

//Step 2: Read in the input data for model training 
let dataReader = ctx.Data
    .LoadFromTextFile<MyInput>(dataPath, hasHeader = true)

//Step 3: Build your estimator 
let est = ctx.Transforms.Text
    .FeaturizeText("Features", "Text")
    .Append(ctx.BinaryClassification.Trainers
        .LbfgsLogisticRegression("Label", "Features"));

//Step 4: Train your model    
let trainedModel = est.Fit(trainingDataView)

//Step 5: Make predictions using your model
let predictionEngine = ctx.Model
    .CreatePredictionEngine<MyInput, MyOutput>(trainedModel)

let sampleStatement = { Label = false; Text = "This is a horrible movie!" }

let prediction = predictionEngine.Predict(sampleStatement)

Built for .NET developers

With ML.NET, you can create custom ML models using C# or F# without having to leave the .NET ecosystem.

ML.NET lets you re-use all the knowledge, skills, code, and libraries you already have as a .NET developer so that you can easily integrate machine learning into your web, mobile, desktop, gaming, and IoT apps.

Dig deeper: How does ML.NET work?

Custom ML made easy with AutoML

ML.NET offers Model Builder (a simple UI tool) and ML.NET CLI to make it super easy to build custom ML Models.

These tools use Automated ML (AutoML), a cutting edge technology which automates the process of building best performing models for your Machine Learning scenario. All you have to do is load your data, and AutoML takes care of the rest of the model building process.

Explore ML.NET Model Builder
ML.NET Model Builder provides a visual interface for building machine learning models in Visual Studio.

Extended with TensorFlow & more

ML.NET has been designed as an extensible platform so that you can consume other popular ML frameworks (TensorFlow, ONNX, Infer.NET, and more) and have access to even more machine learning scenarios, like image classification, object detection, and more.

Training on ~900 MB of an Amazon review dataset, ML.NET produced a model with 93% accuracy, scikit-learn with 92%, and H2O with 85%. ML.NET took 11 minutes to train and test the model, scikit-learn took 66 minutes, and H2O took 105 minutes.

Data sourced from Machine Learning at Microsoft with ML.NET paper. Results for sentiment analysis, using ~900 MB of an Amazon review dataset. Higher accuracy and lower runtime are better.

High performance and accuracy

Using a 9GB Amazon review data set, ML.NET trained a sentiment analysis model with 95% accuracy. Other popular machine learning frameworks failed to process the dataset due to memory errors. Training on 10% of the data set, to let all the frameworks complete training, ML.NET demonstrated the highest speed and accuracy.

The performance evaluation found similar results in other machine learning scenarios, including click-through rate prediction and flight delay prediction.

Read the ML.NET performance paper

Ready to Get Started?

Our step-by-step tutorial will help you get ML.NET running on your computer.

Supported on Windows, Linux, and macOS

Get Started