#MLNET – How to use the AutoML API in a Console App

Hi !

In my last posts I was testing AutoML using the Model Builder inside Visual Studio and also the CLI commands. There is also an API to use this in a .Net app, and the usage is very simple.

It all start, of course, adding the [Microsoft.ML.AutoML] nuget package

I read the documentation in [How to use the ML.NET automated machine learning API], and I created the following sample using the same data as in my previous posts.

The final result displays the results for each one of the tests and showcase the top 3 ranked models. This time LightGBM Trainer is one more time the best trainer to choose.

There is a full set of samples in the Machine Learning .Net Samples repository. I’ve reused some classes from the Common folder.

The complete source code is available https://github.com/elbruno/Blog/tree/master/20190516%20MLNET%20AutoML%20API

Happy Coding!

Greetings @ Toronto

El Bruno

References

Advertisements

#MLNET – Are you a Command line user? MLNet CLI is great for some AutoML train tasks!

Hi !

Yesterday I wrote about how easy is to use Model Builder to create Machine Learning models directly from data inside Visual Studio.

If you prefer to work with command line interfaces, Machine Learning.Net AutoML also have a CLI interface and with a couple of commands, you can get some amazing results.

So, for this test I follow the tutorial [Auto generate a binary classifier using the CLI] and make some changes to the original command

> mlnet auto-train --task binary-classification --dataset "yelp_labelled.txt" --label-column-index 1 --has-header false --max-exploration-time 10

I’m using the same set of data I used yesterday and, my command is

mlnet auto-train --task regression --dataset "AgeRangeData03_AgeGenderLabelEncodedMoreData.csv" --label-column-index 2 --has-header true --max-exploration-time 60

The output is also interesting: it suggest to use a FastTree Regression trainer

My yesterday test using the IDE suggested a LightBGM regression trainer.

So, I decided to run the CLI one more time with some more processing time. This time the result is also a FastTree Tegression trainer.

Unless you need to use Visual Studio, this option is amazing for fast tests and you can also use the generated projects!

Happy Coding!

Greetings @ Toronto

El Bruno

References

#MLNET – Testing Machine Learning Model Builder preview. It’s so cool !

Hi !

Last week Machine Learning.Net 1.0 was officially announced during Build 2019, and the ML.Net team also announced a set of ML tools related to ML.Net.

One of the most interesting ones is Machine Learning Model Builder. You can get more information about Model Builder in the official website.

ML.NET Model Builder provides an easy to understand visual interface to build, train, and deploy custom machine learning models. Prior machine learning expertise is not required. Model Builder supports AutoML, which automatically explores different machine learning algorithms and settings to help you find the one that best suits your scenario.

Machine Learning Model Builder

The tool is on Preview, but it’s still an amazing one to play around with ML. So I decided to give it a try with my small data set of kids, the one I use on the Machine Learning.Net demos.

The structure of my CSV file is very simple with just 3 columns: Age, Gender and Label.

However the first time I run the scenario I found the following error.

Inferring Columns ...
Creating Data loader ...
Loading data ...
Exploring multiple ML algorithms and settings to find you the best model for ML task: regression
For further learning check: https://aka.ms/mlnet-cli
|     Trainer                             RSquared Absolute-loss Squared-loss RMS-loss  Duration #Iteration      |
[Source=AutoML, Kind=Trace] Channel started
Exception occured while exploring pipelines:
Provided label column 'Label' was of type String, but only type Single is allowed.
System.ArgumentException: Provided label column 'Label' was of type String, but only type Single is allowed.
   at Microsoft.ML.CLI.Program.<>c__DisplayClass1_0.<Main>b__0(NewCommandSettings options)
   at Microsoft.ML.CLI.CodeGenerator.CodeGenerationHelper.GenerateCode()
Please see the log file for more info.
Exiting ...

Which makes a lot of sense, my Label column is a String and the Model Builder expects a Single data type. So, I updated my data file replacing the labels with numbers and I was ready for a 2nd test.

