# Predict song genre using LSTM

I have a dataset of songs based on genres. For example, a song may hold {5, 2, 3} as scores set for Sentimental, Rock and Jazz. In total there are 800 songs sequentially arranged. I want to predict the next possible scores of the 801st song. I googled and got that RNNs and LSTMs are pretty good in predicting in terms of time. But all those examples are based on single values like (10,20,30,40,50) and the next predicted value will be 60. But in my problem, each item has three real values. So how to write code I do not understand. Any help or link to an article/paper is appreciated.

Typically a dense layer follows the LSTM/RNN layer(s), because the output of the RNN cell is of dimension of your choice, i.e. latent space dimension. Since you've three outputs, the final Dense layer will have three neurons, aiming to regress genre points. The RNN layer's duty is to figure out a compressed, latent representation of your series going back a couple of time steps of your choice. Here is a good (I believe) introductory tutorial for multivariate time series forecasting. Keras itself has a short example on multi-input/multi-output models. One trick that can be useful for the last Dense layer is that if you have bounded outputs (e.g. $$[0,5]$$), scaling the output variable and regressing via sigmoid activation may help, instead of linear activation that can cause overflow issues on some inputs.
• A sample will contain a few past entries together with the target, e.g. $x_{n-1}...,x_{n-20}$ can be features, and $x_n$ is the target. Sequence size here is 20. Batch will contain a few samples of your choice. If your batch size is 5, you'll have 5 samples, and in each sample you'll have 5 targets, each having 20 past values. – gunes May 20 '19 at 20:18