I have a dataset with 5K rows (-1K for validation) and 17 columns, including the last one (the target integer binary label).
My model is simply this 2-layer LSTM:
model = Sequential()
df_train = pd.read_csv(train_file)
train_X, train_y = df_train.values[:, :-1], df_train['target'].values
Exception: When using TensorFlow, you should define explicitly the number of timesteps of your sequences. - If your first layer is an Embedding, make sure to pass it an "input_length" argument. Otherwise, make sure the first layer has an "input_shape" or "batch_input_shape" argument, including the time axis.
It looks like Keras uses the static unrolling approach to build recurrent networks (such as LSTMs) on TensorFlow. The
input_length should be the length of the longest sequence that you want to train: so if each row of your CSV file
train_file is a comma-delimited sequence of symbols, it should be the number of symbols in the longest row.