This time the training process started fine, however I noticed that using just a small training dataset didn’t trigger any comparing between different algorithms. So I created a much bigger training dataset, and now I got the training process up and running.

At the end the results are the ones below. And it’s very interesting. I do most of my demos using a MultiClass SDCA trainer and AutoML suggest me to use a LightGBM trainer. This will be part of my Machine Learning.Net speech for sure in the future.

You can download the Visual Studio extension from https://dotnet.microsoft.com/apps/machinelearning-ai/ml-dotnet/model-builder and remember that we can talk about this on the Visual Studio 2019 event with the Mississauga .Net User Group in a couple of weeks!

Happy Coding!

Greetings @ Toronto

El Bruno

#Event – Resources for the sessions about #DeepLearning and #CustomVision at the @ChicagoCodeCamp

Hi!

Another post-event post, this time with a big thanks to the team behind one of the most amazing event I’ve been this year: Chicago CodeCamp.

I had the chance to meet a lot of amazing people, to learn a lot during the sessions and also to visit the great city of Chicago.

As usual, now it’s time to share slides, code and more.

Deep Learning for Everyone? Challenge Accepted!

Let’s start with the Deep Learning resources


Demos Source Code: https://github.com/elbruno/events/tree/master/2019%2005%2011%20Chicago%20CodeCamp%20Deep%20Learning

Session: How a PoC at home can scale to Enterprise Level using Custom Vision APIs

And also the [How a PoC at home can scale to Enterprise Level using Custom Vision APIs] resources

Demos Source Code: https://github.com/elbruno/events/tree/master/2019%2005%2011%20Chicago%20CodeCamp%20CustomVision

And finally, some Machine Learning.Net, Deep Learning and Custom Vision resources:

My posts on Custom Vision and ONNX

  1. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  2. Object recognition with Custom Vision and ONNX in Windows applications using WinML
  3. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, drawing frames
  4. Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate FPS
  5. Can’t install Docker on Windows 10 Home, need Pro or Enterprise
  6. Running a Custom Vision project in a local Docker Container
  7. Analyzing images in a Console App using a Custom Vision project in a Docker Container
  8. Analyzing images using PostMan from a Custom Vision project hosted in a Docker Container
  9. Building the CustomVision.ai project in Docker in a RaspberryPi
  10. Container dies immediately upon successful start in a RaspberryPi. Of course, it’s all about TensorFlow dependencies
  11. About ports, IPs and more to access a container hosted in a Raspberry Pi
  12. Average response times using a CustomVision.ai docker container in a RaspberryPi and a PC

Windows 10 and YOLOV2 for Object Detection Series

See you next one in Chicago for some Deep Learning fun!

Happy coding!

Greetings @ Toronto

El Bruno

#Event – Resources for the session [Getting Started with Machine Learning.Net & #Azure] on the #GlobalAzure Bootcamp in GTA

Hi!

Another post-event post, this time with a big thanks to the team behind one of the biggest Community events globally: Global Azure Bootcamp.

Avanade Canada sponsored this session and I had the amazing chance to share some insights around Machine Learning.Net and Azure.

As usual, now it’s time to share slides, code and more.


Source Code in GitHub https://github.com/elbruno/events/tree/master/2019%2004%2027%20GAB%20MLNet

And some Machine Learning.Net and Azure Notebook resources:

Resources

See you next one in Chicago for some Deep Learning fun!

Happy coding!

Greetings @ Toronto

El Bruno

#Event – Materiales utilizados en la sesión [Getting Started with Machine Learning.Net & Windows Machine Learning] con el grupo de usuarios GLUG

Buenas!

Es momento de otro post para compartir los materiales utilizados durante la sesión con el grupo de usuarios GLUGnet User Group for .NET, Web, Mobile, Database. Especial agradecimiento para Joe Kunk (@JoeKunk) y a los asistentes al webcast vía Google Hangouts. Por cierto, la sesión fue con los materiales actualizados a la version 0.10 de ML.NetÑ Windows ML and Machine Learning.Net.

