Skip to main content
46 votes
Accepted

Understanding predict_proba from MultiOutputClassifier

Assuming your target is (0,1), then the classifier would output a probability matrix of dimension (N,2). The first index refers to the probability that the data belong to class 0, and the second ...
chrisckwong821's user avatar
24 votes

What does it mean to "share parameters between features and classes"

I will try to answer this question through logistic regression, one of the simplest linear classifiers. The simplest case of logistic regression is if we have a binary classification task ($y \in\{0,...
Djib2011's user avatar
  • 8,018
11 votes

How to use sklearn train_test_split to stratify data for multi-label classification?

Try this: from skmultilearn.model_selection import iterative_train_test_split X_train, y_train, X_test, y_test = iterative_train_test_split(x, y, test_size = 0.1) ...
chenjesu's user avatar
  • 221
10 votes
Accepted

What is the formula to calculate the precision, recall, f-measure with macro, micro, none for multi-label classification in sklearn metrics?

Generally, the scoring metrics you are looking at are defined as following (see for example Wikipedia): $$precision = \frac{TP}{TP+FP}$$ $$recall= \frac{TP}{TP+FN}$$ $$F1 = \frac{2 \times precision \...
Jonathan's user avatar
  • 5,450
7 votes

Multi-class neural net always predicting 1 class after optimization

It could be a bug in your code, problems with your training set (maybe you don't have the file format quite right), or some other implementation issue. Are you sure you want to use a sigmoid ...
D.W.'s user avatar
  • 3,401
7 votes

Understanding predict_proba from MultiOutputClassifier

In the MultiOutputClassifier, you're treating the two outputs as separate classification tasks; from the docs you linked: This strategy consists of fitting one ...
Ben Reiniger's user avatar
  • 12k
6 votes
Accepted

Dealing with extreme values in softmax cross entropy?

Where exactly in the computations are these underflows manifesting? See here for a brief explanation around the extremes of the softmax. Quick fixes could be to either increase the precision of your ...
n1k31t4's user avatar
  • 15k
5 votes

Multi-class neural net always predicting 1 class after optimization

You learn a lot by comparing to a naive model. A naive model is one without any features. As a default, it will always predict the most likely Target. Note that this is exactly what your model is ...
Paul's user avatar
  • 255
5 votes
Accepted

Deep Learning with Spectrograms for sound recognition

RNNs were not producing good enough results and are also hard to train so I went with CNNs. Because a specific animal sound is only a few seconds long we can divide the spectrogram into chunks. I ...
user667804's user avatar
5 votes
Accepted

Class weight degrades Multi Label Classification Performance

Adding class weight but not changing the way you measure performance will usually degrade overall performance as it is designed to allow increased loss on lower-weighted classes. I would recommend ...
jshep's user avatar
  • 393
5 votes

How to use sklearn train_test_split to stratify data for multi-label classification?

The error you're getting indicates it cannot do a stratified split because one of your classes has only one sample. You need at least two samples of each class in order to put one in the training ...
Wes's user avatar
  • 692
5 votes
Accepted

Understanding `get_combination_wise_output_matrix` when investigating a multi-label classification problem

So order here means how many possible combinations of labels you want to compare (e.g., order=1 would by how often does each label appear, ...
Alexander Ruch's user avatar
5 votes
Accepted

Multiple classes present in one-hot encoding

Yes, it is possible to do it exactly as you describe it. This is called multilabel-classification. If doing so, you would treat each element of the output as an independent prediction of a binary ...
Broele's user avatar
  • 1,642
4 votes

Deep Learning with Spectrograms for sound recognition

For automatic speech recognition (ASR), filter bank features perform as good as CNN on spectrograms Table 1. You can train a DBN-DNN system on fbank for classifying animals sounds. In practice ...
arduinolover's user avatar
4 votes

Multi target classification for different types of target variables

You have one classification task and one regression task, but sklearn's multioutput meta-estimators only support two tasks of the same type. The best solution here is to train two models: A binary ...
Imran's user avatar
  • 2,381
4 votes
Accepted

Where can I find freely available multi-label datasets online?

You can find a complete repository of around 80 multi-label datasets here :
Eva Gibaja's user avatar
4 votes
Accepted

Multi-label classification model in python?

First of all you would need to encode your target columns.We can use sklearn.preprocessing.MultiLabelBinarizer here: ...
MaxU - stand with Ukraine's user avatar
4 votes
Accepted

What's the difference between multi label classification and fuzzy classification?

Multi-label classification (Wiki): Given $K$ classes, find a map $f:X \rightarrow \{0, 1\}^K$. Fuzzy classification (a good citation is needed!): Given $K$ classes, find a map $p: X \rightarrow [0, ...
Esmailian's user avatar
  • 9,382
4 votes

Transform multi-label problem to multi-class problem

A multi-label problem is when an instance can have several labels, for instance a system which classifies news articles by topic could do this: instance 1: politics, society instance 2: sports ...
Erwan's user avatar
  • 25.7k
4 votes

How to get feature importance from RandomForest using scikit-multilearn library?

First, to directly answer your question, the easiest way to get Feature Importance using scikit learn is this, where model is the variable holding your classifier. ...
Preston Badeer's user avatar
4 votes
Accepted

How to trust the labels generated using ML models?

So when we generate labels via machine learning models like clustering above, is it a recommended approach? Only if you can really make highly distinct 2 clusters/groups. This will be highy unlikely, ...
Noah Weber's user avatar
  • 5,729
4 votes

How can I label (predict) an unseen set of data based on an existing model?

You need to use the same preprocessing elements (dictionary etc) that you used to create your tfidf matrix during training when you come to apply your model to unseen data. Do not create a new ...
Nicholas James Bailey's user avatar
3 votes
Accepted

Using tensorflow for any type of dataset

TensorFlow is a general purpose library for numerical computation using data flow graphs. It is primarily used for neural networks but can be used for any mathematical operations on multidimensional ...
Brian Spiering's user avatar
3 votes

Multi-class text classification with LSTM in Keras

After I read the source code, I find out that keras.datasets.imdb.load_data doesn't actually load the plain text data and convert them into vector, it just loads ...
Icyblade's user avatar
  • 4,356
3 votes

How do you calculate Precision and Recall using a confusion matrix in Matlab?

if yHat are your predictions and yval are your y true then ...
Martin Forte's user avatar
3 votes

Where can I find a crowdsourced dataset for multi-label classification with individual participant labels?

I'll think you'll find what you're looking for in this question on Open Data. I've checked the Pew Research Center data, and found this poll about cyber-security that seems to be something like what ...
shakedzy's user avatar
  • 699
3 votes

How to use Automated Labelling for documents?

Semi-supervised learning. You label 1% manually, let the algorithm learn, then it labels unknown data, learns from it and labels again.
keiv.fly's user avatar
  • 1,289
3 votes
Accepted

Why does averaging a sentence's worth of word vectors work?

It works for the same reason why the good old bag-of-words + TF-IDF works. Despite loosing some word ordering information, a text can be still classified by the typical keywords. Since texts on ...
Dmytro Prylipko's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible