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

Unable to generate confusion matrix

I am using keras flow from directory for image segmentation. Following are my codes ...
1
vote
0answers
7 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" ...
2
votes
1answer
24 views

Is it ok for precision and recall metrics if a small minority of samples are both false positives and true positives?

I am working on a multi-label classification NN using genomic data. there are 10 samples and 2 ground truth labels (age and gender) for every sample. I use a sigmoid activation at the final layer and ...
0
votes
1answer
17 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. ...
0
votes
1answer
22 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 ...
0
votes
1answer
28 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 ...
1
vote
1answer
29 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 ...
0
votes
3answers
47 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 ...
0
votes
1answer
52 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 ...
2
votes
1answer
51 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 ...
1
vote
0answers
17 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 ...
3
votes
1answer
118 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 ...
2
votes
1answer
84 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 ...
0
votes
0answers
20 views

scikit-learn sample weight interpretation

I'm trying to use scikit-learn to plot a confusion matrix from raw data I have obtained (contains just predictions and ground truths). The data contains a total of 4 classes: ...
0
votes
0answers
9 views

Metrics for each class in a multi-class training/testing dataset

I am working with the NSL_KDD Dataset for cyber security and training a number of different models. There are five different classes: benign, dos, probe, r2u, and u2l. (I am using scikitlearn.) I ...
0
votes
2answers
63 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. ...
5
votes
1answer
64 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? ...
0
votes
0answers
31 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.
1
vote
1answer
59 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 ...
0
votes
0answers
44 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 ...
-1
votes
1answer
76 views

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

Does my confusion matrix looks correct ?
1
vote
1answer
38 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 ...
0
votes
1answer
448 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. ...
0
votes
0answers
58 views

Confusion matrix : Train data accuracy lower than test data accuracy and 95%CI meaning

Let's say that I have training data and test data. I trained the model with the training data and then constructed a confusion matrix of the predictions of both. I am getting that the prediction of ...
-1
votes
1answer
26 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 ...
2
votes
1answer
162 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 ...
1
vote
1answer
35 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 ...
0
votes
0answers
11 views

Evaluate Model Node in Azure ML Studio does not take all the rows of the dataset in confusion matrix

I have this dataset in which the positive class consists of component failures for a specific component of the APS system. I am doing Predictive Maintenance using Microsoft Azure Machine Learning ...
1
vote
0answers
31 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 ...
1
vote
1answer
41 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 ...
0
votes
1answer
22 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 ...
0
votes
0answers
19 views

Calculating Uncertainty for categorical predictions

I am wondering what is the best way to calculate the uncertainty for my categorical predictions. I have created a model that predicts what rating a movie is getting based on certain keywords and the ...
2
votes
1answer
160 views

Calibrating probability thresholds for multiclass classification

I have built a network for the classification of three classes. The network consists of a CNN followed by two fully-connected layers. The CNN consists of convolutional layers, followed by batch ...
1
vote
1answer
39 views

How to improve results from ML model? (spam classification)

I am trying to build a model that predicts if an email is spam/not-spam. After building a logistic regression model, I have got the following results: ...
3
votes
1answer
170 views

Confusion matrix in sklearn

If you look at this: ...
0
votes
1answer
41 views

Same confusion matrix when changing DecisionTreeClassifier parameters

I'm trying to build my first Decision Tree Classifier using the Iris dataset in the sklearn library. This is my first sample code: ...
-1
votes
1answer
22 views

Precision Accuracy and recall rate of a confusion rate of confusion matrix

...
1
vote
1answer
68 views

Confusion Matrix vs AUC Confusion with Random Forest [closed]

I'm currently training a random forest classifier with 1000 trees and am receiving the following confusion matrix. I've split the training set 75/25 against the test set but am not sure why I'm ...
0
votes
1answer
35 views

Model accuracy: how to determine it?

I have some doubts regarding the approach to build a classifier such as Multinomial Naive Bayes or SVM. I will go through the steps to see if the approach is fine. I have not a lot of experience in ...
-1
votes
1answer
181 views

How to check two list (predicted and actual) having different lengths?

I got a list of fake accounts through an algorithm and I would like to determine the precision/accuracy of this result comparing it with the labelled dataset. The lists contain only fake accounts and ...
2
votes
2answers
113 views

Confusion matrix to check results

I am a new user in StackExchange and a new learner of Data Science. I am working on better understanding how to estimate the results collected, specifically fake users extracted from a dataset running ...
1
vote
0answers
168 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 ...
0
votes
0answers
25 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 ...
2
votes
2answers
176 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
19 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 ...
1
vote
1answer
70 views

Sampling in Text Classification: can the results be considered 'reliable'?

I am testing different models (SVM, Logistic Regression, Naive Bayes, Random Forest) for predicting the class of a spam email. My target is a binary variable. I am analysing only text, no other fields....
0
votes
0answers
32 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
248 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
107 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
30 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. ...