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

why is H2O using only a part of the data?

I have this dataframe: ...
user avatar
  • 480
1 vote
0 answers
32 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) ...
user avatar
  • 111
1 vote
1 answer
14 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-...
user avatar
2 votes
2 answers
128 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 ...
user avatar
1 vote
1 answer
105 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 ...
user avatar
0 votes
0 answers
30 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, ...
user avatar
0 votes
1 answer
24 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. ...
user avatar
0 votes
1 answer
35 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?
user avatar
  • 113
1 vote
0 answers
52 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 : ...
user avatar
  • 13
0 votes
0 answers
18 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 ...
user avatar
1 vote
1 answer
129 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 ...
user avatar
  • 21
0 votes
1 answer
18 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 ...
user avatar
0 votes
0 answers
21 views

Issue with confusion matrix and classification report

Can you please tell me why this error is thrown?
user avatar
1 vote
1 answer
98 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 ...
user avatar
  • 21
1 vote
1 answer
78 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% ...
user avatar
  • 55
0 votes
0 answers
525 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 ...
user avatar
0 votes
1 answer
42 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: ...
user avatar
  • 411
1 vote
1 answer
69 views

Is it possible to combine two confusion matrices?

Assume I have two different algorithms that tests whether a given image contains a goat or not. I apply these two algorithms to two different datasets and obtain two confusion matrices. Now I want to ...
user avatar
  • 113
4 votes
1 answer
334 views

How to create a confusion matrix for k-means with two features?

I have the need to do a confusion matrix for data run through k-means with two features. I am aware that this is a clustering algorithm and not a classification algorithm but I have seen some ...
user avatar
0 votes
1 answer
119 views

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

I have actual class labels and predicted class labels: ...
user avatar
0 votes
2 answers
30 views

Confusion matrix terminology

I am working on machine learning with a supervised problem with 2 classes: NO and YES, and I need some precision about confusion matrix. I read 2 differents terminologies, some writes matrix confusion ...
user avatar
2 votes
3 answers
51 views

How are scores calculated for each class of binary classification

The formula for Precision is TP / TP + FP, but how to apply it individually for each class of a binary classification problem, For example here the precision, recall and f1 scores are calculated for ...
user avatar
1 vote
1 answer
34 views

Comparison of classifier confusion matrices

I tried implementing Logistic regression, Linear Discriminant Analysis and KNN for the smarket dataset provided in "An Introduction to Statistical Learning" in python. Logistic Regression ...
user avatar
1 vote
0 answers
22 views

Confusion matrix of 3*2

I would like to include confusion matrix in my research report. I have a binary classification problem. The positive class is further divided into two types for example: Real Positive and Obstruction ...
user avatar
  • 21
0 votes
1 answer
104 views

Unable to generate confusion matrix

I am using keras flow from directory for image segmentation. Following are my codes ...
user avatar
1 vote
0 answers
14 views

Recall/Precision Metrics on Azure AutoML seem to be oriented to majority class, and I'm trying to focus on minority class

