#MLNET – New version 0.7 for Machine Learning.Net (the perfect excuse to update my content for next events!)

auto auto racing automobile automotive
Photo by Pixabay on Pexels.com

Hi!

A few days ago, the Machine Learning Net. team published a new version, 0.7. I have not had time to thoroughly review the novelties of this version, however, I will update my session and demos to version 0.7 for the next session on November 22 in Mississauga

Getting Started with Machine Learning.Net & Windows Machine Learning https://www.meetup.com/MississaugaNETUG/events/255916993/ .

Cesar de la Torre and the ML.Net team have published a full post with the novelties of ML.Net 0.7 https://blogs.msdn.microsoft.com/dotnet/2018/11/08/announcing-ml-net-0-7-machine-learning-net/ and I reshare the important bullets, to be updated on my contents:

  •     Enhanced support for recommendation tasks with Matrix Factorization
  •     Enabled anomaly detection scenarios – detecting unusual events rel
  •     Improved customizability of ML pipelines
  •     x86 support
  •     NimbusML – experimental Python bindings for ML.NET
  •     Get started with ML.NET v07

And, finally, we change the address for the next event on November 14: Artificial Intelligence and Machine Learning in Azure https://www.meetup.com/The-Azure-Group-Meetup/events/bvvjnpyxpbsb/ .

Happy coding!

Greetings @ Toronto

El Bruno

References

My Posts

Advertisements

#MLNET – Novedades en la version 0.7 de Machine Learning.Net (la excusa perfecta para actualizar proximos eventos!)

auto auto racing automobile automotive
Photo by Pixabay on Pexels.com

Buenas!

Hace unos días se publico la version 0.7 de Machine Learning .Net. No he tenido tiempo de repasar a fondo las novedades de esta version, sin embargo, tendré actualizada mi sesión y demos a la version 0.7 para la próxima sesión el próximo 22 de Noviembre en Mississauga

Getting Started with Machine Learning.Net & Windows Machine Learning https://www.meetup.com/MississaugaNETUG/events/255916993/ .

Pues bien, Cesar De la Torre y el equipo de ML.Net han publicado un post completo con las novedades de ML.Net 0.7 https://blogs.msdn.microsoft.com/dotnet/2018/11/08/announcing-ml-net-0-7-machine-learning-net/ y me apunto los puntos importantes del post para repasar esta semana

  •     Enhanced support for recommendation tasks with Matrix Factorization
  •     Enabled anomaly detection scenarios – detecting unusual events rel
  •     Improved customizability of ML pipelines
  •     x86 support
  •     NimbusML – experimental Python bindings for ML.NET
  •     Get started with ML.NET v07

Y, por último, hemos cambiado la ubicación del evento Artificial Intelligence and Machine Learning in Azure https://www.meetup.com/The-Azure-Group-Meetup/events/bvvjnpyxpbsb/ del próximo 14 Noviembre.

Happy coding!

Saludos @ Toronto

El Bruno

References

My Posts

#Event – Getting Started with Machine Learning.Net & Windows Machine Learning on Nov 22 in Mississauga

abstract blackboard bulb chalk
Photo by Pixabay on Pexels.com

Hi !

So my friends from the Mississauga .Net User Group (link) were kind enough to invite me to host a session on November 22th, in TEK Systems in Mississauga. I’ll share some of the updates on ML.Net, currently in version 0.6 and some other very cool stuff around Microsoft and AI.

You can register to the event here and the formal description is:

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 basis of Machine Learning.Net, a complete ML framework to work with C#, F# or any other .Net Core language.

Happy coding!

Greetings @ Toronto

El Bruno

#MLNET – Analyzing pipeline data in Machine Learning.Net using the new API 0.6.0 (thanks LINQ!)

Hi!

The change in the way the pipelines work in the 0.6.0 version of Machine Learning.Net, also requires some changes in our code if we want to see how the data is processed during each of the pipeline’s steps. Using the example of my previous post, I will work with the following data structure.

01 mlnet age range data

On line 21, let’s create a temporary data view with the following code

That allows me to analyze the data directly in the IDE in debugging mode, or even save the dataset in a temporary file

