Tag Info

Hot answers tagged prediction

30

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 ...

20

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 ...

12

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 ...

8

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 ...

8

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 ...

7

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 ...

6

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 + ...

6

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, ...

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

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. ...

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 ...

4

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 ...

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

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.

4

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). ...

4

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 ...

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)

4

As @Ethan said there is no general answer to this question. There are multiple perspectives that you need to take into consideration. Amount of the data: The general tendency is more data will lead to better results. Variability of the data: A very important aspect is the variability of your data. If you have millions of data points that have almost the ...

3

As an extreme case, I had a chance to study on Forex (Foreign Exchange Rate) forecast and intensively compared performances of LSTM, windowed-MLP and ARIMA. As many articles say, Forex time series is close to the random walk series (it is completely non-stationary). None of these algorithms can predict next day's spot rate. For example, if there is no (or ...

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

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

A model is built on a specific set of features, which may include categorical features encoded using one-hot encoding. If you have new data with additional categories, your model has no idea how to interpret the significance of those categories. You should either map the new value to none of the 1-hot values identified in training, or to an 'other' value. ...

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

KMeans does correctly do what it is supposed to do. Just plot your data correctly, with the same scale on both axes... Y deviations do not matter, they are tiny compared to the X axis. Deviations there are 100x larger, so squared deviations even 10000x. Since KMeans minimized squared errors, only x matters When plotted correctly, your data more looks like ...

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

Ok let's say you have an LSTM() layer with return_sequences = True set. That means each LSTM cell in it is outputting its value. The output of the layer is therefore a sequence of outputs, not just the final one. That means the output is a processed time series, with sequential information in it. You want Dense() layers to take this information and use it ...

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 ...

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