We’re rewarding the question askers & reputations are being recalculated! Read more.

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
0answers
7 views

Precision-Recall for CNN place recognition problem

Given 3450 query and 3450 reference images in a place recognition problem, I plot the ...
1
vote
1answer
32 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. ...
1
vote
4answers
110 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 ...
2
votes
2answers
37 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 ...
1
vote
2answers
139 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
1answer
44 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(...
0
votes
0answers
61 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, ...
0
votes
0answers
48 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
0answers
38 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-...
2
votes
1answer
265 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 ...
0
votes
0answers
69 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 ...
1
vote
1answer
234 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 ...
1
vote
0answers
77 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 ...
3
votes
1answer
74 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 ...
8
votes
3answers
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 ...
6
votes
4answers
527 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): ...
1
vote
1answer
51 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 ...
3
votes
1answer
330 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 ...
2
votes
1answer
163 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 ...
1
vote
1answer
3k 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 ...
1
vote
1answer
671 views

Confusion matrix plot with python

I'm for a function that can plot the following plot using python:
4
votes
1answer
83 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$: $$...
4
votes
1answer
7k 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 ...
2
votes
0answers
244 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 ...
0
votes
2answers
74 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 ...
1
vote
1answer
111 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 ...
0
votes
1answer
330 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 ...
4
votes
1answer
114 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 ...
2
votes
1answer
343 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.
1
vote
1answer
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 ...
1
vote
1answer
2k 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.
1
vote
1answer
652 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(...
4
votes
2answers
351 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 <...
5
votes
3answers
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 = [...
0
votes
2answers
231 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 ...
2
votes
1answer
571 views

Confusion-matrix clarification from Python

...
1
vote
0answers
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 ...
2
votes
1answer
933 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 ...
4
votes
6answers
14k 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
2answers
358 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 ...
8
votes
1answer
24k views

Train Accuracy vs Test Accuracy vs Confusion matrix

After I developed my predictive model using Random Forest I get the following metrics: ...
1
vote
1answer
234 views

Export dataset with predicted target - Python

I've this code (part of predictive model): ...
0
votes
1answer
560 views

Python - Get FP/TP from Confusion Matrix using a List

I using two different classifiers to predict a binary target (Random Forests and Decision Trees). Now I want to evaluate my model creating a confusion matrix. For example, for predicting the binary ...
2
votes
0answers
362 views

what's the best way to plot a confusion matrix in a multilabel setting?

In a multilabel setting a training example could be a, b, (a, b), d, c, (d, c), etc. This makes it a bit hard to come up with a helpful confusion matrix because the ...
5
votes
1answer
700 views

Dealing with unbalanced error rate in confusion matrix

Here is the confusion matrix I got when I was playing with Forest Type Cover Kaggle dataset : Link. In the matrix, light color and higher numbers represent higher error rates, so as you can see, ...
1
vote
1answer
596 views

Calculating a Confusion Matrix

Can someone help me understand how to find the values of a confusion matrix? I know that essentially a confusion matrix looks like this: ...
1
vote
0answers
2k views

Can tuning individual precision and recall classification thresholds improve deep learning models?

I learned that Keras doesn't have a built-in way to set a threshold for precision and accuracy when building a classifier. Courtesy of a solution here, I wanted to see what would happen when I fit a ...
0
votes
2answers
4k views

How to calculate Precision and Recall using confusion matrix in Matlab?

I am working on 3 class problem.How to calculate precision,recall ,f-score,MCC of each class while using MATLAB. Here is my confusion matrix: ...
0
votes
1answer
549 views

Is this a good classified model based confusion matrix and classification report?

I build a classification model. The results below when implemented Decision Tree Classifier. Prediction accuracy 0.785813630042 confusion matrix [[ 1302 1581] [ 2577 13953]] ...
9
votes
3answers
5k views

How can I make big confusion matrices easier to read?

I have recently published a dataset (link) with 369 classes. I ran a couple of experiments on them to get a feeling for how difficult the classification task is. Usually, I like it if there are ...