Giter Club home page Giter Club logo

Comments (4)

kajdanowicz avatar kajdanowicz commented on May 21, 2024 1

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.

iromise avatar iromise commented on May 21, 2024

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.

ljvmiranda921 avatar ljvmiranda921 commented on May 21, 2024

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.

niedakh avatar niedakh commented on May 21, 2024

Couple of notes in general.

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

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

  1. 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.