New answers tagged

0

In order to predict the first out-of-sample datapoint you should take a sequence of the data and pass it to the LSTM model (example in pseudo-code): pred = model.predict(X[-10:]) For the next predictions you'll have to include the current prediction into the data passed to the model. X = X + [pred] next_pred = model.predict(X)


0

In the definition of the convolutional layer you defined input shape to be (77, 1), but then your actual input has shape (None, 1, 77). As you can see, the dimensionality of the axes are swapped. They should match.


0

Your dataset doesn't match with the expected input's or inner's shape. You have to reshape them accordingly.


0

Did you try this? Xnew = [[...], [...]] ynew = model.predict_classes(Xnew)


0

To deal with your problem, it is important to know how LSTM works exactly: when you have two linked variables with a very different pace, the LSTM parameters for forgetting or memorizing will probably have to do a big gap that could alter the predictions. Like any other physic ML problem, your variables need to be at a "common sense" scale, and ...


0

It appears that ypred is probability and ytest is one-hot encoded category. The most common way to convert probability to a single category prediction is softmax.


2

In your case, it seems that time has a clear meaning because you have a movement logic between images. As a consequence, I would recommend models adapted to videos like MetNet, ConvLSTM or PredRNN... https://ai.googleblog.com/2020/03/a-neural-weather-model-for-eight-hour.html https://proceedings.neurips.cc/paper/2015/hash/07563a3fe3bbe7e3ba84431ad9d055af-...


0

You question has two parts 1) how to use LSTM to find anomalies in time series data 2) how to deal with imbalanced data. Regarding 1) the closest thing comes to my mind is this post from the sister website https://stats.stackexchange.com/questions/127484/cluster-sequences-of-data-with-different-length/440432#440432 - the only difference is you have labeled ...


3

The metric to the time series forecastability is "the spectral entropy". I learned it from some talk of Rob Hyndman, so here is the description of his implementation for R tsfeatures package, entropy The spectral entropy is the Shannon entropy −∫π−πf^(λ)logf^(λ)dλ, where f^(λ) is an estimate of the spectral density of the data. This measures the “...


0

Before some days I had the same problem and I found quite useful these sites, https://machinelearningmastery.com/how-to-develop-lstm-models-for-time-series-forecasting/, https://machinelearningmastery.com/time-series-prediction-lstm-recurrent-neural-networks-python-keras/ and https://www.tensorflow.org/tutorials/structured_data/time_series.


0

I don't think you actually need regularization since regularization techniques are needed in an overfitted model but your model works poorly on both train/validation sets, which is evidence of underfitting. If you want to improve your network, you can consider adding more layers to your network (e.g. stacked LSTM). I don't know what exactly the Haiku is but ...


0

I had this issue - while training loss was decreasing, the validation loss was not decreasing. I checked and found while I was using LSTM: I simplified the model - instead of 20 layers, I opted for 8 layers. Instead of scaling within range (-1,1), I choose (0,1), this right there reduced my validation loss by the magnitude of one order I reduced the batch ...


Top 50 recent answers are included