I am running some experiments in Azure using AutoML. My problem is a binary classification one, with highly imbalanced classes (basically trying to predict what factors make a deal "WON" ...
user avatar
0 votes
1 answer
22 views

Confusion matrix and accuracy not in sync

I am getting the following result for the confusion matrix and accuracy for a logistic regression model. ...
user avatar
  • 1
0 votes
1 answer
111 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 ...
user avatar
  • 13
0 votes
1 answer
87 views

How is there an inverse relation between precision and recall?

What I know? Firstly, Precision= $\frac{TP}{TP+FP}$ Recall=$\frac{TP}{TP+FN}$ What book says? A model that declares every record has high recall but low precision. I understand that if predicted ...
user avatar
1 vote
1 answer
42 views

Classification report and confusion matrix problem

I am working on sign language recognition system using HOG and KNN. I have 26 classes of 180 images per class. The dataset was split into 1/3(67%) for tanning and 2/3(33%) testing after feature ...
user avatar
  • 13
0 votes
3 answers
115 views

Confusion Matrix before and after SMOTE is same

I am working with a very unbalanced dataset and I used SMOTE (for training data only). However, I did not understand why the results before and after SMOTE are the same. The attached confusion matrix ...
user avatar
  • 45
0 votes
1 answer
298 views

Good model but bad confusion matrix?

I am trying to understand the code here. The output [12] shows that the model accuracy is above 90% even for the validation set, but the confusion matrix in [16] ca not even achieve 50% accuracy, and ...
user avatar
  • 31
2 votes
1 answer
62 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 ...
user avatar
  • 21
1 vote
0 answers
24 views

How to interpret the confusion matrix and compare the result of features extraction with LBP and Haralick

I'm begginer in deep learning so I tried to execute a code of liveness face detection from github in this link :https://github.com/imironica/liveness , so when I tried to run features extraction with ...
user avatar
3 votes
1 answer
334 views

How to create a confusion matrix for one node of a decision tree?

I am doing past papers for my data science exam and was curious about one of the questions. They ask us to create a confusion matrix by hand for one node of a decision tree. I understand how to create ...
user avatar
1 vote
1 answer
311 views

What do you do with one hot encoding items that are a non-match for all classes in a confusion matrix?

I have trained a model for one-hot binary prediction for many classes, and am now applying it to the testing set of samples. However, a lot of the predictions for samples are 0 for every class. I'm ...
user avatar
  • 13
0 votes
2 answers
388 views

Warning when plotting confusion matrix with all sample of one class

I have two arrays: the first one with all the correct labels (they are all set to zero since each sample belong to the same class) and another one with all the labels predicted by my neural network. ...
user avatar
  • 43
5 votes
1 answer
76 views

Suitable metric choice for imbalanced multi-class dataset (classes have equal importance)

What type of metrics I should use to evaluate my classification models, given that I have two imbalanced multi-class datasets (21 and 16 classes, respectively) where all classes have equal importance? ...
user avatar
  • 238
0 votes
1 answer
100 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.
user avatar
1 vote
1 answer
67 views

How do I calculate the accuracy for graph mining in terms of (top 1%)?

I have 3600 samples in my dataset. I split the dataset into the train (2700) and test (900). My problem is related to ...
user avatar
0 votes
0 answers
77 views

How do I aggregate cross-validation results for per-sample insights?

I'm trying to do feature engineering for point cloud data with three classes, and after having finished implementing the most obvious and simplest features with somewhat good results I'd like to use ...
user avatar
  • 101
-1 votes
1 answer
626 views

Does a confusion matrix have to sum to 100% for each class?

Does my confusion matrix looks correct ?
user avatar
1 vote
1 answer
71 views

Adding extra (meaningful) features does not improve model performance

I am struggling with confusion matrices and their outputs. I thought to follow all the steps right, but unfortunately it seems that something is not going well. I had a dataset built and labelled on ...
user avatar
  • 295
0 votes
1 answer
1k views

Found input variables with inconsistent numbers of samples: [30, 24]

I'm using neural network machine learning and would like to see the result of my confusion matrix for my model. However, there is an error that I've got and don't know how to solve it. ...
user avatar
-1 votes
1 answer
28 views

Printing the tweets that were incorrectly predicted after applying a machine learning classifier

I applied the random forest classifier to my csv file to classify the tweets as spam or not spam and after an accuracy of 93%, when I printed the confusion matrix I got [[1068 105] [ 65 1262]]. Now ...
user avatar
2 votes
1 answer
454 views

How to calculate the different metrics for multi class classification

My confusion matrix has the following structure: (Predicted) C= ( actual) [TN FP FN TP] How can I calculate the Mathews ...
user avatar
  • 521
1 vote
1 answer
47 views

How to measure a almost (?) ordinal classification?

I have a model where I predict classes to define instructions for a trader robot. The classes are -2, -1, 1 and 2 (strong sell, light sell, light buy and strong buy) and I'm using a simple confusion ...
user avatar
1 vote
0 answers
35 views

Interpreting a confusion matrix [closed]

I have a binary classification problem. The accuracy score is 52% The precision for 0 is 53% and the precision for 1 is 49% When using predict_proba() does this ...
user avatar
1 vote
1 answer
143 views

Is there a flexible way to get the original data indices from each cell of a confusion matrix?

Let's say I have model A and model B, that I want to compare the performance of by inspecting a confusion matrix. They both produce a list of predictions, pred_A ...
user avatar
0 votes
1 answer
65 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 ...
user avatar
  • 31