# 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.

72 questions
Filter by
Sorted by
Tagged with
49 views

### What is sensitivity in confusion matrix?

A confusion matrix is a table that is often used to describe the performance of a classification model (or "classifier") on a set of test data for which the true values are known. The confusion matrix ...
10 views

### Change number format of confussion matrix

I have the following confusion matrix: I would like to change the format of the numbers that, when they exceed the value 99, appear in scientific format. I would like them to appear in a standard ...
18 views

### Constructing the Confusion matrix from given metrics

I am given the following metrics for a certain classifier : -Total number of cases in the dataset = 110 -Accuracy: 92.7% -Precision : 96.9% -Recall : 95% Are this information enough to ...
25 views

### Problem creating confusion matrix for a CNN

I am doing image classification with and I have a training set of 3200 images and a test set of 800 images. My code is this: ...
32 views

### Is there a common strategy to measure if a difference-significance of two areas under two ROC curves

I conduct sound detection experiments with mice. I have a stimulus sound and a "noise" sound that shoukd be ignored. I want to measure how well the mouse ignors the noise (with respect to, say, ...
8 views

### fourfoldplot not displaying size and colors correctly with numbers in column labels

If I use a sample table, like so: ctable <- as.table(matrix(c(42, 6, 8, 28), nrow = 2, byrow = TRUE)) and plot with ...
27 views

### To calculate my confusion matrix with recall and precision, my test set need to be equal(balanced)?

In my CNN, I have 200 'negative' images and 50 'positive' images in my test set and I want to make a confusion matrix. My doubt is if I have to equalize the samples in the dataset because if I keep ...
8 views

### Precision-Recall for CNN place recognition problem

Given 3450 query and 3450 reference images in a place recognition problem, I plot the ...
54 views

### how can I replicate working of Multi Label Binarizer from sklearn package in R?

I want to achieve same working of MultiLabelBinarizer from sklearn.preprocessing package in R. I have list of labels for each example (for Predicated and Actual) like below. ...
219 views

### Confusion matrix - determine the values of FP FN TP and TN

After running my code ,I get the values of accuracy, precision and recall and I want t determine the values of FP FN TP and TN from these metrics. I tried to calculate it using the formula of each ...
63 views

### True positives and true negatives, F1 score: multi class classification

I have 4 classes for an application of classification of animal kingdom: 1 --> invertibrates; 2 --> vertibrates; 3--> mammal; 4 ---> ambhibian. Given a mixture of images the objective is to identify ...
278 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?
88 views

### What does the KFold error mean and how to get confusion matrix from Kfold random forest implementation?

from sklearn.model_selection import KFold num_folds = 10 seed = 77 kf = KFold(n_splits=num_folds,random_state=77,shuffle=False) rfc=RandomForestClassifier(...
77 views

### Do I use class weights to penalize false negatives or threshold optimization to improve recall?

I built a Random Forest model for a binary classification problem.Both the classes in the target variable are balanced. My main class of interest is 'class 1'. False negatives are more costly to me, ...
60 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 ...
65 views

### For a multiclass classification problem, how do we find the cohen kappa score?

So I have a multiclass classification problem and I have found the Matthews Correlation Coefficient of that (https://scikit-learn.org/stable/modules/model_evaluation.html#matthews-correlation-...
401 views

### Comparing multi-class results with binary classification results

We used machine learning to discriminate the following five disease classes: Normal (N) Myocardial Infarction (MI) Coronary Artery Disease (CAD) Congestive Heart Failure (CHF). In the past, these ...
85 views

### Why is the random forest confusion matrix for my test dataset 100% accuracy, when training data matrix isn't?

I am using the software Orange to undertake a random forest classification of geo-chemical data. I am trying to classify points as 0 or 1 based on whether it is a mineral occurrence or not. My ...
269 views

### Improving the results of CNN [closed]

Edit 2 I solved my problem. The issue was caused by the validation_generator. I used the method flow_from_directory with shuffle = true. By changing the value to false and calling the method ...
79 views

### Is this analysis good or not?

I am doing a project in plant pest detection using CNN. There are four classes each having about 1000 images.I have use alexnet architecture for training. I think confusion matrix is not correct. What ...
90 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 ...
1k views

### Inverse Relationship Between Precision and Recall

I made some search to learn precision and recall and I saw some graphs represents inverse relationship between precision and recall and I started to think about it to clarify subject. I wonder the ...
533 views

### Confusion matrix logic

Can someone explain me the logic behind the confusion matrix? True Positive (TP): prediction is POSITIVE, actual outcome is POSITIVE, result is 'True Positive' - No questions. False Negative (FN): ...
53 views

### How to build confusion matrix , when predicted value and actual value is in sentence?

I am building some model, which predict on basis of highest probability from history and I am assuming this is best action. I am comparing this with real action. Predicted : process resumed ...
361 views

### Confusion matrix in multilabel classification of an object in more than one class simultaneously

Regarding a classification problem where for example given an image which depicts a human and we are trying to predict their stance and their behavior. For example Human 1: 'Sitting' and 'Eating' in ...
202 views

### Should I oversample my validation data to get better F1 score and PRC?

I am currently working with a dataset that is imbalanced, about 30k rows * 14 features (just for you know), and 99.5% of the data is labeled 0. Since the model is strongly imbalanced I decided to use ...
4k views

### Continuous variable not supported in confusion matrix

I am using linear regression algorithm for a data set. And trying to compute confusion matrix between y_pred and y_test. I am getting ...
840 views

### Confusion matrix plot with python

I'm for a function that can plot the following plot using python:
85 views

### Can Expectation Maximization estimate truth and confusion matrix from multiple noisy sources?

Suppose we have $m$ sources, each of which noisily observe the same set of $n$ independent events from the outcome set $\{A,B,C\}$. Each source has a confusion matrix, for example for source $i$: ...
9k views

### Confusion Matrix three classes python

I want to calculate: True_Positive, False_Positive, False_Negative, True_Negative for three categories. I used to have two classes ...
270 views

### Hands on Machine Learning with Scikit Learn and TensorFlow Confusion Matrix with VERY BAD score [closed]

I followed the steps EXACTLY in the Hands on Machine Learning with Scikit Learn and TensorFlow ch. 3. But the confusion matrix for the multinomial classifier is very very bad. Even though the book ...
83 views

### Confusion Matrix

Here is my question in my assignment: You have built a classification model with 90% accuracy but your client is not happy because False Positive rate was very high then what will you do? This ...
126 views

### How to decide optimal threshold for my classification model from FPR, TPR and threshold

I am building my model in Python to classify customer in buyer/ non-buyer category. I used mutiple agorithms for this problem and then after evaluation selecting the best out of all. sklearn package ...
373 views

### Confusion Matrixs for Binary classifier

I am new to modeling, and I am practicing building a logistic regression model. I would like to create a confusion matrix, but my code doesn't seem to work. Here is the code for the model (which ...
122 views

### How to best estimate the coefficients of a confusion matrix in case of strong class imbalance?

I have a trained binary classifier (forget about how this was trained and think of it as a magical black box) and I would like to measure its classification performance (e.g. compute a confusion ...
418 views

### Is it possible to find a model that minimises both false positive and false negative?

Is it possible to come up with a model that minimises both false positive and false negative? Minimising can be done to a point, such as the Bayes error threshold.
2k views

### Using scikit Learn - Neural network to produce ROC Curves

I want to verify that the logic of the way I am producing ROC curves is correct. (irrelevant of the technical understanding of the actual code). I have a data set which I want to classify. I am using ...
3k views

### The Area Under an ROC Curve (AUC) vs Confusion Matrix for classifier evaluation?

When should I use The Area Under an ROC Curve (AUC) or the Confusion Matrix for classifier evaluation? The clasifier evaluation is for example the prediction of customers for possible future sales.
724 views

### Confusion Matrix of LSTM using Sklear getting error

I want to calculate the confusion Matrix of my LSTM model. Shape of y_test= (17799,1) y_Pred= (17799,1) I used thefollowing code:from sklearn.metrics import confusion_matrix cm = confusion_matrix(...
373 views

### How to make sense of confusion matrix

Consider a binary classification problem with 0 labels denoting normal and 1 abnormal or rare. The number of instances with <...
2k views

### Precision and Recall if not binary

I have to calculate precision and recall for a university project to measure the quality of the classification output (with sklearn). Say this would be my results: y_true = [0, 1, 2, 1, 1] y_pred = [...
248 views

### How to quantify the performance of the classifier (multi-class SVM) using the test data?

I am working on a traffic sign recognition code in MATLAB using Belgian Traffic Sign Dataset. The dataset consists of training data and test data. I resized the given images and extracted HOG ...
611 views

...
13 views

### Compute an ROC for a hybrid model where only one of the model components computes class probabilities

I've created a hybrid model by taking an existing decision engine (TRUE/FALSE output) and supplementing it with a random forest ...
975 views

### Interpreting confusion matrix and validation results in convolutional networks

I need some help in the assessment of the training results of a convolutional neural network. Here is my setup: Architecture: InceptionV3 Pre-trained InceptionV3 with weights from image net ...
16k 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 = ...
373 views

### Matrix Confusion - Get Model Precision

I've this matrix confusion: [9779 107] [2227 148] What is the accuracy of my model? My doubt is because the confusion matrix is calculated based on Test ...
26k views

### Train Accuracy vs Test Accuracy vs Confusion matrix

After I developed my predictive model using Random Forest I get the following metrics: ...