Questions tagged [multiclass-classification]

776 questions
2
votes
1 answer

How to get probability of each class instead of one hot encoded array with one value 1 and others 0?

My Sequential CNN model is trained on 39 classes as a multi-class classifier. As for predictions, it returns a one-hot encoded array like [0,0,...1,0,...] whereas I want something like [0.012,0.022,0.067,...,0.997,0.0004,...] Is there a way to get…
2
votes
0 answers

Keras model for multiclass classification is not learning for different parameters

I´m new to the area of Data Science and especially to the topic of modeling a neural network in RStudio. I´m trying to do multiclass classification using a simple Keras dense network and predict 5 classes with it. My total dataset is 12 input…
fquante
  • 21
  • 3
2
votes
1 answer

Calculating mean per class accuracy in Multi class classification Problem?

I am using multi class classification problem and solved using XGBoost. Number of unique classes are 7. I Got Classification report with each class Precision, Recall and F1 score. I did not have any coding clue to try on this in Python. I need Mean…
rba
  • 77
  • 1
  • 2
  • 7
2
votes
3 answers

Cleveland heart disease dataset - can’t describe the class

I’m using the Cleveland Heart Disease dataset from UCI for classification but i don’t understand the target attribute. The dataset description says that the values go from 0 to 4 but the attribute description says: 0: < 50% coronary disease 1: >…
2
votes
0 answers

Multiclass classification by One-Vs-Rest and Gradient Boosted Tree Classifier

I would like to build a Gradient boosted tree classifier by PySpark, for multiclass classification task. I have tried: gb = GBTClassifier(maxIter=10) ovr = OneVsRest(classifier=gb) ovrModel = ovr.fit(trainingData) gb_predictions =…
Simone
  • 4,800
  • 12
  • 30
  • 46
2
votes
1 answer

How not to let one hyperplane affect decision in multiclass linear kernal SVM?

I am using linearsvc from scikit for a 3-class dataset. Using one-vs-rest (default) strategy, I get exactly 3 hyperplanes weights vectors each of size number_of_features_in_dataset. Now, final prediction is based on combination of all 3 hyperplanes…
2
votes
1 answer

How to calculate the average value of Accuracy, FPR, FNR in a multiclass classification in Python?

I'm working on multi-class classification in python (4 classes). To obtain the results of each class separately, I used the following code: from sklearn.metrics import confusion_matrix cm = confusion_matrix(y_test, y_pred) cnf_matrix = cm FP =…
2
votes
1 answer

Error multiclass text classification with pre-trained BERT model

I am trying to classify text in 34 mutually exclusive classes using Google's BERT pre-trained model. After preparing the "train", "dev" and "test" TSV files which BERT expects as input, I try to execute the following command in my Colab (Jupyter)…
2
votes
0 answers

How to choose metrics for evaluating classification results?

Recently we have developed a python library named PyCM specialized for analyzing multi-class confusion matrices. A parameter recommender system has been added in version 1.9 of this module in order to recommend most related parameters considering…
2
votes
1 answer

How would a multiple output classification neural network work?

I currently understand and made a simple neural network which solves the XOR problem. I want to make a neural network for digit recognition. I know using MNIST data I would need 784 input neurons, 15 hidden neurons and 10 output neurons (0-9).…
2
votes
1 answer

Retrieve non zero class probabilities from predict_proba()

I want to retrieve only the non zero class probabilities. My code below keeps generating the following error print(clf.predict(xtest)) pp = clf.predict_proba(xtest)[0] pp[:] = ([ind,value] for ind,value in enumerate(pp) if value > 0) for ind,val…
2
votes
1 answer

Up-/downsampling with One vs. rest classifier

I have a data set (tf-idf weighted words) with multiple classes that I try to predict. My classes are imbalanced. I would like to use the One vs. rest classification approach with some classifiers (eg. Multinomial Naive Bayes) using the…
2
votes
1 answer

Reference group in PySpark multinomial regression

Does anyone know what the default reference group is in a Pyspark multinomial logistic regression. For instance, we have multiclass outcomes/target of A, B, C, and D. How does spark choose the reference category? In standard logistic regression in…
2
votes
1 answer

Multi-Output Classification with Keras

I am using keras to build a multi-output classification model. My dataset is such as [x1,x2,x3,x4,y1,y2,y3] x1,x2,x3 are the features, and y1,y2,y3 are the labels, the y1,y2,y3 are multi-classes. And I already built a model (I ingore some hidden…
2
votes
1 answer

Why is F1 measure effective for evaluating multiclass classifiers?

I was looking for a good error metric for multiclass classifiers, and many people say that F1 measure is usually used. But given that predictions of multiclass classifiers are one-hot vectors, doesn't it mean there are no true positives when the…