ML.NET Concepts – Transformer

Continuous series of articles dealing with the fundamental concepts to learn the ML.NET framework.

 

Today we try to understand the Transformer

Transformer

Transformer are component the pick some data, make some work about it, and return new data, that is modified or transformed.

ITransformer
Interface ITransformer

 

We have two api:

Transform that return data modified and GetOutputSchema that accept a parameter of ISchema.

This is a propagation mechanism that can help us to see the data transformation without make real transformation on theese.

Some Transformer work one column at time. This because they have to create the column trasformed and usually the two columns have the same name.

All transformer that create a new view Data  when they call method Transform

Remember DataView are not mutable.

Lazy Data? So Lazy Transformer!

var newLazyData= transformer.Transform(oldData)

Transformer Chain

Data as others Api can use Append() method, that has role of cuncatenate all method in the pipeline.

var fullTransformer = transformer1.Append(transformer2).Append(transformer3);

 

 

References:

ML.NET Tutorial

ML.NET Concepts – Data