Questions tagged [multiclass-classification]
776 questions
2
votes
1 answer
How to deal with a target variable containing nominal data?
Im working on an NLP project whose target variable contains seven unique sentences which are "inspirational and thought-provoking ", "informative", "acknowledgment and appreciations" and 4 others. As for my understanding, the target variable as we…

imtiaz ul Hassan
- 358
- 3
- 14
2
votes
1 answer
LSTM input shape error: Input 0 is incompatible with layer sequential_1
I am new to machine learning and keras. I was trying to create a LSTM model for my classification problem but I received this error: (I got few samples from internet and tried to modify them)
ValueError: Input 0 is incompatible with layer…

user9137963
- 105
- 9
2
votes
2 answers
How to create image of confusion matrix in Python
I am new to Python and Machine Learning. I am working about multi-class classification (3 classes). I want to save confusion matrix as an image. Now, sklearn.metrics.confusion_matrix() helps me to find the confusion matrix like:
array([[35, 0, 6],
…
user12136024
2
votes
0 answers
Computer Vision: Split dataset into several classes and combine them during inference
Situation: We are training a Neural Network that distinguishes between opened and closed eyes. While collecting the data we didn't simply collect opened and closed eyes but we also collected data for edgecases like eyes covered by the hand or arm…

Felix Hegg
- 367
- 2
- 14
2
votes
1 answer
Confidence estimation in SVM (one-vs-all) for multiclass-classification
When using SVM-OVR (Ove-Vs-Rest) for multiclass-classification, n classifiers are trained, with n equals to the number of classes.
The i-th classifier basically computes a binary classification between the class i and the class containing all the…

Alessandro
- 764
- 3
- 8
- 22
2
votes
1 answer
Plotting Multiclass ROC Curve
I'm new to SciKit and Python.
Currently I am trying to generate a multiclass (3 classes) ROC curve from csv file that looks like this:
probability,predclass,dist0,dist1,dist2,actualclass
…

Curerious
- 31
- 5
2
votes
1 answer
Get all evaluation metrics after classification in pyspark
I have trained a model and want to calculate several important metrics such as accuracy, precision, recall, and f1 score.
The process I followed is:
from pyspark.ml.classification import LogisticRegression
lr =…

mah65
- 578
- 10
- 20
2
votes
1 answer
Multiclassification with LightGBM
I am using latest release of LightGBM to solve a multi classification problem. When I switch the objective to "multiclass", this error occurs;
Error in data$update_params(params) :
[LightGBM] [Fatal] Number of classes should be specified and…

sametsokel
- 334
- 3
- 11
2
votes
2 answers
Multiclass classification using Categorical cross entropy - ValueError: Shapes (3, 1) and (1, 3) are incompatible
I am building a multi-class classifier on 22500 images.
The label has 3 categories - 0,1,2
I've one hot encoded the y label as follows:
y_train = tf.one_hot(y_train,3)
y_test = tf.one_hot(y_test,3)
y_val = tf.one_hot(y_val,3)
Since the size of data…

Divya Choudhary
- 75
- 3
- 8
2
votes
2 answers
ValueError: Input 0 of layer dense_1 is incompatible with the layer
I'm using tensorflow for the first time and amusing it to classify data with 18 features into 4 classes.
The dimensions of X_train are: (14125,18).
This is my code:
dataset = tf.data.Dataset.from_tensor_slices((np.array(X_train.values,…

telekineser
- 88
- 1
- 1
- 9
2
votes
1 answer
Multiclass classification with Google AutoML Tables
I am using Google autoML tables for a multiclass classification problem where the number of classes is 110. For some reasons, the learned model only predicts probabilities for 40 classes and I don't understand why. These classes being the most…

Yass Light
- 23
- 4
2
votes
1 answer
problem defining a custom metric to calculate "geometric mean score" for "tensorflow.keras"
I am working on an imabalanced classification problem in tensorflow.keras. And I decided to calculate "geometric mean score" as suggested by this answer on cross validated. I found an implementation of it in a package called imbalanced-learn and…

Naveen Reddy Marthala
- 2,622
- 4
- 35
- 67
2
votes
0 answers
Calculate Accuracy Between Machine and Human
I have build my ML model in classification task, then I want to calculate the prediction by machine, compared with prediction by human. How do I get the accuracy of machine's prediction compared with human's prediction? And how many person/s did I…

Haris Situmeang
- 29
- 2
2
votes
0 answers
proper activation function at output and loss function to optimize for OCR?
I am trying to make a CNN model on IAM handwritten words data(which has images of words handwritten by multiple people and targets are text in the images). So, I can encode words to numbers(A=0, B=1 and so on for capital, small and punctuation).…

Naveen Reddy Marthala
- 2,622
- 4
- 35
- 67
2
votes
1 answer
How to know the words associated with a specific class in NLP model?
I have trained an NLP model for "Consumer Complaints Classification" using Logistic regression algorithm and TF-IDF vectorizer. I want to know the words that my model associates with a particular class. I am looking for something like this -
Class 1…

mrigank
- 75
- 2
- 3
- 9