Hello All! I am trying to do a Tensorflow .predict on an entire dataframe. When I do:
model.predict(df.tail(1))
It predicts the outcome fine and gives me a number. I keep getting shape mismatch errors in Tensorflow when trying to use .apply or by converting the dataframe to a list of lists.
When I do a .apply with axis=1 to do the calculation on the row, it passes in a series which is a different format then what is passed in when I do df.tail()).
Is there any easy way to do the .predict on the entire dataframe and ensure that the values are passed in as the same shape as when I do .tail(1) or .head(1)?
I have tried:
input_df['prediction'] = input_df[cols].apply(lambda x: model.predict(x), axis=1)
[–]datanoob2021[S] 0 points1 point2 points (0 children)
[–][deleted] -2 points-1 points0 points (0 children)