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
1
vote
1answer
34 views

Getting value of 2 in normalized confusion matrix

I have created confusion matrix with python and I have gotten weird results that made me worried: as you can see, I have value of two, and if I understand correct, normalized matrix cannot have value ...
1
vote
1answer
32 views

Confusion regarding confusion matrix

I am confused on how to represent the confusion matrix -- where to put the FP and FN. Link1 and Link2 show different confusion matrix for binary classification. The rows represent the actual and ...
0
votes
1answer
9 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 ...
0
votes
1answer
29 views

Random forest confusion matrix encountered invalid values

I am doing classificaion using random forest classifier in python (scikit learn). I have many different databases, each one has 33 observations and the prediction is based on 600 columns. The script ...
0
votes
0answers
13 views

Generating a Confusion Matrix from a Seaborn Heatmap

Is there a way I can reverse engineer a Seaborn heatmap saved as .png? I want to get the array of values out of it. Does the library provide a "load-from-image" facility, or is there any sta
1
vote
1answer
29 views

Info obtained from a confusion matrix

I am new to data science and I am trying to understand the use/importance of accuracy, precision, recall, sensitivity and f1-score when I have a confusion matrix. I know how to compute all of them ...
0
votes
0answers
15 views

Definitive Values in Confusion Matrix

I built a convolutional LSTM model for the classification of 4-image time series. I used n keras ConvLSTM layers, followed by a time-distributed flatten and a few dense layers, finalized by a dense ...
0
votes
0answers
16 views

H2o Model Classification - Confusion Matrix Vs AUC

I am running a Classification Model in Python using H2o When I checked the model Performance on test dataset I got ...
0
votes
0answers
65 views

AxisError: axis 1 is out of bounds for array of dimension 1

I've used svm classifier. Now I need to construct the confusion matrix. Here is the code that I have used. ...
0
votes
1answer
15 views

text classification : comparing classification reports

I have a 4-leabelled text classification problem. Could someone help me choose among the below text classifiers ? I was advised to select the second one ( the one which uses both unigrams and ...
1
vote
1answer
22 views

Confusion matrix doesn't display properly

I am trying to plot a confusion matrix using the Logistic Regression for a multi-class ...
0
votes
0answers
12 views

How to find same set of answers repeated for multiple questions

I am using azure Q&A for creating a knowledge base. My knowledgebase contains questions and answers. There are chances that many questions that have same meaning may give different answers. How ...
2
votes
2answers
70 views

What is the purpose of a confusion matrix in a classification problem?

I am studying machine learning. After some research I understood that a typical workflow for a classification problem (after having prepared the data) is the following: Split data in test, train and ...
0
votes
0answers
11 views

expected y_pred to have dimension (1054,2) but got array with dimension (1054,)

I've used XGBoost algorithm here. The code is given below. ...
0
votes
0answers
18 views

Confusion matrix of UNET image sgemenation model

I have used Unet model for image segmentation. I have used RGB images and corresponding image masks and at output i got corresponding region of interest. Now i want to find confusion matrix of this ...
8
votes
3answers
1k views

Can the F1 score be equal to zero?

As it is mentioned in the F1 score Wikipedia, 'F1 score reaches its best value at 1 (perfect precision and recall) and worst at 0'. What is the worst condition that was mentioned? Even if we ...
0
votes
0answers
18 views

Confusion Matrix for Multi task Learning using custom data generator

I am working on developing an MTL model. There are two tasks in the model, task1, and task2. And I have used a custom data generator using following code: ...
0
votes
1answer
63 views

Finding TN,FN, TP, and FN for arrays using confusion matrix

My prediction results look like this TestArray ...
1
vote
1answer
38 views

How is the weight matrix set and its dimension in CNN

I am trying to calculate the output size of each layer and the number of parameters for 3 class classification using CNN. I have calculated till the final maxpooling layer and would really appreciate ...
1
vote
1answer
74 views

Confusion matrix and ROC AUC curves are not in sync

I created a classification model with three target classes and created a confusion matrix to measure the accuracy, here is the matrix code ...
0
votes
2answers
30 views

Why ROC value area under curve of two models is different whereas accuracy, precision, recall, f1-score and confusion matrix is same

I am applying logistic regression and support vector machines on the extacly same dataset with 70% data for training and 30% for test. Both perform exactly the same have the same precision, recall, f1-...
1
vote
3answers
58 views

Precision and Recall Confusion matrix

I was wondering, is it a proper method to convey information via separate Recall and Precision Confusion matrix? I recently came across a paper which reported the following scores. I am puzzled and ...
2
votes
2answers
66 views

Is confusion matrix possible in one column

I am performing anomaly detection using K-Means. I am working with only one column, plotting those values and then within this column I am adding some anomalies. My question is if it is possible to ...
0
votes
1answer
32 views

Confusion Matrix and AUC in univariate Anomaly Detection

In the code I upon a csv file which only has one column. The data in there in not that important just normal numbers. ...
3
votes
2answers
93 views

What is done first, cross validation or grid search?

When I have the data set to train a model with SVM, which procedure is performed first, cross validation or grid search? I have read this in a couple of books but I don't know in what order all this ...
1
vote
1answer
27 views

How to select optimal threshold which separate different classes?

I have trained a network to find the similarity between two images. The test dataset contain equal number of similar and dissimilar samples. Each class has approx. 13822 samples. I tried different ...
1
vote
1answer
46 views

Is there any way to calculate the true,false positives and negatives for a regression problem

I am trying to predict the glucose values of the patients for example values like 45,256,115 etc. based on some features. Currently I am calculating the accuracy in means of RMSE,MSE,R². Is there any ...
2
votes
4answers
250 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 ...
0
votes
1answer
185 views

Change number format of confusion 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 ...
1
vote
1answer
30 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 ...
0
votes
0answers
36 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: ...
1
vote
1answer
33 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, ...
0
votes
0answers
9 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 ...
1
vote
1answer
33 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 ...
0
votes
0answers
22 views

Precision-Recall for CNN place recognition problem

Given 3450 query and 3450 reference images in a place recognition problem, I plot the ...
2
votes
1answer
112 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
597 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 ...
3
votes
2answers
403 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 ...
2
votes
2answers
713 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
193 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
111 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
71 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 ...
2
votes
1answer
567 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 ...
1
vote
1answer
363 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
88 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
169 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 ...
10
votes
3answers
2k 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
552 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
55 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
601 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 ...