Converting Numeric Matrix to Cell Array nesting columns into line (LSTM training input data)
Afficher commentaires plus anciens
Please, how can I convert a Numeric Matrix (1400 lines/steps x 30 columns/features) to Cell Array (1400x1) Nx1 as required for LSTM training?
In this case, the 30 columns by line must be nested into the one cell array each line.
In outer view, cell array will be (1400x1), but when click on cell it will open as (1x30) containing the 30 features columns in one line.
Simplified example:
From (5x4) matrix A (lines: timesteps/observations, columns: input features data)
1 2 3 4
2 3 4 5
3 4 5 6
4 5 6 7
5 6 7 8
To (5x1) cell array C (Nx1 as requested by LSTM, N = steps) nesting features columns into the cell:
{1x4} => (1 2 3 4) inside line cell (1x4)
{1x4} => (2 3 4 5) inside line cell (1x4)
{1x4} => (3 4 5 6) inside line cell (1x4)
{1x4} => (4 5 6 7) inside line cell (1x4)
{1x4} => (5 6 7 8) inside line cell (1x4)
I can build it manually from an empty cell array by entering in each line cell and pasting data (30 columns) into them, but my data has 1400 lines.
The label (output) categorical vector (5x1 example) for the LSTM is ready (1400x1 real) and contains binary classification (0, 1) for each line as expected responses.
Thanks!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Deep Learning Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!