Comments (4)
Hello,
It is probably caused by the fact that the underlying base classifier within the br is not able to handle one class data. You have only one unique class label in the training set present.
The error message tells that you need to have at least two unique classes in the dataset.
In case of one class label try to use OneClassSVM
from scikit-multilearn.
yes, the problem is just as you say, but not all the column is one class, and I'd like to use a supervised method, is there any way to use the svc with br? thanks.
from scikit-multilearn.
Hi, I encountered this problem before. It's expected behavior because the classifier is expecting multi-class data. Although we have OneClassSVM, not all of our data is one-class.
In my case, I have a routine that just prunes these one-label columns and run a traditional classifier (like LinearSVM or SVM from sklearn) on it.
from scikit-multilearn.
Couple of notes in general.
- Usually a one class column in a multi-label problem's training set means that the training set has been poorly stratified, see http://proceedings.mlr.press/v74/szyma%C5%84ski17a.html and some cited work especially the 2011 paper of Sechidis et. al.
So before you get to oneclasssvm, remember to explore your train-test split and see if you are actually doing this (forcing the model to learn in tough conditions) on purpose or not.
- if you really have no positive evidence for a label, and you are using binary relevance - thus ignoring label relations, you should just split the model, train one binary relevance classifier for the labels where you have both positive and negative evidence, and another - using ex. oneclasssvm as base classifier - for the other labels - and just merge them back.
I will put this bug into the future work column - perhaps we'll implement a wrapper or something in the future, closing for now.
- the trickiest case is when the one class label is actually related to something, i.e. there's a mode of distribution depending on it, that's where you probably need to write a wrapper.
from scikit-multilearn.
Related Issues (20)
- predict_proba() with LinearSVC as classifier HOT 1
- MLkNN breaks when sklearn >= 1.0 HOT 3
- Random state parameter doomed to fail in IterativeStratification HOT 3
- how meka classifier can use predict_proba?
- IterativeStratification use in medical and some datasets ValueError: Only one class present in y_true. ROC AUC score is not defined in that case HOT 1
- Proposal for small bug resolval in MEKA wrapper HOT 1
- smaller support in function "_get_most_desired_combination"
- Upgrade to tensorflow 2
- ditch python 2
- Some tests are failing
- model_selection/iterative_stratification.py throws AttributeError: 'numpy.ndarray' object has no attribute 'iloc' HOT 2
- Next release to Pypi HOT 9
- Shuffle data in `iterative_train_test_split` beforehand (with solution) HOT 8
- how to implement kernal trick in MLTSVM
- fit() method for ChainClassifier() doesn't save classifiers in self.classifiers_ dictionary
- Incorrect link on authors page in the docs
- refer to igraph instead of python-igraph in docs
- `skmultilearn.dataset` missing `arff` dependency
- Performance on the MEKA wrapper
- iterative_train_test_split assumes dataframe when numpy array is allowable HOT 1
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 scikit-multilearn.