Skip to main content

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
1 answer
53 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
565 views

How many Non-frauds would be blocked to stop one Fraud based on the given confusion matrix?

One of the questions in a recent online test that I couldn't answer is below(I couldn't copy paste exact question, so this one is totally from memory. Kindly excuse in case of poor wording.) We have a ...
0 votes
1 answer
100 views

why my accuracy and recall become higher in testing than training. How to interpret

Why in hidden layer 2 and 3 in neural networks scratch, the accuracy and recall I got low, but in testing the accuracy and recall become higher. In hidden layer 4 it's get weird when sampling strategy ...
3 votes
3 answers
3k views

How do I calculate the range of a F1-score from a confusion matrix of 3 class,A,B,C

Is there any support function to calculate the average F1-score range?
2 votes
1 answer
3k 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 : ...
1 vote
1 answer
957 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
19 views

Finding accuracy of model that uses different labels than ground truth

I have an nlp model that has ground truth labels and predicted labels (that belong to different group of classes). For example, the ground truth labels are [art, computer science, history] and ...
0 votes
1 answer
1k 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.
0 votes
0 answers
17 views

How to interpretmulti-class confusion matrix?

I'm looking at the SAMHSA Mental Health Client-Level dataset. I did some t-SNE plots (dropping irrelevant cols, normalizing some, one-hot encoding some) of 500k rows out of 6.5mil. I'm trying to do ...
0 votes
1 answer
396 views

Unable to generate confusion matrix

I am using keras flow from directory for image segmentation. Following are my codes ...
0 votes
0 answers
31 views

Confusion Matrix exercise

everyone. While studying and working on some exercises, I found myself feeling lost and unsure about how to solve this particular problem. I'm struggling to identify the True Positives (TP), True ...
0 votes
0 answers
26 views

How many different confusion matrices?

We want to determine whether a data point belongs to the class + or −. We train a classifier using binary logistic regression. Each data point has two features, f1 and f2, which can take the values 1 ...
0 votes
0 answers
121 views

Empty Confusion Matrix and Zero Precision/F-score

Could you please say why I'm getting this warning while doing a binary classification using Artificial Neural Networks? The data are colored images. ...
2 votes
1 answer
114 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 ...
0 votes
0 answers
43 views

Finding Accuracy, Recall, Precision, and F1 from Matlab Confusion Matrix

I'm working on a project to find the highest accuracy between KNN and a Decision Tree for Classification using Matlab. How to calculate the Accuracy, Recall, Precision, and F1 from the output below? ...
1 vote
2 answers
94 views

Does a confusion matrix make sense for extraction tasks?

I'm extracting company names from text blobs. I'm trying to calculate recall. Confusion matrices makes more sense to me from a binary classification point of view, ...
1 vote
1 answer
834 views

How to calculate the training accuracy of a decision tree?

The hint given was to construct a confusion matrix.
0 votes
0 answers
35 views

warning 'newdata' had X row but variables found have Y rows

Linear Discriminant Analysis (LDA)+logistic regression model lda_model <- lda(train_labels ~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width, data = train_data) LDA scores for the training ...
0 votes
2 answers
213 views

How to improve accuracy on a single class out of 3 classes in model

I am training a classification model with 3 classes using a deep neural network. The classes have been resampled and balanced. I have around 600000 samples... equally distributed. The dataset is also ...
0 votes
0 answers
1k views

How does the background class work in object detection?

I am using YOLOv5 for object detection. I understand that any labelled classes that are not predicted, that is, false negatives (FN) shows up as background. But how are the false positive (FP) being ...
4 votes
2 answers
444 views

Does it make sense to build a ROC for a decision tree where there are multiple threshold you can adjust?

I understand building a ROC curve when the output is a probability, say, from a logistic regression model. You can build a ROC curve by varying the cutoff threshold. But what about decision trees of ...
1 vote
3 answers
2k 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',...
0 votes
1 answer
1k 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 ...
-1 votes
2 answers
128 views

Recall and Precision ML models

I use decision trees for a binary classification. To evaluate the model, I use K-fold cross-validation, where k = 10. When I run the model n times, I get a relatively constant accuracy across all ...
0 votes
1 answer
42 views

9-dimensional data classification

I have a dataset with 9 columns and 20 million rows. I have now split the dataset into two parts using IQR. One part is my inliers, the other part is my outliers. I now want to build a categorizer ...
0 votes
0 answers
14 views

One class confusion matrix notation for model evaluation

A one class classification set-up for a set of rules acting as a model, where each input is a whole dataset model makes some decision within the dataset for each entry output is decisions made for ...
3 votes
2 answers
6k views

How to read confusion matrix from multiclass dataset?

I have a dataset with multi class for classification. After train and test, tried to plot with confusion matrix. And I found it really different with dataset with simple label true false or yes no. So ...
2 votes
2 answers
1k views

Some simple questions about confusion matrix and metrics in general

I will first tell you about the context then ask my questions. The model detects hate speech and the training and testing datasets are imbalanced (NLP). My questions: Is this considered a good model? ...
9 votes
9 answers
59k views

Confusion Matrix - Get Items FP/FN/TP/TN - Python

After run my python code: print(confusion_matrix(x_test, x_pred)) I get this: [100 32 211 21] My question is how can I get the following list: True positive = ...
0 votes
0 answers
169 views

How to plot a wordCloud for essay text from a confusion matrix false positive rate count?

I have an essay of text(BOW) and I have modelled it using let's say any model and plotted the confusion matrix and that I have got FPR, I need to plot a word cloud which shows the words due to which ...
0 votes
1 answer
1k views

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

I have actual class labels and predicted class labels: ...
1 vote
1 answer
43 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 ...
3 votes
2 answers
995 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 ...
1 vote
1 answer
188 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) ...
4 votes
1 answer
275 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 ...
0 votes
2 answers
2k 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
89 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 ...
0 votes
0 answers
301 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 ...
1 vote
1 answer
222 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 ...
1 vote
0 answers
13 views

why is H2O using only a part of the data?

I have this dataframe: ...
1 vote
1 answer
2k 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-...
2 votes
2 answers
1k 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 ...
0 votes
1 answer
262 views

Confusion matrix, when mistakes below diagonal are better than above the diagonal

I have a classification problem and I am producing a confusion matrix. Ideally one wants to get all results in the diagonal. I get quite many points around diagonal for different algorithms. Still for ...
0 votes
2 answers
12k views

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

I am working on a three class problem. How do you calculate precision, recall, f-score, and MCC for each class while using MATLAB? Here is my confusion matrix: ...
3 votes
2 answers
916 views

What does the color coding and normalized values in confusion matrix actually specify?

I am unable to infer anything about the model from the following confusion matrix. What is the color coding actually specifying? For example, when predicted label is 1 and true label is 1, the value ...
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
129 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?
0 votes
0 answers
89 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
1k 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 ...
0 votes
1 answer
26 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 ...