Click4Ai

507.

Hard

Implement an LSTM model to forecast a time series. The model should take in a sequence of historical values and output the next value in the sequence. **Example:** Given a sequence of daily temperatures [23, 21, 22, 24, 25], the model should output the next temperature value. **Constraints:** Use a single LSTM layer with 50 units, and a dropout rate of 0.2. The model should be trained on a dataset of 1000 time steps.

Test Cases

Test Case 1
Input: [[23, 21, 22, 24, 25]]
Expected: [[25.5]]
Test Case 2
Input: [[10, 12, 11, 13, 14]]
Expected: [[14.5]]
+ 3 hidden test cases