Como siempre, aquí están las slides.

Source Code GitHub https://github.com/elbruno/events/tree/master/2019%2002%2021%20GLUG%20NetUG%20MLNet

Y algunos links que comenté durante la sesión:

Resources

Happy Coding!

Saludos @ Toronto

El Bruno

#Event – Resources for the session [Getting Started with Machine Learning.Net & Windows Machine Learning] on the GLUG .Net User Group

Hi!

Another post-event post, this time with a big thanks to Joe Kunk (@JoeKunk) and to all the members of the GLUGnet User Group for .NET, Web, Mobile, Database. We had an amazing time, via Google Hangouts in the session about Windows ML and Machine Learning.Net.

As usual, now it’s time to share slides, code and more.

Source Code GitHub https://github.com/elbruno/events/tree/master/2019%2002%2021%20GLUG%20NetUG%20MLNet

And some Machine Learning.Net resources:

Resources

Greetings @ Toronto

El Bruno

#Event – Webinar: Getting Started with ML.NET and Windows Machine Learning, Today with the GLUG .Net User Group

giphy-downsized

Hi !

Another virtual event about Windows ML and Machine Learning .Net, and this time with my good friends from Okemos, MI. The event will be

Getting Started with ML.NET and Windows Machine Learning

One more time, we have new features and improvements on the platform since the previous event, so it’s time for me to review and prepare new content. In example, use TensorFlow and ML.Net !!!

Description  

Machine Learning has moved out of the lab and into production systems. Understanding how to work with this technology is one of the essential skills for developers today. In this session, you will learn the basics of machine learning, how to use existing models and services in your apps, and how to get started with creating your own simple models.

In other words, if you are a .NET developer, this session is for you! We will cover the basics of ML.NET, a complete machine learning framework to work with C#, F# or any other .NET Core language.

Online Register https://www.meetup.com/GLUGnet/events/qkmgpkyzdbcc/

Happy Coding!

Greetings @ Burlington

El Bruno

#Event – 30 min de #MachineLearning.Net durante el evento en vivo @mvpdays (ahora mismo!)

aerial photo of mountain surrounded by fog
Photo by icon0.com on Pexels.com

Buenas !

en pocas horas dará comienzo un evento gratuito de formación: MVP Days.

Yo tuve la suerte de tener mis 30 minutos para hablar de Machine Learning.Net

Getting Started with Machine Learning.Net and Windows Machine Learning

Machine Learning has moved out of the lab and into production systems. Understanding how to work with this technology is one of the essential skills for developers today. In this session, you will learn the basics of machine learning, how to use existing models and services in your apps, and how to get started with creating your own simple models.
And if you are a .Net developer, we will cover the basis of Machine Learning.Net, a complete ML framework to work with C#, F# or any other .Net Core language.

Salvo yo, la agenda y speakers son geniales !

Happy Coding!

Saludos @ Toronto

El Bruno

#Event – 30 min of #MachineLearning.Net on the next @mvpdays on Jan 30!

aerial photo of mountain surrounded by fog
Photo by icon0.com on Pexels.com

Hi !

less than 24 hours for a full day of free training, take a look at MVP Days.

I was lucky enough to have my slot to share some experiences and a zero to one demo on Machine Learning.Net

Getting Started with Machine Learning.Net and Windows Machine Learning

Machine Learning has moved out of the lab and into production systems. Understanding how to work with this technology is one of the essential skills for developers today. In this session, you will learn the basics of machine learning, how to use existing models and services in your apps, and how to get started with creating your own simple models.
And if you are a .Net developer, we will cover the basis of Machine Learning.Net, a complete ML framework to work with C#, F# or any other .Net Core language.

You should really check the agenda, there are a lot of amazing topics and speakers !

Greetings @ Toronto

El Bruno