02 MLNet temp view of pipeline data

This may be enough, however, when working with a class that has the 4 fields of my dataset, I am forcing my App to load and map all the data for each column.

In this example, the generated model to generate a prediction only needs the fields Label and Age. So, we can remove the definition of the columns Name and Gender. We will find the following error

03 mlnet missing columns while loading data

System.InvalidOperationException

  HResult=0x80131509

  Message=Column ‘Name’ not found in the data view

  Source=Microsoft.ML.Api

By default, the load process attempts to map all columns. The solution is to enable the option to ignore missing columns, as the following example shows.

04 mlnet ignore missing columns

Finally, if we work with a lot of data, we can also leverage some LINQ features to just work with a small set of rows

05 mlnet take only 3 elements

Happy coding!

Greetings @ Toronto

El Bruno

References

My Posts

#MLNET – Analizando datos de la Pipeline con la nueva version API 0.6.0 (gracias LINQ!)

Buenas!

El cambio en la forma en la que las Pipelines trabajan en la version 0.6.0 de Machine Learning.Net, también requiere que el código se modifique un poco si queremos ver como se procesan los datos durante cada uno de los pasos de la Pipeline.

Retomando el ejemplo del post anterior, voy a trabajar con la siguiente estructura de datos.

01 mlnet age range data

En la línea 21, créate una vista temporal de datos con el siguiente código

que me permitirá analizar los mismos directamente en el IDE en modo de depuración, o inclusive guardarlos en archivos temporales para estudiar los mismos

02 MLNet temp view of pipeline data

Esto puede ser suficiente, sin embargo, al trabajar con una clase tipada con los 4 campos de mi set de datos, estoy obligando a mi App a cargar y mapear todos los datos en cada columna. En este ejemplo, el modelo generado permite generar una predicción del Label a partir del campo Age. De esta forma, podemos obviar la definición de las columnas Name y Gender en la carga.

Eso sí, nos encontraremos con el siguiente error

03 mlnet missing columns while loading data

System.InvalidOperationException

  HResult=0x80131509

  Message=Column ‘Name’ not found in the data view

  Source=Microsoft.ML.Api

Ya que, por defecto, la carga de datos intenta mapear todas las columnas. La solución es habilitar la opción para ignorar las columnas faltantes, como muestra el siguiente ejemplo.

04 mlnet ignore missing columns

Finalmente, si trabajamos con muchos datos, también podemos sacar provecho de Linq para solo analizar un subgrupo de filas

05 mlnet take only 3 elements

Happy coding!

Saludos @ Toronto

El Bruno

References

My Posts

#MLNET – API improvements in the new 0.6.0 version

Hi!

A few days ago, the ML.Net team released the 0.6.0 version of Machine Learning.Net and one of the most important changes it’s on the way we use ML.Net API.

In my MLNet sessions I usually comment on a prediction scenario based on the Label of a person to see if it is a child, baby or teenager. All of this using a small set of data with information like name, age and gender.

01 mlnet age range data

As you can see from the previous image, my training data set has the columns Name, Age, Gender And Label. well, One important detail is that I also need 2 .Net classes with fields to represent the rows of My trainings Datasets and the expected Prediction.

In the 0.5.0 version of ML.Net the way of working was based on creating a pipeline with the following steps

  • Define the data model and load training data
  • Define the features and labels
  • Select a Trainer and train the model

The generated model allowed to make Predictions. The following example explains it in 20 Lines of code

With the 0.6.0 version, the way the API is used has changed a lot. The best thing at this point is to read the original post of Cesar De la Torre where he explains the novelties of this version (see references). However, I think leaving an example of the same code, adapted to version 0.6.0, will be good enough to share an idea of how flexible is the new API

The main changes

  • Lines 5 to 9, loading the initial data file for training
  • Lines 11 to 18, Defining Features and Label for training
  • Line 20, training and model creation
  • Line 22, Creating a function to make predictions
  • Lines 24 to 32, example of a prediction

The complete example available in https://github.com/elbruno/Blog/tree/master/20181011%20MLNET%200.6%20NewAPI

