classification

How to classify true negative from a video?

时光总嘲笑我的痴心妄想 提交于 2020-01-17 18:02:04
问题 For a performance measuring purpose I am trying to draw ROC curve. In ROC curve I have to plot False Positive Rate (FPR) in x-axis and True Positive Rate (TPR) in y-axis. As we know, FPR = FP/(FP+TN) So in the following picture how can i detect True Negative(TN) ? I have used HOG classifier to detect human. I marked with rectangle 1,2,3,4,5,6(or should be 7) to show the human objects that should be ignored and not to classify as human. and I think those are True Negative. In this picture i

Draw divisory MLP line together with chart in MATLAB

混江龙づ霸主 提交于 2020-01-17 09:27:13
问题 I need to plot the divisory line together with the graph below: The code I used to train the MLP neural network is here: circles = [1 1; 2 1; 2 2; 2 3; 2 4; 3 2; 3 3; 4 1; 4 2; 4 3]; crosses = [1 2; 1 3; 1 4; 2 5; 3 4; 3 5; 4 4; 5 1; 5 2; 5 3]; net = feedforwardnet(3); net = train(net, circles, crosses); plot(circles(:, 1), circles(:, 2), 'ro'); hold on plot(crosses(:, 1), crosses(:, 2), 'b+'); hold off; But I'd like to show the line separating the groups in the chart too. How do I proceed?

How implantation MKNN Algorithm In Matlab

拈花ヽ惹草 提交于 2020-01-17 06:31:09
问题 I have a problem I need to Implantation of below article in Matlab but i can't find any source code of that. Article link I tried by myself but it's a little complex for me . does anyone have Implantation of the article or can do it for me ? Thanks too much 来源: https://stackoverflow.com/questions/40149331/how-implantation-mknn-algorithm-in-matlab

Improving Accuracy of a Tensorflow neural network- python

白昼怎懂夜的黑 提交于 2020-01-17 06:02:17
问题 This is a continuation of my first question: Receiving random cost output on tensorflow regression- python I am using a multi-layered perceptron ANN to predict the Phyla of bacteria samples based on other observed data. Every time I run my code I get an accuracy of 0. The dataset is not the best as there are plenty of NaN's (that have been replaced with 0), but I expected better than nothing. I am looking for help to debug and improved accuracy The dataset that I am currently using can be

SVM Classifications on set of images of digits in Matlab

本小妞迷上赌 提交于 2020-01-16 08:25:28
问题 I have to use SVM classifier on digits dataset. The dataset consists of images of digits 28x28 and a toal of 2000 images. I tried to use svmtrain but the matlab gave an error that svmtrain has been removed. so now i am using fitcsvm. My code is as below: labelData = zeros(2000,1); for i=1:1000 labelData(i,1)=1; end for j=1001:2000 labelData(j,1)=1; end SVMStruct =fitcsvm(trainingData,labelData) %where training data is the set of images of digits. I need to know how i can predict the outputs

Sensitivity specificity plot python

允我心安 提交于 2020-01-16 03:39:50
问题 I'm trying to reproduce a Sensitivity specificity plot similar to this one: where the X axis is the threshold But I have not found how to do it, some skalern metrics like ROC curve return the true positive and false positive, but I have not found any option to make this plot there. I'm trying to compare the prob with the actal label to keep the count, the the plot I get is like this: Hence the X label has to be some how normalized so the curves can actually go up and down. 回答1: Building upon

How to run naive Bayes from NLTK with Python Pandas?

人盡茶涼 提交于 2020-01-15 12:16:07
问题 I have a csv file with feature (people's names) and label (people's ethnicities). I am able to set up the data frame using Python Pandas, but when I try to link that with NLTK module to run a naive Bayes, I get the following error: Traceback (most recent call last): File "C:\Users\Desktop\file.py", line 19, in <module> classifier = nbc.train(train_set) File "E:\Program Files Extra\Python27\lib\site-packages\nltk\classify\naivebayes.py", line 194, in train for fname, fval in featureset.items()

Ctree classification with weights - results displayed

懵懂的女人 提交于 2020-01-15 09:09:55
问题 Let's say I want to use the iris data example, but correctly classifying versicolor is 5 times more important to me. library(party) data(iris) irisct <- ctree(Species ~ .,data = iris, weights=ifelse(iris$Species=='versicolor', 5, 1)) plot(irisct) Then the tree graph changes the number of observations and conditional probabilities in each node (it multiplies versicolor by 5). Is there a way to "disable" this, i.e. show the original number of observations (total = 150 for iris)? Many thanks for

Ctree classification with weights - results displayed

房东的猫 提交于 2020-01-15 09:08:20
问题 Let's say I want to use the iris data example, but correctly classifying versicolor is 5 times more important to me. library(party) data(iris) irisct <- ctree(Species ~ .,data = iris, weights=ifelse(iris$Species=='versicolor', 5, 1)) plot(irisct) Then the tree graph changes the number of observations and conditional probabilities in each node (it multiplies versicolor by 5). Is there a way to "disable" this, i.e. show the original number of observations (total = 150 for iris)? Many thanks for

How to visualize output of intermediate layers of convolutional neural network in keras?

不羁的心 提交于 2020-01-15 05:04:52
问题 recently I created basic CNN model for cats and dogs classification (very basic). How can I visualize the output of these layers using keras? I used Tensorflow backend for keras. 回答1: You can define a model that takes the output of every layer you want to see and make a prediction: Suppose you have your complete model: cnnModel = #a model you have defined with layers And suppose you want the outputs of the layers of indices 1, 5 and 8. Create a new model from this one, using the outputs of