#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

#AutoML – Automated Machine Learning,AKA #Skynet

Hi!

IMHO one of the most important announcements presented last week in Ignite was the Azure preview for AutoML: Automated Machine Learning.

I’m not going to get into details about AutoML, the best option is to read the official post from the Azure Machine Learning team (see references). I’ll do my best effort to try to summarize that the objective of this new tool if to allows you to automatically identify the best pipeline to work in a machine learning environment / scenario.

A pipeline comprises the basic steps of a process of ML

  • Working with data, this means sorting, filtering, check for nulls, labeling, etc.
  • Select a learning algorithm, SVM, Fast Tree, etc.
  • Define features and Labels, adjust parameters, etc

The [try / error / learn] model in each of these steps help us to improve our model, and to get better results (better accuracy).

AutoML It proposes an automatic service, where the best combination is identified to create a pipeline with the best possible accuracy. As always an image rocks the explanation

01 AutoML process.png

Official description

Automated ML is available to try in the preview of Azure Machine Learning. We currently support classification and regression ML model recommendation on numeric and text data, with support for automatic feature generation (including missing values imputations, encoding, normalizations and heuristics-based features), feature transformations and selection. Data scientists can use automated ML through the Azure Machine Learning Python SDK and Jupyter notebook experience. Training can be performed on a local machine or by leveraging the scale and performance of Azure by running it on Azure Machine Learning managed compute. Customers have the flexibility to pick a pipeline from automated ML and customize it before deployment. Model explainability, ensemble models, full support for Azure Databricks and improvements to automated feature engineering will be coming soon.

From here I strongly recommend reading the official documentation that is where it is explained in detail AutoML. Also, if you are familiar with Jupyter Notebooks, in few seconds you can clone and access a new library with a tutorial to try AutoML from zero. You need to clone a repo from https://github.com/Azure/MachineLearningNotebooks

02 AutoML Jupyter Notebooks

The tutorial is pretty straightforward, and with little Azure resources you can see how you optimize a A Classification model with AutoML

03 AzureML Local tutorial

Although for now only models of classification and regression are supported, AutoML is a tool a Keep in mind when you start working in ML.

See you at the event, Happy Coding!

Greetings @ Toronto

El Bruno

References

#AutoML – Automated Machine Learning, modelos de #MachineLearning que aprenden a optimizarse! (en las movies se llama #skynet)

Buenas!

Una de las noticias mas importantes que se presentaron la semana pasada en Ignite fue la Preview de Azure AutoML: Automated Machine Learning.

Lo mejor para entrar en detalles sobre AutoML es leer el post oficial del equipo de Azure Machine Learning (ver referencias). Yo lo intentare resumir en un nuevo framework que permite identificar de forma automática el mejor pipeline para trabajar con datos.

Un pipeline comprende los pasos básicos de un proceso de ML

  • Trabajar con datos, esto significa ordenarlos, eliminar los nulls, etiquetarlos, etc.
  • Seleccionar un algoritmo de aprendizaje, SVM, Fast Tree, etc.
  • Definir Features y Labels, ajustar parámetros, etc

El modelo de prueba / error / aprendizaje en cada uno de estos pasos define la precisión que tendrá nuestro modelo final.

AutoML propone un servicio automático, donde se identifica la mejor combinación para crear una Pipeline con la mejor precisión posible. Como siempre una imagen ayuda a la explicación

01 AutoML process.png

Y la descripción oficial

Automated ML is available to try in the preview of Azure Machine Learning. We currently support classification and regression ML model recommendation on numeric and text data, with support for automatic feature generation (including missing values imputations, encoding, normalizations and heuristics-based features), feature transformations and selection. Data scientists can use automated ML through the Azure Machine Learning Python SDK and Jupyter notebook experience. Training can be performed on a local machine or by leveraging the scale and performance of Azure by running it on Azure Machine Learning managed compute. Customers have the flexibility to pick a pipeline from automated ML and customize it before deployment. Model explainability, ensemble models, full support for Azure Databricks and improvements to automated feature engineering will be coming soon.

Pues bien, a partir de aquí recomiendo leer la documentación oficial que es donde se explica en detalle AutoML.

Si estas familiarizado con Jupyter notebooks, en pocos segundos puedes tener acceso a un tutorial mas que completo solo clonado una library desde https://github.com/Azure/MachineLearningNotebooks

02 AutoML Jupyter Notebooks

El tutorial es bastante sencillo, y con pocos recursos de Azure puedes ver como se optimiza un un modelo de clasificación con AutoML

03 AzureML Local tutorial

Si bien por ahora solo se soportan modelos de clasificación y regresión, AutoML es una herramienta a tener en cuenta cuando comienzas a trabajar en ML.

Nos vemos en el evento, happy coding!

Saludos @ Toronto

El Bruno

References