prediction

Time series prediction / forecast with TBATS failing with 'Error in tau + 1 + adj.beta + object$p'

十年热恋 提交于 2019-12-12 01:22:49
问题 I am doing a simple time prediction over ~500 values from the past. I load the CSV and create seasonal periods. Then I fit a TBATs model on it. However, forecast fails with the following error: Error in tau + 1 + adj.beta + object$p : non-numeric argument to binary operator Here are the values in the CSV file: bps 721568138 913459160 859189590 868664078 1586563935 1650241025 1763780678 1835193425 1957420275 1667829639 3147138480 4833943170 5127746998 5230523882 5334994914 5089738945

why multinom() predicts a lot of rows of probabilities for each level of outcome?

柔情痞子 提交于 2019-12-11 18:20:59
问题 I have a moltinomial logistic regression and the outcome variable has 6 levels: 10,20,60,70,80,90 test<-multinom(y ~ x1 + x2 + as.factor(x3) ,data=data1) I want to predict the probabilities associate with each level of y for each set of given input values. So I run this: dfin <- data.frame( ses = c(10,20,60,70,80,90), x1=2.1, x2=4, x3=40) predict(test, todaydata = dfin, type = "probs") But instead of getting 6 probabilities (one for each level of outcome), I got many many rows of

Confusion matrix ,my argmax which convert predictions classes to one hot vectors does not work

随声附和 提交于 2019-12-11 17:56:11
问题 I am using Convolutional Neural networks for classification and watched the video in youtube this site [which explained confusion matrix and how to pş1 and I aslo used according the youtube is explained the codes is : `import seaborn as sns # Predict the values from the validation dataset Y_pred = model.predict(X_test) # Convert predictions classes to one hot vectors Y_pred_classes = np.argmax(Y_pred,axis = 1) # Convert validation observations to one hot vectors print(Y_pred_classes) Y_true =

How to predict all classes in a multi class Sentiment Analysis problem using SVM?

房东的猫 提交于 2019-12-11 13:00:59
问题 Well, I am making a sentiment analysis classifier and I have three classes/labels, positive, neutral and negative. The Shape of my training data is (14640, 15), where negative 9178 neutral 3099 positive 2363 I have pre-processed the data to make it standardized and applied the bag-of-words word vectorization technique to the text of twitter for making it feedable to the model, whose size is then (14640, 1000). As the Y, means the label is in the text form so, I applied LabelEncoder so that I

R: make pls calibration models from n number of subset and use them to predict different test sets

流过昼夜 提交于 2019-12-11 12:44:51
问题 I am trying to apply a function I wrote that uses the 'pls' package to make a model and then use it to predict several test set(in this case 9), returning the R2,RMSEP and prediction bias of each test set for n number of subset selected from the data frame. the function is cpo<-function(data,newdata1,newdata2,newdata3,newdata4,newdata5,newdata6,newdata7,newdata8,newdata9){ data.pls<-plsr(protein~.,8,data=data,validation="LOO")#making a pls model newdata1.pred<-predict(data.pls,8,newdata

Create multiple classes from continuous variables Python

断了今生、忘了曾经 提交于 2019-12-11 11:35:31
问题 I would like to convert my continuous predictor variable (stock returns) into a categorical variable (5 bins, either 5 bins with equal number of stocks OR absolute thresholds, say -30% to -20%, then -19% to -10% etc.) Is there some Python package that does this? scikit learn etc? 回答1: It seems like what you are looking for is either pandas.cut for absolute thresholds or pandas.qcut for equal sized bins. 回答2: numpy.histogram is also a useful option for discretizing stuff 来源: https:/

Model Prediction for pooled regression model in panel data

旧巷老猫 提交于 2019-12-11 09:07:59
问题 I'm trying to produce a predictive model where i performed multiple pooled regressions in each year (based on previous years) and thus allow coefficients to vary across time. (This might not make sense in the sample data provided, but it is done in practice for my sample). Here is what I came up so far: I adjusted my code to a reproducible sample from the plm package: The data is structured in the following way (panel) with firm, year indexed. > head(Grunfeld) firm year inv value capital 1 1

Equivalent of predict_proba for DecisionTreeRegressor

风格不统一 提交于 2019-12-11 08:29:45
问题 scikit-learn's DecisionTreeClassifier supports predicting probabilities of each class via the predict_proba() function. This is absent from DecisionTreeRegressor : AttributeError: 'DecisionTreeRegressor' object has no attribute 'predict_proba' My understanding is that the underlying mechanics are pretty similar between decision tree classifiers and regressors, with the main difference being that predictions from the regressors are calculated as means of potential leafs. So I'd expect it to be

How to provide multiple columns to setInputCol()

岁酱吖の 提交于 2019-12-11 07:37:46
问题 I am very new to Spark Machine Learning I want to pass multiple columns to features, in my below code I am only passing the Date column to features but now I want to pass Userid and Date columns to features. I tried to Use Vector but It only support Double data type but in My case I have Int and String I would be thankful if anyone provide any suggestion/solution or any code example which will fulfill my requirement Code: case class LabeledDocument(Userid: Double, Date: String, label: Double)

WEKA-generated models does not seem to predict class and distribution given the attribute index

本秂侑毒 提交于 2019-12-11 07:10:11
问题 Overview I am using the WEKA API 3.7.10 (developer version) to use my pre-made .model files. I made 25 models: five outcome variables for five algorithms. J48 decision tree. Alternating decision tree Random forest LogitBoost Random subspace I am having problems with J48, Random subspace and random forest. Necessary files The following is the ARFF representation of my data after creation: @relation WekaData @attribute ageDiagNum numeric @attribute raceGroup {Black,Other,Unknown,White}