model.predict in Keras, Python error
But then again, the input clearly has the correct shape.


&gt;&gt;&gt; import numpy as np
&gt;&gt;&gt; X = np.arange(15)
&gt;&gt;&gt; X.shape
(15,)


In Keras, input_dim represents the number of input parameters, in your case that would be the number of columns of X or its second dimension (sometimes also referred to as number of features). It is clearly not 15. It is the first dimension that is 15. That means: X consists of 15 rows, also called samples (of one and the same feature).

So in that case, input_dim=1. 

However, you will then run into the problem of having specified Y = 0. First, Keras will throw an error because it is an integer. You could do Y = [0], but then you will get

ValueError: Input arrays should have the same number of samples as target arrays. Found 15 input samples and 1 target samples.


So you have to turn this into an array-like object containing 15 samples, e.g. a list of length 15.

However, in case you meant to feed one single sample X to your model, that maps to one single output Y = [0], then you need to reshape X accordingly, for example via 

X = np.arange(15).reshape(n_samples, n_features)


Can you figure out now what n_samples, n_features needs to be?