Docs: Multi Label Classifier sample

Created on 15 May 2018  Â·  18Comments  Â·  Source: dotnet/docs

I look forward to a sample illustrating Multiclass Classification model. Common example will be News categorization.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Area - ML.NET Guide P1 doc-idea dotnet-msvc

All 18 comments

@asthana86 @aditidugar please take a look at this request for a new tutorial for ML.NET.

Thanks for the feedback, @ronbutan! We're still working on building out all of our tutorials and samples, but a multi-classification sample will be added soon.

The Iris example on the getting started page is a multiclass classifier: https://www.microsoft.com/net/learn/apps/machine-learning-and-ai/ml-dotnet/get-started

Maybe we should add that link to this page then: https://docs.microsoft.com/en-us/dotnet/machine-learning/tutorials/?

Yes, @brendankowitz is right, that's a multi-classification sample. @mairaw, we can certainly link from there temporarily, but it's not really a step-by-step tutorial like our other walkthroughs. We're working on creating a more end-to-end multi classification sample based on some of the demos we showed, and will have that ready soon.

Appreciate the speedy response. I was wondering how to construct the class (i.e. IrisData) with multi labels (e.g. public string Label vs public string[] Labels). A simple code sample will definitely help.

Hey @ronbutan! Thanks for the clarification here, I think we may have misunderstood your earlier question. Here is some guidance that may help:

  1. Multi-label classification: If you're looking to classify more than one label (predicting iris type in addition to petal size for example), then we unfortunately do not support this at the moment. The guidance here would be to train individual models for each of these, and then combine the predictions together. If you're interested in this support please open an issue on our GitHub repo.

  2. Multi-class classification. If you are looking for an array output since there are multiple values for each label, the "Score" attribute can provide the array of scores (one per class). You can check out a sample for that here. We also have an open issue about this because you currently cannot get the string labels for the classes other than the top class.

Hope this helps!

Hi

The sample with flowers looks and works awesome. I am impressed. Could you please avice me what kind of classifier should I use if one (or more) of my input features contains descreet values like color of the flower?

Thanks
Marek

Hi @Finansnet! If I understand your question correctly, you're looking to handle input features for the color of flower such as "yellow", "pink", "blue", etc.

You can use the CategoricalOneHotVectorizer() function to transform these into numeric values so you can then process them in your learning algorithm. Please take a look at the Taxi Fare example to see how this can be implemented.

Hi @aditidugar

That was exactly I was looking for. I have checked in on my training data and the results are very promising. Thank you.

Marek

@aditidugar Any update on Multi-label classification support please?

@stephenstroud - on the way soon! In the meantime, check out the sample here: https://github.com/dotnet/machinelearning-samples/tree/master/samples/csharp/end-to-end-apps/MulticlassClassification-GitHubLabeler

Hi Alexander, sorry to bother but I've been looking for multi-label support/doc and can't find it anywhere. It is currently supported by ml.net?

Any update on this?

@JRAlexander what's the update on multi-label classification?

It's been over a year now since the 'on the way soon' comment. Only examples are multi-class algorithms which produce only a single label.

We much need a solution for this – including scoring that accounts for the multi-label aspect of things (ie: whether the algorithm correctly labelled with the right number of tags)

Hi @marchy, ML.NET currently does not have native support for multi-label classification. You could raise an issue over on the product GitHub repo if you like - it's also open source: https://github.com/dotnet/machinelearning.

Your other option would be to use a pre-trained TensorFlow or ONNX model that already provided this functionality. You can see an example of how to load a pre-trained model here: https://docs.microsoft.com/en-us/dotnet/machine-learning/tutorials/text-classification-tf

@JRAlexander @natke Since the last comment on this question was over a year ago, is there an update on whether ML.NET supports multi-label classification?

I'm currently pulling in my pre-trained TensorFlow model, but it would be nice to have everything under one roof.

Pinging @briacht to see if she can provide an update

Was this page helpful?
0 / 5 - 0 ratings

Related issues

svick picture svick  Â·  3Comments

FrancescoBonizzi picture FrancescoBonizzi  Â·  3Comments

LJ9999 picture LJ9999  Â·  3Comments

Eilon picture Eilon  Â·  3Comments

garfbradaz picture garfbradaz  Â·  3Comments