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
10 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
54 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
200 views

How to calculate the training accuracy of a decision tree?

The hint given was to construct a confusion matrix.
0 votes
1 answer
343 views

Unable to generate confusion matrix

I am using keras flow from directory for image segmentation. Following are my codes ...
0 votes
0 answers
10 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
1 answer
280 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
2 answers
91 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 ...
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?
0 votes
0 answers
728 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
297 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 ...
2 votes
1 answer
2k 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
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
913 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
72 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 ...
1 vote
1 answer
830 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 ...
2 votes
1 answer
101 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
1 answer
39 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
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
12 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
1k 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 ...
0 votes
1 answer
52 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 ...
2 votes
2 answers
488 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
56k 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
167 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
0 answers
111 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
1 answer
886 views

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

I have actual class labels and predicted class labels: ...
1 vote
1 answer
35 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
437 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
160 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
249 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
1k 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
79 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
271 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
172 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 ...
0 votes
0 answers
11 views

why is H2O using only a part of the data?

I have this dataframe: ...
1 vote
1 answer
1k 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
898 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
200 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
850 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
47 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
100 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
86 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
25 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
2k 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 ...
1 vote
1 answer
204 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% ...
0 votes
0 answers
2k 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
358 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: ...