I’ve been playing around with NET Core v3 and the ML.NET machine learning framework.
And let me tell you, this stuff is awesome!
NET Core is really cool all by itself. It’s the multi-platform version of the NET framework: it runs on Windows, OS/X, and Linux. I’m running it directly on my Mac right now without using my Windows 10 virtual machine.
And ML.NET is Microsoft’s new machine learning library. It can run linear regression, logistic classification, clustering, deep learning, and many other machine learning algorithms.
ML.NET is a first-class NET library. There’s no need to use Python, you can easily tap into this library using any NET language, including C#.
Microsoft is pouring all their effort into ML.NET right now. This is going to be their go-to solution for all machine learning in NET going forward.
And it’s super easy to use. Watch this:
I built a simple classifier and trained it on a dataset of botanical data. My code loads a CSV file with the exact dimensions of Iris flower petal sizes, and uses it to train the model to correctly identify the type of each flower.
Here’s the code:
See how easy it is?
ML.NET uses the concept of a pipeline to string data-loading, transformation, and learning stages together into a single machine learning sequence. All I need to do at the end is call the Fit() method to train the machine learning model on the data.
And did you notice I’m not using Visual Studio?
You’re looking at Visual Studio Code, a lightweight multi-platform code editor that runs on Windows, OS/X, and Linux.
Building and running machine learning apps in VS Code is a piece of cake, and I can do it directly on my Mac. Again, I’m not touching my Windows VM.
Here’s my code running in the VS Code debugger. It has correctly identified my test flower as an Iris-Virginica:
So what do you think of my setup?
Are you planning on writing C# machine learning apps with NET Core v3 and ML.NET?
Add a comment and let me know!