# Tag Info

29

Statement 1 is correct, statement 2 is correct, but requires elaboration, and statement 3 is incorrect for seasonal ARIMA: The following might point you in the right direction but hopefully you'll get a few more answers with more depth in the arena of LSTM. You mention that you have tried both algorithms and that you are simply trying to figure out which ...

29

High validation scores like accuracy generally mean that you are not overfitting, however it should lead to caution and may indicate something went wrong. It could also mean that the problem is not too difficult and that your model truly performs well. Two things that could go wrong: You didn't split the data properly and the validation data also occured in ...

16

Let's first see what we need to do when we want to train a model. First, we want to decide a model architecture, this is the number of hidden layers and activation functions, etc. (compile) Secondly, we will want to train our model to get all the paramters to the correct value to map our inputs to our outputs. (fit) Lastly, we will want to use this model ...

11

Directly, this is not possible. However, if you model it in a different way you can get out confidence intervals. You could instead of a normal regression approach it as estimating a continuous probability distribution. By doing this for every step you can plot your distribution. Ways to do this are Kernel Mixture Networks (https://janvdvegt.github.io/2017/...

10

Alright so I rewrote some parts of your model such that it makes more sense for a classification problem. The first and most obvious reason your network was not working is due to the number of output nodes you selected. For a classification task the number of output nodes should be the same as the number of classes in your data. In this case we have 5 kinds ...

7

Accuracy is a measure of comparing the true label to the predicted label. K-Means is an unsupervised clustering algorithm where a predicted label does not exist. So, accuracy can not be directly applied to K-Means clustering evaluation. However, there are two examples of metrics that you could use to evaluate your clusters. Within Cluster Sum of Squares ...

6

There is no "mismatch" of accuracy. Your problem is that you have an image segmentation problem where 99% of the pixels should be zero. So getting 99% accuracy is trivially easy. A model that predicts just blank output images would score roughly the same as your network has so far. Your accuracy metric is not meaningful. The low Dice coefficient score gives ...

6

Decrease the number of hidden layers; you can omit the dense layer with $50$ neurons. Furthermore, train your network more. You should also provide more data. It is not much at the moment. Your current architecture is very deep for such a relatively easy task. Consequently, it needs more train time. You can just decrease the size of the current model by ...

6

Welcome to the site. I think you were right that the prediction lags behind the true value because the series is autoregressive (i.e. a strong way to predict tomorrow’s value is “It will be about the same as today”). Your model therefore corrects itself with the new information when it misses a big jump. In other words, if the price jumps one day and your ...

5

Adding to @AN6U5's respond. From a purely theoretical perspective, this paper has show RNN are universal approximators. I haven't read the paper in details, so I don't know if the proof can be applied to LSTM as well, but I suspect so. The biggest problem with RNN in general (including LSTM) is that they are hard to train due to gradient exploration and ...

5

Yep this is a common problem. What I would do is use SKLearns label encoder. With a similar API to SKLearn models, it can be fit to your category - meaning that any new data passed through the encoder object is encoded in the same fashion. For example # Import the encoder from sklearn.preprocessing import LabelEncoder # Fit it to your training set + ...

5

This answer goes a little bit in a different direction, but I hope it still answers your question. It uses the idea of a rolling forecast/prediction. Because you use the word horizon, I will assume you mean that you would like to predict 10 days into the future at a given time step. There are a few ways of doing this. With this kind of time-series problem, ...

5

A more general adjustment for resampling (not just the simple undersampling in your linked paper) exists: Add $\ln\left(\frac{p_1(1-r_1)}{(1-p_1)r_1}\right)$ to the log-odds of each prediction, where $p_1$ is the proportion of the positive class in the original dataset, and $r_1$ is the proportion of the positive class in the resampled dataset. ...

4

I’ve come to the same conclusion as yourself and others, traditional forecasting is still probably the most applicable and maybe reliable for time series of numeric values. There is some slight bleed in deep learning in discussion where time series for numeric values gets mixed into deep learning, where deep learning (currently) applies to modern challenges ...

4

Use the CountVectorizer you have fitted to preprocess your custom input then feed it to your model for prediction. custom_input = ['insert text here'] custom_input = count_vectorizer.transform(custom_input) custom_prediction = random_forest.predict(custom_input)

3

It depends on the meaning of the classes, and whether they have any meaningful order. If they are ordinal or a scale, then there is a meaningful ordering, and it can potentially be reasonable to order them and then assign labels $1, 2, \dots, n$ in order to the classes. This is what you call "LabelEncode". In some cases, some form of regression might also ...

3

ARIMA models are linear and LSTM models are nonlinear. Some other parametric nonlinear time series models that statisticians have studied are Threshold Autoregressive Models (TAR) and Smooth Transition Autoregressive Models (STAR). The R package tsDyn implements these models. I wonder how STAR models do vs. LSTM.

3

Your edit is not right. from the keras documentation you can actually understand the difference between timesteps and batches. I take your examples: For the first example. You have 4 instances, or samples, or sequences. The length of each sequence is 30, now you actually take 3 batches, each of these batch is composed by 4 instances, or samples, or ...

3

Accuracy is measured in classification model by comparing the predicted labels to the actual known labels. The predicted labels are a function of both the predicted probabilities for each class and a predefined threshold(binary classification usually is 0.5) So if sample A got predict_proba of {0: 0.2, 1: 0.8} it will be labeled as 1(since 0.8 > 0.5). ...

3

Based on your question there are couple of things which I would assume to answer your question: As you need to predict the commodity price the data which is collected is time series data. Since you want to use other commodity to predict, it means that you don't have any past data of the product which you want to predict. The answer could be derived by ...

3

I can't tell you for sure without you describing your calculation more or showing code, but my guess is you're not actually calculating the posterior probability here. I bet this is just the conditional likelihood, or at best the unnormalized posterior. Remember: the posterior calculation has a division component. Does yours? You're probably forgetting to ...

3

What you are trying to do here is forecast the future values of a time series. This is a predictive problem and the future values will depend on a number of latent factors. I will assume all we have access to is historical data from the series as your question indicates. If you want to predict a future value for the time series, you should not only use the ...

3

I think the most intuitive solution would be to have two networks (i.e. one for predicting the next values in the time series and one for classifying if it is or isn't a seizure), because these are two very different tasks and there are different models that excel at each. The classification network could even be on top of the time series predictor (include ...

3

Because neural networks with a sufficiently large hidden layer can approximate arbitrary functions only on compact sets (this is one of the first things you can learn when you try to read some literature about neural networks). Train your neural network on a range from 0 to 100 and then ask the square of 78. The much more interesting problem of learning ...

3

One way to estimate the level of confidence we have about an ANN prediction is to use dropout perturbations. The idea was proposed in this paper: Dropout as a Bayesian Approximation. Representing Model Uncertainty in Deep Learning. The core idea is to use dropout as a perturbation method, and check how predictions change with varying levels of dropout. Once ...

3

It's not true in general. Decision trees tends to overfit in comparison to other algorithms, which provide too low accuracy. But if you use a decision tree in the right way i.e you prepare data in the proper format, use feature selection and perform k-fold cross-validation everything should be ok. I am sure that you misread it. There is no reason why DT ...

3

Not enough karma to simply comment, so I have to log this as an answer. Does it make sense? Sure! But keep in mind that if you train your model on a single location, it can only really be trusted to be used on future data from that same location. Could your model generalize to other locations perhaps? Maybe, but your model didn't see anything so you can't be ...

3

Welcome to Data Science on Stack Exchange, This is a common question, predicting future prices or forecasting. The gap you see is due to the random nature of prices such as this, along with the underlying complexity of this topic. Unless there is a time pattern in the data, a LSTM model won't predict well. LSTM will especially perform poorly if the data is ...

2

You should read that : http://www.analyticsvidhya.com/blog/2016/02/time-series-forecasting-codes-python/ and take a look at that : http://statsmodels.sourceforge.net/0.6.0/generated/statsmodels.tsa.arima_model.ARIMA.html The endog argument is your time serie and the exog is your other data

2

The way you are doing it is just fine. The idea in time series prediction is to do regression basically. Probably what you have seen other places in case of vector, it is about the size of the input or basically it means feature vector. Now, assuming that you have t timesteps and you want to predict time t+1, the best way of doing it using either time series ...

Only top voted, non community-wiki answers of a minimum length are eligible