Skip to content

Multi Label Classifier sample #5385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ronbutan opened this issue May 15, 2018 — with docs.microsoft.com · 20 comments
Closed

Multi Label Classifier sample #5385

ronbutan opened this issue May 15, 2018 — with docs.microsoft.com · 20 comments

Comments

Copy link

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.

@mairaw
Copy link
Contributor

mairaw commented May 15, 2018

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

@aditidugar-zz
Copy link
Contributor

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.

@brendankowitz
Copy link

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

@mairaw
Copy link
Contributor

mairaw commented May 16, 2018

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

@aditidugar-zz
Copy link
Contributor

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.

Copy link
Author

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.

@aditidugar-zz
Copy link
Contributor

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!

Copy link

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

@aditidugar-zz
Copy link
Contributor

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.

Copy link

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

@JRAlexander JRAlexander added this to the Backlog milestone Sep 11, 2018
Copy link

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

@JRAlexander
Copy link
Contributor

@slarrieu
Copy link

slarrieu commented Jun 5, 2019

@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?

@Lukaa0
Copy link

Lukaa0 commented Jun 8, 2019

Any update on this?

@marchy
Copy link

marchy commented Oct 16, 2019

@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)

@natke
Copy link
Contributor

natke commented Oct 16, 2019

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

@hjoshuaj
Copy link

@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.

@mairaw
Copy link
Contributor

mairaw commented Dec 12, 2020

Pinging @briacht to see if she can provide an update

@TusharMalap
Copy link

Pinging @briacht to see if she can provide an update

Hey is there way I can achieve hierarchical classification in ml.net?

@PRMerger18 PRMerger18 added the Pri2 label Mar 4, 2022
@lockhartsoftware
Copy link

Does ML.Net support multi-label classification?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests