Hi everyone, Im trying to make a simple algorithm with keras work, so far it trains fine, but when I try to predict some value, it throws me a shape error, only that when I print to the debugger the shape it appears to be correct. Heres the code and the output.

for security in changes.AddedSecurities: symbol = security.Symbol new_feature = np.array(algorithm.History(security.Symbol,15, Resolution.Daily)["open"]) algorithm.Debug(f" Its shape is {new_feature.shape}") self.mom[symbol] = self.model.predict(new_feature) algorithm.Debug(f"Prediction for {symbol} is {self.mom[symbol]}")

The output in the debugger:

9 | 11:52:31: Runtime Error: ValueError : Error when checking input: expected dense_1_input to have shape (15,) but got array with shape (1,) at OnSecuritiesChanged in main.py:line 63 ValueError : Error when checking input: expected dense_1_input to have shape (15,) but got array with shape (1,) (Open Stacktrace) 10 | 11:52:41: Algorithm Id:(200821177eb8c61af0f08a86be772a20) completed in 27.77 seconds at 0k data points per second. Processing total of 742 data points. 11 | 11:52:41: Its shape is (15,)

Do you have any idea why this maight happen?

Author