Questions tagged [confusion-matrix]

A confusion matrix is a special contingency table used to evaluate the predictive accuracy of a classifier. Predicted classes are listed in rows and actual classes in columns, with counts of respective cases in each cell.

Filter by
Sorted by
Tagged with
0 votes
0 answers
25 views

High Recall and Low Precision for Binary CNN model

I was training a CNN model for binary classification. The training and validation accuracy seemed good. However, the precision is low and the recall is high (High false positive). ...
0 votes
0 answers
39 views

Multi-class classification MLP not working as it should

I'm trying to building a MLP. After executing the accuracy is 87,35%. I thought i was having good results. However, when painting the confussion matrix and the classification report i see the accuracy ...
0 votes
0 answers
94 views

Why does Vertex AI's Confusion Matrix data decreases as I increase confidence threshold?

This is a binary classification AI. To me, it does not make sense for the total data in the Matrix to decrease. After all, the system only has 4 options (True Positive, True Negative, False Positive, ...
1 vote
1 answer
25 views

What are valid measures for reporting k-fold score in the case of confusion-matrix?

I know when model is made to predict a float value, a common approach to report the models validation is using k-fold technique and calculating the average of all folds accuracy (here is a similar ...
  • 11
3 votes
2 answers
167 views

Precision, recall and importance of them in the imbalance problem

I have a test dataset. The dataset is an imbalanced dataset. The total training instances for the dataset is 543 among them minority class(yes) is 75 and the majority class(No) is 468. The class of ...
  • 359
4 votes
1 answer
187 views

Error rate of a class from confusion matrix

My professor gives a multiclass confusion matrix and asks for the error rate of a certain class. Unfortunately, the professor refuses to give a definition. I think the closest value to an error rate ...
  • 143
0 votes
2 answers
645 views

What mean a column in zero in confusion matrix?

When training my model and reviewing the confusion matrix, there are completely zero columns for each specific category, what does this mean, is there an error or how do I interpret it? I use the ...
1 vote
0 answers
65 views

Azure AutoML: decimal numbers in confusion matrix

I have been running Azure AutoML on a binary classification task. When I visualize the performance and the confusion matrix in particular, I observe the following: How can I have decimal numbers in ...
  • 111
0 votes
0 answers
192 views

how to reduce overfitting and improve confusion matrix

I am trying to apply the following model on my data which is consists of (4030 samples as 5 classes) each sample is MFCC features which is extracted from an audio clip consisting of (20 second) and I ...
  • 27
1 vote
2 answers
953 views

How to add class labels to confusion matrix of multi class classification

How do I add class labels to the confusion matrix? The label display number in the label not the actual value of the label Eg. labels = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',...
  • 23
1 vote
1 answer
104 views

How can I use a confusion matrix in image captioning?

I read that a confusion matrix is used with image classification but if I need to draw it with image captioning how to use it or ...
  • 57
0 votes
0 answers
11 views

why is H2O using only a part of the data?

I have this dataframe: ...
  • 500
1 vote
1 answer
95 views

Deep Learning accuracy vs Confusion Matrix accuracy

I am working on deep learning with fer2013 dataset. After training the model I got val_precision: 0.9168 (precision: 0.8492) ...
  • 113
1 vote
1 answer
517 views

specificity for 3 class

I was reading an answer in qoura to calculate the specificity of a 3 class classifier from a confusion matrix. In the below answer https://www.quora.com/How-do-I-get-specificity-and-sensitivity-from-a-...
  • 125
2 votes
2 answers
605 views

How to balance sensitivity(sn) and specificity(sp) of an Artificial Neural Network model?

I have been working on a binary classification problem of protein sequences. I have used a feed-forward neural network with two hidden layers. I have the training and validation accuracy/loss curves ...
1 vote
1 answer
612 views

Difficulties in create a confusion matrix in R for Yes or No

I am new to regression and confusion matrix and trying to create a confusion matrix from logistic binary regression model. I am trying to create a confusion matrix from Yes or No values from the ...
0 votes
0 answers
31 views

Logistic Regression test accuracy vs deployment

I am working on a problem where I make some weekly predictions. I gathered the data myself and did some pre-processing steps and I end up with 6 features. I split the dataset 60-20-20 in train, ...
0 votes
1 answer
36 views

Discrepancy between cross-validation and un-seen data predictions

I am facing an issue with an imbalanced dataset. The dataset contains 20% targets and 80% non-targets. I am expecting a confusion matrix below when I give un-seen data to the trained model. ...
0 votes
1 answer
65 views

What happens to auc when true positive rate grows

How does change in true positive rate affects AUC? Does increase of TPR lead to increase of AUC as well?
  • 183
2 votes
1 answer
967 views

Plotting confusion matrix for multi classification problem

I am using google colab to solve a multi-classification problem. I am trying to plot the confusion matrix for this problem, I have tried doing so using : ...
  • 45
0 votes
0 answers
70 views

Can you use a Confusion Matrix for a image detection problem?

I have read the classic examples of using a Confusion Matrix for a classification problem. ("Does a patient have cancer, or not?) The ML system I am working with is for detecting objects in an ...
1 vote
1 answer
710 views

Confusion matrix - one class with zero values

I'm applying the Random Forest classifier on a dataset with 645 records and 12 features (selected by KBest method). This dataset contains a class with 4 possible values (1..4). When I plot the ...
  • 21
0 votes
1 answer
22 views

Should I consider unreadable records in confusion matrix while calculating accuracy?

I have 6 classes in my dataset and model. Dataset is regarding ECG signal Having x number of records for each of these classes. The confusion matrix looks like this - My question is, should I ...
1 vote
1 answer
1k views

In multi-class, is the average accuracy of each class in confusion metrics equal to the accuracy calculated from cross validation?

When I calculate accuracy through cross-validation, it gives me a different accuracy than when I calculate through confusion metrics. Why does it give different accuracy? Is overall calculated ...
  • 21
1 vote
1 answer
148 views

Imbalanced classification task – Discrepancy between learning curves and test set evaluation

I have a binary classification task related to customer churn for a bank. The dataset contains 10,000 instances and 11 features. The target variable is imbalanced (80% remained as customers (0), 20% ...
  • 67
0 votes
0 answers
1k views

How to track loss and accuracy in PyTorch?

I have made model and it is working fine for the MNIST dataset but further in the assignment it says to track loss and accuracy of the model, which I do not know how to do it. I have also written some ...
0 votes
1 answer
219 views

Confusion matrix with different levels

I want to print a confusion matrix, but data and reference have not the same level. How can I do? this is my actual code: ...
  • 471
2 votes
1 answer
397 views

Is it possible to combine two confusion matrices?

Assume I have two different algorithms that tests whether a given image contains a goat or not. I apply these two algorithms to two different datasets and obtain two confusion matrices. Now I want to ...
  • 123
4 votes
1 answer
457 views

How to create a confusion matrix for k-means with two features?

I have the need to do a confusion matrix for data run through k-means with two features. I am aware that this is a clustering algorithm and not a classification algorithm but I have seen some ...
0 votes
1 answer
596 views

How do I calculate precision, recall, specificity, sensitivity manually?

I have actual class labels and predicted class labels: ...
0 votes
2 answers
35 views

Confusion matrix terminology

I am working on machine learning with a supervised problem with 2 classes: NO and YES, and I need some precision about confusion matrix. I read 2 differents terminologies, some writes matrix confusion ...
3 votes
3 answers
379 views

How are scores calculated for each class of binary classification

The formula for Precision is TP / TP + FP, but how to apply it individually for each class of a binary classification problem, For example here the precision, recall and f1 scores are calculated for ...
1 vote
1 answer
102 views

Comparison of classifier confusion matrices

I tried implementing Logistic regression, Linear Discriminant Analysis and KNN for the smarket dataset provided in "An Introduction to Statistical Learning" in python. Logistic Regression ...
1 vote
0 answers
26 views

Confusion matrix of 3*2

I would like to include confusion matrix in my research report. I have a binary classification problem. The positive class is further divided into two types for example: Real Positive and Obstruction ...
  • 21
0 votes
1 answer
264 views

Unable to generate confusion matrix

I am using keras flow from directory for image segmentation. Following are my codes ...
1 vote
0 answers
25 views

Recall/Precision Metrics on Azure AutoML seem to be oriented to majority class, and I'm trying to focus on minority class

I am running some experiments in Azure using AutoML. My problem is a binary classification one, with highly imbalanced classes (basically trying to predict what factors make a deal "WON" ...
0 votes
1 answer
37 views

Confusion matrix and accuracy not in sync

I am getting the following result for the confusion matrix and accuracy for a logistic regression model. ...
  • 1
0 votes
1 answer
675 views

Viewing false positive rows in python

I got values for the confusion matrix using: tn, fp, fn, tp = confusion_matrix(y_true, y_pred).ravel() 10000 13000 500 1500 Now, I wish to see what data is in the ...
  • 13
0 votes
1 answer
168 views

How is there an inverse relation between precision and recall?

What I know? Firstly, Precision= $\frac{TP}{TP+FP}$ Recall=$\frac{TP}{TP+FN}$ What book says? A model that declares every record has high recall but low precision. I understand that if predicted ...
1 vote
1 answer
51 views

Classification report and confusion matrix problem

I am working on sign language recognition system using HOG and KNN. I have 26 classes of 180 images per class. The dataset was split into 1/3(67%) for tanning and 2/3(33%) testing after feature ...
  • 23
0 votes
3 answers
226 views

Confusion Matrix before and after SMOTE is same

I am working with a very unbalanced dataset and I used SMOTE (for training data only). However, I did not understand why the results before and after SMOTE are the same. The attached confusion matrix ...
  • 45
0 votes
1 answer
966 views

Good model but bad confusion matrix?

I am trying to understand the code here. The output [12] shows that the model accuracy is above 90% even for the validation set, but the confusion matrix in [16] ca not even achieve 50% accuracy, and ...
  • 31
2 votes
1 answer
79 views

Why rejection of a true null hypothesis is called type I error?

I’m comparing two confusion matrices: https://en.wikipedia.org/wiki/Confusion_matrix#Table_of_confusion https://en.wikipedia.org/wiki/Type_I_and_type_II_errors The 2nd is rotated, the Decision is on ...
  • 21
1 vote
0 answers
38 views

How to interpret the confusion matrix and compare the result of features extraction with LBP and Haralick

I'm begginer in deep learning so I tried to execute a code of liveness face detection from github in this link :https://github.com/imironica/liveness , so when I tried to run features extraction with ...
3 votes
1 answer
673 views

How to create a confusion matrix for one node of a decision tree?

I am doing past papers for my data science exam and was curious about one of the questions. They ask us to create a confusion matrix by hand for one node of a decision tree. I understand how to create ...
1 vote
1 answer
668 views

What do you do with one hot encoding items that are a non-match for all classes in a confusion matrix?

I have trained a model for one-hot binary prediction for many classes, and am now applying it to the testing set of samples. However, a lot of the predictions for samples are 0 for every class. I'm ...
  • 13
0 votes
2 answers
941 views

Warning when plotting confusion matrix with all sample of one class

I have two arrays: the first one with all the correct labels (they are all set to zero since each sample belong to the same class) and another one with all the labels predicted by my neural network. ...
  • 53
5 votes
1 answer
105 views

Suitable metric choice for imbalanced multi-class dataset (classes have equal importance)

What type of metrics I should use to evaluate my classification models, given that I have two imbalanced multi-class datasets (21 and 16 classes, respectively) where all classes have equal importance? ...
  • 238
0 votes
1 answer
581 views

Weighted accuracy, sensitivity and specificity

I have a confusion matrix TN= 27 FP=20 FN =11 TP=6 I want to calculate the weighted average for accuracy, sensitivity and specificity. I know the equation but unsure how to do the weighted averages.
1 vote
1 answer
96 views

How do I calculate the accuracy for graph mining in terms of (top 1%)?

I have 3600 samples in my dataset. I split the dataset into the train (2700) and test (900). My problem is related to ...