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

Calculate the number of TP, FP, FN for the object detection task with many classes

I am trying to count the number of True Positives (TP), False Positives (FP), and False Negatives (FN) for object detection task with two classes. I assumed that: TP - is the detection with ...
-1
votes
0answers
5 views

Confusion Matrix ValueError: Found input variables with inconsistent numbers of samples: [3, 360] [migrated]

I'm trying to train a data set and output a confusion matrix after the dataset has been trained. Here is the code ...
0
votes
0answers
11 views

What are the Objectives for Recommendation Systems and what Key Results should a Recommendation System focus on?

I know that a Recommendation system helps in the engagement of the users and helps users find more relevant content but I am in search of more complex objectives and key results with regards to ...
1
vote
2answers
85 views

Confusion matrix. “How close I am to the diagonal?”. Is there such metric?

I have a question regarding confusion matrices. To start, we discuss the case of multi-class classification so the confusion matrix has dimension, for example 4 times 4, for classification task with 4 ...
0
votes
0answers
18 views

Misclassifying only 1 of 3 classes in NN with Keras against RF

I'm working on the classification of a small dataset of clinical data. It is composed of around 3500 samples, with 15 features and there are 3 diferent classes (2 of them also have 2 subclasses each ...
0
votes
0answers
31 views

Formulate Confusion Matrix from Precision Score

I have the precision scores from 5 classes. Is it possible to create the confusion matrix from that scores. While running the code, I only saved those precision values by mistake. So now I want to ...
1
vote
2answers
37 views

How to extract true positives data (complete row with data) after training and testing from test dataset?

How do you extract true positive data from testing data after training and testing? For example, in the test data, I have two rows and one row is true positives and the other is false negatives. ...
0
votes
0answers
24 views

Plotting scikit-learn confusion matrix returns no values in the last class

I am attempting to create a confusion matrix using Scikit-Learn for a multiclass classification CNN, and it works well except for the fact that it does not provide ...
1
vote
1answer
23 views

Mathematics: Writing down a three-class classifier confusion matrix

Confusion matrix 2A three-class classifier is evaluated on a test set of 900 samples which containsall three classes in equal proportions. ...
4
votes
2answers
152 views

Accuracy is lower than f1-score for imbalanced data

For a binary classification, I have a dataset with 55% negative label and 45% positive labels. The results of the classifier shows that the accuracy is lower than the f1-score. Does that mean that the ...
2
votes
1answer
40 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 ...
2
votes
1answer
39 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
19 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
44 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
21 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
31 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
18 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
32 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
1answer
431 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
18 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
13 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
73 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
40 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
2k 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
29 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
89 views

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

My prediction results look like this TestArray ...
1
vote
1answer
68 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
86 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 ...
1
vote
2answers
39 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
63 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
81 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
34 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
125 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
29 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
49 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
338 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
281 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
36 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
41 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
34 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 ...
3
votes
1answer
135 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
707 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
594 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
803 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
230 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(...