confusion-matrix

R package caret confusionMatrix with missing categories

依然范特西╮ 提交于 2019-11-30 04:10:54
问题 I am using the function confusionMatrix in the R package caret to calculate some statistics for some data I have. I have been putting my predictions as well as my actual values into the table function to get the table to be used in the confusionMatrix function as so: table(predicted,actual) However, there are multiple possible outcomes (e.g. A, B, C, D), and my predictions do not always represent all the possibilities (e.g. only A, B, D). The resulting output of the table function does not

How do i create Confusion matrix of predicted and ground truth labels with Tensorflow?

江枫思渺然 提交于 2019-11-28 22:07:18
I have implemented a Nueral Network model for a classification with the help of using TensorFlow. But, i don't know how can i able to draw confusion matrix by using predicted scores (accuracy). I am not an expert of TensorFlow and still in learning phase. Here i pasted my code below please tell me how can i write a code for making confusion from the following code: # Launch the graph with tf.Session() as sess: sess.run(init) # Set logs writer into folder /tmp/tensorflow_logs #summary_writer = tf.train.SummaryWriter('/tmp/tensorflow_logs', graph_def=sess.graph_def) # Training cycle for epoch in

Confusion Matrix with number of classified/misclassified instances on it (Python/Matplotlib)

北慕城南 提交于 2019-11-28 09:16:45
I am plotting a confusion matrix with matplotlib with the following code: from numpy import * import matplotlib.pyplot as plt from pylab import * conf_arr = [[33,2,0,0,0,0,0,0,0,1,3], [3,31,0,0,0,0,0,0,0,0,0], [0,4,41,0,0,0,0,0,0,0,1], [0,1,0,30,0,6,0,0,0,0,1], [0,0,0,0,38,10,0,0,0,0,0], [0,0,0,3,1,39,0,0,0,0,4], [0,2,2,0,4,1,31,0,0,0,2], [0,1,0,0,0,0,0,36,0,2,0], [0,0,0,0,0,0,1,5,37,5,1], [3,0,0,0,0,0,0,0,0,39,0], [0,0,0,0,0,0,0,0,0,0,38] ] norm_conf = [] for i in conf_arr: a = 0 tmp_arr = [] a = sum(i,0) for j in i: tmp_arr.append(float(j)/float(a)) norm_conf.append(tmp_arr) plt.clf() fig =

How to get precision, recall and f-measure from confusion matrix in Python

不羁岁月 提交于 2019-11-28 00:26:30
I'm using Python and have some confusion matrixes. I'd like to calculate precisions and recalls and f-measure by confusion matrixes in multiclass classification. My result logs don't contain y_true and y_pred , just contain confusion matrix. Could you tell me how to get these scores from confusion matrix in multiclass classification? Let's consider the case of MNIST data classification (10 classes), where for a test set of 10,000 samples we get the following confusion matrix cm (Numpy array): array([[ 963, 0, 0, 1, 0, 2, 11, 1, 2, 0], [ 0, 1119, 3, 2, 1, 0, 4, 1, 4, 1], [ 12, 3, 972, 9, 6, 0,

How do i create Confusion matrix of predicted and ground truth labels with Tensorflow?

爷,独闯天下 提交于 2019-11-27 14:14:27
问题 I have implemented a Nueral Network model for a classification with the help of using TensorFlow. But, i don't know how can i able to draw confusion matrix by using predicted scores (accuracy). I am not an expert of TensorFlow and still in learning phase. Here i pasted my code below please tell me how can i write a code for making confusion from the following code: # Launch the graph with tf.Session() as sess: sess.run(init) # Set logs writer into folder /tmp/tensorflow_logs #summary_writer =

Confusion Matrix with number of classified/misclassified instances on it (Python/Matplotlib)

别来无恙 提交于 2019-11-27 02:53:33
问题 I am plotting a confusion matrix with matplotlib with the following code: from numpy import * import matplotlib.pyplot as plt from pylab import * conf_arr = [[33,2,0,0,0,0,0,0,0,1,3], [3,31,0,0,0,0,0,0,0,0,0], [0,4,41,0,0,0,0,0,0,0,1], [0,1,0,30,0,6,0,0,0,0,1], [0,0,0,0,38,10,0,0,0,0,0], [0,0,0,3,1,39,0,0,0,0,4], [0,2,2,0,4,1,31,0,0,0,2], [0,1,0,0,0,0,0,36,0,2,0], [0,0,0,0,0,0,1,5,37,5,1], [3,0,0,0,0,0,0,0,0,39,0], [0,0,0,0,0,0,0,0,0,0,38] ] norm_conf = [] for i in conf_arr: a = 0 tmp_arr = [