classification

Multi-layer neural network won't predict negative values

十年热恋 提交于 2019-12-04 22:47:22
I have implemented a multilayer perceptron to predict the sin of input vectors. The vectors consist of four -1,0,1's chosen at random and a bias set to 1. The network should predict the sin of sum of the vectors contents. eg Input = <0,1,-1,0,1> Output = Sin(0+1+(-1)+0+1) The problem I am having is that the network will never predict a negative value and many of the vectors' sin values are negative. It predicts all positive or zero outputs perfectly. I am presuming that there is a problem with updating the weights, which are updated after every epoch. Has anyone encountered this problem with

Warnings while using the Naive Bayes Classifier in the Caret Package

女生的网名这么多〃 提交于 2019-12-04 22:02:16
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 total data set [2:13], the code failed. My next step was to systematically run the code with a subset of

Newbie: where to start given a problem to predict future success or not

ぃ、小莉子 提交于 2019-12-04 21:36:29
We have had a production web based product that allows users to make predictions about the future value (or demand) of goods, the historical data contains about 100k examples, each example has about 5 parameters; Consider a class of data called a prediciton: prediction { id: int predictor: int predictionDate: date predictedProductId: int predictedDirection: byte (0 for decrease, 1 for increase) valueAtPrediciton: float } and a paired result class that measures the result of the prediction: predictionResult { id: int valueTenDaysAfterPrediction: float valueTwentyDaysAfterPrediction: float

Why do Tensorflow tf.learn classification results vary a lot?

痞子三分冷 提交于 2019-12-04 20:49:36
I use the TensorFlow high-level API tf.learn to train and evaluate a DNN classifier for a series of binary text classifications (actually I need multi-label classification but at the moment I check every label separately). My code is very similar to the tf.learn Tutorial classifier = tf.contrib.learn.DNNClassifier( hidden_units=[10], n_classes=2, dropout=0.1, feature_columns=tf.contrib.learn.infer_real_valued_columns_from_input(training_set.data)) classifier.fit(x=training_set.data, y=training_set.target, steps=100) val_accuracy_score = classifier.evaluate(x=validation_set.data, y=validation

How to give a constant input to keras

佐手、 提交于 2019-12-04 20:21:57
问题 My network has two time-series inputs. One of the input has a fixed vector repeating for every time step. Is there an elegant way to load this fixed vector into the model just once and use it for computation? 回答1: You can create a static input using the tensor argument as described by jdehesa, however the tensor should be a Keras (not tensorflow) variable. You can create this as follows: from keras.layers import Input from keras import backend as K constants = [1,2,3] k_constants = K.variable

MultiClass using LIBSVM

给你一囗甜甜゛ 提交于 2019-12-04 20:19:11
I have a multiclass svm classification(6 class). I would like to classify it using LIBSVM. The following are the ones that i have tried and i have some questions regarding them. Method1( one vs one): model = svmtrain(TrainLabel, TrainVec, '-c 1 -g 0.00154 -b 0.9'); [predict_label, accuracy, dec_values] = svmpredict(TestLabel, TestVec, model); Two questions about this method: 1) is that all i need to do for multiclass problem 2) what value should it be for n in '-b n'. I m not sure Method 2( one vs rest): u=unique(TrainLabel); N=length(u); if(N>2) itr=1; classes=0; while((classes~=1)&&(itr<

What is the difference between cross-entropy and log loss error?

南笙酒味 提交于 2019-12-04 19:31:17
问题 What is the difference between cross-entropy and log loss error? The formulae for both seem to be very similar. 回答1: They are essentially the same; usually, we use the term log loss for binary classification problems, and the more general cross-entropy (loss) for the general case of multi-class classification, but even this distinction is not consistent, and you'll often find the terms used interchangeably as synonyms. From the Wikipedia entry for cross-entropy: The logistic loss is sometimes

Any difference between H2O and Scikit-Learn metrics scoring?

本小妞迷上赌 提交于 2019-12-04 19:21:05
I tried to use H2O to create some machine learning models for binary classification problem, and the test results are pretty good. But then I checked and found something weird. I tried to print the prediction of the model for the test set out of curiosity. And I found out that my model actually predicts 0 (negative) all the time, but the AUC is around 0.65, and precision is not 0.0. Then I tried to use Scikit-learn just to compare the metrics scores, and (as expected) they’re different. The Scikit learn yielded 0.0 precision and 0.5 AUC score, which I think is correct. Here's the code that I

Java: How can I assemble/create a single instance for classification using a Weka generated model?

三世轮回 提交于 2019-12-04 18:46:15
I've been searching for an answer to this for a while to no avail. First a bit of background: I'm trying to create an AI for robocode using Weka. I'm first logging the required data from a manual robot to an ARFF file, this is working as it should. This data is then processed this using Weka and a model created, I'm then saving this file. I can successfully import the model and classify a dataset that has been imported from another arff file and use the results. What I want to do now is every time the game status changes is assemble an instance and classify it, to decide for example which way

Does anyone know how to generate AUC/Roc Area based on the predition?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 17:21:33
I know the AUC/ROC area ( http://weka.wikispaces.com/Area+under+the+curve ) in weka is based on the e Mann Whitney statistic ( http://en.wikipedia.org/wiki/Mann-Whitney_U ) But my doubt is, if I've got 10 labeled instances (Y or N, binary target attribute), by applying an algorithm (i.e. J48) onto the dataset, then there are 10 predicted labels on these 10 instances. Then what exactly should I use to calculate the AUC_Y, AUC_N, and AUC_Avg? Use the prediction's ranked label Y and N or the actual label (Y' and N')? Or I need to calculate the TP rate and FP rate? Can anyone give me a small