Happy coding!

Greetings @ Toronto

El Bruno

References

My Posts

#MLNET – Cambios en la API con la nueva version 0.6.0

Buenas!

Hace unos días se libero la version 0.6.0 de Machine Learning .Net y una de las novedades mas importantes de la misma fue que la API de uso de ML.Net cambio de una forma muy importante. En mis sesiones siempre suelo comentar el escenario de predicción del Label de una persona para ver si es niño, bebe o adolescente de acuerdo con su edad y género. El set de datos con el que trabajo tiene la siguiente estructura

01 mlnet age range data

Como se puede ver en la imagen anterior, mi training data set posee las columnas Name, Age, Gender y Label. Pues bien, un detalle importante es que también necesito 2 clases con campos para representar las filas de mis trainings datasets y el resultado esperado.

Hasta la version 0.5.0 de ML.Net la forma de trabajo se basaba en crear un pipeline con los siguientes pasos

  • Definir el modelo de datos y cargar los mismos
  • Definir las Features y Labels
  • Seleccionar un Trainer y entrenar el modelo

El modelo generado permitía realizar predicciones. El siguiente ejemplo lo explica en 20 líneas de código

Pues bien, con la version 0.6.0, la forma en la que se utiliza la API ha cambiado. Lo mejor en este punto es leer el post original de Cesar De la Torre donde explica las novedades de esta version (ver referencias). Sin embargo, creo que dejar un ejemplo del mismo código da una idea de lo flexible que es la nueva API

Los cambios principales los podemos encontrar en

  • Líneas 5 a 9, carga del archivo inicial de datos para training
  • Líneas 11 a 18, definición de Features y label para el training
  • Línea 20, entrenamiento y creación del modelo
  • Línea 22, creación de una función para realizar predicciones
  • Líneas 24 a 32, ejemplo de una predicción

El ejemplo completo se puede ver aquí https://github.com/elbruno/Blog/tree/master/20181011%20MLNET%200.6%20NewAPI

Happy coding!

Saludos @ Toronto

El Bruno

References

My Posts

#Event – Resources used during: Getting started with Machine Learning.Net and WinML at @metrotorontoug

Hi!

Now it’s time to thanks Armin (@ArminPage), Ehsan (@ehsaneskandarim) and Luca (@lucavgobbi) from Metro Toronto .Net User Group. They invited me to share a session about 2 very cool topics: Machine learning.Net and Windows Machine Learning.

The event was great! full house, and as usual now it’s time to share some of the resources used during the sesion. Start with the slides and samples source code.

Source Code GitHub https://github.com/elbruno/events/tree/master/2018%2010%2003%20Metro%20Toronto%20MLNet

And after some amazing questions, here is a list of useful links:

Resources

Greetings @ Burlington

El Bruno

Bonus: Some pics }:D

#Event – Materiales de la sesión: Introducción a Machine Learning.Net con @metrotorontoug

Buenas!

Momento de agradecer a los amigos Armin (@ArminPage), Ehsan (@ehsaneskandarim) y Luca (@lucavgobbi) de Metro Toronto .Net User Group que me han dado la oportunidad de hablar en modo introducción sobre Machine learning.Net y Windows Machine Learning.

Como es habitual, ahora es el momento de compartir slides y Source Code de los ejemplos comentados ayer.

Muchas gracias por las preguntas y por el Feedback, todos 5 estrellas!

Source Code GitHub https://github.com/elbruno/events/tree/master/2018%2010%2003%20Metro%20Toronto%20MLNet

A continuación algunos recursos que comente en durante la sesión:

Resources

Saludos @ Toronto

El Bruno

Bonus: Algunas fotos del evento

#Event – Getting Started with ML.NET and Windows Machine Learning, October 3rd in Toronto @metrotorontoug

Hi!

It’s time to share some Machine Learning experiences and news , mostly for Net developers. This time is with my friends from Metro Toronto, on October the 3rd.

Getting Started with ML.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.

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 registration https://www.meetup.com/metrotorontoug/events/254613846/ 

Happy Coding!

Greetings @ Burlington

El Bruno