classification

How to deal with low frequency examples in classification?

走远了吗. 提交于 2019-12-07 14:54:36
问题 I'm facing a text classification problem, and I need to classify examples to 34 groups. The problem is, the size of training data of 34 groups are not balanced. For some groups I have 2000+ examples, while for some I only have 100+ examples. For some small groups, the classification accuracy is quite high. I guess those groups may have specific key words to recognize and classify. While for some, the accuracy is low, and the prediction always goes to large groups. I want to know how to deal

VGG16 Keras fine tuning: low accuracy

不想你离开。 提交于 2019-12-07 12:31:52
问题 I've already asked similar question here, but now I have slightly different problem, therefore asking new question. I decided to use slightly different approach instead of proposed among answers in the referenced question to train, and then fine-tune model. Update : I've replaced old question provided here with more suitable version Here is my sequence of actions: Build VGG16 model and drop top layer (call it no-top model) Generate bottleneck features using no-top model Train a separate fully

Tf.Print() doesn't print the shape of the tensors?

笑着哭i 提交于 2019-12-07 12:15:49
问题 I have written a simple classification program using Tensorflow and getting the output except I tried to print the shape of tensors for Model parameters, features & bias. The function definations: import tensorflow as tf, numpy as np from tensorflow.examples.tutorials.mnist import input_data def get_weights(n_features, n_labels): # Return weights return tf.Variable( tf.truncated_normal((n_features, n_labels)) ) def get_biases(n_labels): # Return biases return tf.Variable( tf.zeros(n_labels))

Prediction using InceptionV3 in Tensorflow

限于喜欢 提交于 2019-12-07 11:52:32
问题 I have trained InceptionV3 model in tensor flow on my own dataset. I have the checkpoint file and the graph (.meta) from training. I am using these files to classify the label of a new image. Till now I have the following: inception_v3 code from TFslim def inception_v3(inputs, dropout_keep_prob=0.8, num_classes=1000, is_training=True, restore_logits=True, scope=''): """Latest Inception from http://arxiv.org/abs/1512.00567. "Rethinking the Inception Architecture for Computer Vision" Christian

Using a Naive Bayes Classifier to classify tweets: some problems

孤街醉人 提交于 2019-12-07 10:21:18
问题 Using, amongst other sources, various posts here on Stackoverflow, I'm trying to implement my own PHP classier to classify tweets into a positive, neutral and negative class. Before coding, I need to get the process straigt. My train-of-thought and an example are as follows: p(class) * p(words|class) Bayes theorem: p(class|words) = ------------------------- with p(words) assumption that p(words) is the same for every class leads to calculating arg max p(class) * p(words|class) with p(words

Which classifiers provide weight vector?

我与影子孤独终老i 提交于 2019-12-07 08:19:10
问题 What machine learning classifiers exists which provide after the learning phase a weight vector? I know about SVM, logistic regression, perceptron and LDA. Are there more? My goal is to use these weight vector to draw an importance map. 回答1: Actually any linear classifier has such a property by design. As I understand, what you want to do is something like feature selection without cut-off of least useful ones. See the paper Mladenić, D., Brank, J., Grobelnik, M., & Milic-Frayling, N. (2004,

Features selection with sequentialfs with libsvm

ε祈祈猫儿з 提交于 2019-12-07 07:58:33
I want to use matlab toolbox to do feature selection. there is one good function there called sequentialfs that does a good job. However, I could not integrate it with LibSVM function to perform features selection. It works fine with KnnClassify, can somebody help me please. here is the code for KnnClassify: fun1 = @(XT,yT,Xt,yt)... (sum((yt ~= knnclassify(Xt,XT,yT,5)))); [fs,history] = sequentialfs(fun1,data,label,'cv',c,'options',opts,'direction','forward'); You'll need to wrap the libsvm functions to train and test an SVM on a particular featureset. I'd suggest writing things in a separate

Scikit-Learn Classification and Regression with Weights

谁都会走 提交于 2019-12-07 04:20:28
问题 How can I do classification or regression in sklearn if I want to weight each sample differently? Is there a way to do it with a custom loss function? If so, what does that loss function look like in general? Is there an easier way? 回答1: To weigh individual samples, feed a sample_weight array to the estimator's fit method. This should be a 1-d array of length n_samples (i.e. the same dimension as y in most tasks): estimator.fit(X, y, sample_weight=some_array) Not all models support this,

how to transform a text to vector

烂漫一生 提交于 2019-12-07 02:18:33
问题 I'm learning classification. I read about using vectors. But I can't find an algorithm to translate a text with words to a vector. Is it about generating a hash of the words and adding a 1 to the hash location in the vector? 回答1: When most people talk about turning text into a feature vector, all they mean is recording the presence of the word (token). Two main ways to encode a vector. One is explicit, where you have a 0 for each word that is not present (but is in your vocabulary). The other

SPMD vs. Parfor

和自甴很熟 提交于 2019-12-07 02:05:55
问题 I'm new about parallel computing in matlab. I have a function which creates a classifiers (SVM) and I'd like to test it with several dataset. I've got a 2 core workstation so I'd like to run test in parallel. Can someone explain me the difference between: dataset_array={dataset1, dataset2} matlabpool open 2 spmd my_function(dataset(labindex)); end and dataset_array={dataset1, dataset2} matlabpool open 2 parfor i:1=2 my_function(dataset(i)); end 回答1: spmd is a parallel region, while parfor is