Comments (9)
What if I have multi-label classification problem + I want to evaluate my eval dataset via "f1" + specific average strategy like 'weighted' or 'micro' ? Is it supported ?
from setfit.
Currently, we support any classification metric from the
evaluate
library: https://huggingface.co/docs/evaluate/index
@lewtun one limitation though seems to be that in case of non binary labels there is no way to pass an average strategy. this would need to happen here
Line 303 in a06be0e
So in those cases you need to fallback to accuracy or write your own trainer. Would it be in scope to support those evaluations? I am happy to open a PR for this.
from setfit.
assuming I'm not missing something major, this seems like an easy fix. here's my current implementation that I'm testing. happy to start a formal PR for this if desired @lewtun
https://github.com/huggingface/setfit/compare/main...jmwoloso:setfit:fix_multilabel_metrics?expand=1
EDIT: haven't added tests or anything which i'd need to do, etc. to make this a formal PR which i'm happy to do; this is just to unblock me from using SetFitTrainer
at the moment
from setfit.
You can use "accuracy"
or "f1"
(now fully supported for multi-label by also using metric_kwargs
) as simple low-effort solutions to evaluation, but you can also provide a function if you'd like. See this for more information:
Lines 43 to 48 in b503c0b
I think this should allow for as much flexibility as is required, so I'll close this.
- Tom Aarsen
from setfit.
Hi @snayan06 thanks for your interest in setfit
! Although accuracy
is the default metric, you can specify a different one when you create the SetFitTrainer
, e.g.:
from setfit import SetFitTrainer
trainer = SetFitTrainer(model=model, train_dataset=train_dataset, metric="f1")
Currently, we support any classification metric from the evaluate
library: https://huggingface.co/docs/evaluate/index
from setfit.
ok thanks for answering , was just looking to contribute and thought that was not there in setfit, and would have been helpful to add. thanks to pointing to the the library as well.
from setfit.
Is there any way u guys track features and people can contribute to build these features, or it is just in the issues , new to open source but have been using huggingface/sbert models from a long time and thought if i can contribute in some way that would be good.
from setfit.
shouldn't this line in the same file (and method) handle multi-label though?
Line 295 in a06be0e
from setfit.
I was wondering if there have been any updates as regards computing other metrics for multi label output?
from setfit.
Related Issues (20)
- ValueError: Multioutput target data is not supported with label binarization
- Mis-alignment between Sentence Embeddings and Classifier in multi-label classification ?
- EarlyStoppingCallback early_stopping_patience_counter and Trainer.state not reset between hyperparameter search trials HOT 1
- Custom TF classification head HOT 2
- `TypeError: __init__() got an unexpected keyword argument '_name_or_path'` for `SetFitModel.from_pretrained` HOT 4
- TemplateAssertionError: no test named 'False' HOT 2
- Can we use Setfit just for finetuning ST Embedding model to create embeddings HOT 2
- MultiGPU support or better intergration for loading models HOT 1
- i found a typo in docs HOT 1
- Methodological error in zero cost, zero time, zero shot notebook HOT 2
- Usage of deprecated `evaluation_strategy` in TrainingArguments HOT 1
- Data validation when using differentiable_head
- Can you please add an example with early stopping based on classification loss?
- how to optimize setfit inference
- exception:enum PyPreTokenizerTypeWrapper, while loading the fine-tuned model for evaluation HOT 7
- Regarding expanding the label column
- Setfit can't doing model prediction after training for MultiClass Classification with hf Trainer HOT 1
- Item taxonomy generation
- The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
- Possibility to monitor head training?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from setfit.