classification

Caffe classification labels in HDF5

北城余情 提交于 2019-12-10 10:12:17
问题 I am finetuning a network. In a specific case I want to use it for regression, which works. In another case, I want to use it for classification. For both cases I have an HDF5 file, with a label. With regression, this is just a 1-by-1 numpy array that contains a float. I thought I could use the same label for classification, after changing my EuclideanLoss layer to SoftmaxLoss. However, then I get a negative loss as so: Iteration 19200, loss = -118232 Train net output #0: loss = 39.3188 (* 1

naive classifier matlab

余生长醉 提交于 2019-12-10 10:11:32
问题 When testing the naive classifier in matlab I get different results even though I trained and tested on the same sample data, I was wondering if my code is correct and if someone could help explain why this is? %% dimensionality reduction columns = 6 [U,S,V]=svds(fulldata,columns); %% randomly select dataset rows = 1000; columns = 6; %# pick random rows indX = randperm( size(fulldata,1) ); indX = indX(1:rows)'; %# pick random columns %indY = randperm( size(fulldata,2) ); indY = indY(1:columns

Tensorflow embedding for categorical feature

倖福魔咒の 提交于 2019-12-10 08:03:53
问题 In machine learning, it is common to represent a categorical (specifically: nominal) feature with one-hot-encoding. I am trying to learn how to use tensorflow's embedding layer to represent a categorical feature in a classification problem. I have got tensorflow version 1.01 installed and I am using Python 3.6 . I am aware of the tensorflow tutorial for word2vec, but it is not very instructive for my case. While building the tf.Graph , it uses NCE-specific weights and tf.nn.nce_loss . I just

How to represent text for classification in weka?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 03:34:16
问题 Can you please let me know how to represent attribute or class for text classification in weka. By using what attribute can I do classification? word frequency or just word? What would be possible structure of ARFF format? Can you give me several lines of example of that structure? Thank you very much in advance. 回答1: One of the easiest alternatives is to start with an ARFF file for a two class problem like: @relation corpus @attribute text string @attribute class {pos,neg} @data 'long text

Keras class_weight in multi-label binary classification

て烟熏妆下的殇ゞ 提交于 2019-12-10 02:29:16
问题 Having trouble using class_weight for my multi-label problem. That is, each label is either 0 or 1, but there are many labels for each input sample. The code (with random data for MWE purposes): import tensorflow as tf from keras.models import Sequential, Model from keras.layers import Input, Concatenate, LSTM, Dense from keras import optimizers from keras.utils import to_categorical from keras import backend as K import numpy as np # from http://www.deepideas.net/unbalanced-classes-machine

Warnings while using the Naive Bayes Classifier in the Caret Package

穿精又带淫゛_ 提交于 2019-12-09 23:41:34
问题 I am attempting to run a supervised machine learning classifier known as Naive Bayes in the caret Package. My data is called LDA.scores, and has two categorical factors called "V4" and "G8", and 12 predictor variables. The code that I am using was adapted by a kind person on stack overflow from code supplied by myself (see link below).The code does work, however, only 9 predictors were used instead of the 12 predictors in the data-set. When I tried to train the Naive Bayes model with the

URL path similarity/string similarity algorithm

巧了我就是萌 提交于 2019-12-09 18:55:51
问题 My problem is that I need to compare URL paths and deduce if they are similar. Below I provide example data to process: # GROUP 1 /robots.txt # GROUP 2 /bot.html # GROUP 3 /phpMyAdmin-2.5.6-rc1/scripts/setup.php /phpMyAdmin-2.5.6-rc2/scripts/setup.php /phpMyAdmin-2.5.6/scripts/setup.php /phpMyAdmin-2.5.7-pl1/scripts/setup.php /phpMyAdmin-2.5.7/scripts/setup.php /phpMyAdmin-2.6.0-alpha/scripts/setup.php /phpMyAdmin-2.6.0-alpha2/scripts/setup.php # GROUP 4 //phpMyAdmin/ I tried Levenshtein

Naive Bayes: the within-class variance in each feature of TRAINING must be positive

妖精的绣舞 提交于 2019-12-09 17:44:32
问题 When trying to fit Naive Bayes: training_data = sample; % target_class = K8; # train model nb = NaiveBayes.fit(training_data, target_class); # prediction y = nb.predict(cluster3); I get an error: ??? Error using ==> NaiveBayes.fit>gaussianFit at 535 The within-class variance in each feature of TRAINING must be positive. The within-class variance in feature 2 5 6 in class normal. are not positive. Error in ==> NaiveBayes.fit at 498 obj = gaussianFit(obj, training, gindex); Can anyone shed

Get prediction percentage in WEKA using own Java code and a model

十年热恋 提交于 2019-12-09 13:37:08
问题 Overview I know that one can get the percentages of each prediction in a trained WEKA model through the GUI and command line options as conveniently explained and demonstrated in the documentation article "Making predictions". Predictions I know that there are three ways documented to get these predictions: command line GUI Java code/using the WEKA API, which I was able to do in the answer to "Get risk predictions in WEKA using own Java code" this fourth one requires a generated WEKA .MODEL

How to deal with missing attribute values in C4.5 (J48) decision tree?

你离开我真会死。 提交于 2019-12-09 12:44:48
问题 What's the best way to handle missing feature attribute values with Weka's C4.5 (J48) decision tree? The problem of missing values occurs during both training and classification. If values are missing from training instances, am I correct in assuming that I place a '?' value for the feature? Suppose that I am able to successfully build the decision tree and then create my own tree code in C++ or Java from Weka's tree structure. During classification time, if I am trying to classify a new