Python Forum
Keras.Predict into Dataframe - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: Keras.Predict into Dataframe (/thread-24986.html)

Pages: 1 2


RE: Keras.Predict into Dataframe - Finpyth - Mar-15-2020

(Mar-15-2020, 01:01 PM)jefsummers Wrote: predictions = []. Sorry, forgot the equal sign
It's just to define predictions as a list so you can use append

It works in some way! Big Grin

It returns a "list" of 40 "DataFrame" for each target


RE: Keras.Predict into Dataframe - jefsummers - Mar-15-2020

40 for each target? Eww. You can look at them to see how you may want to combine.
In one project I was getting restaurants in Toronto, and Foursquare limits a search result to 50. So, I had to combine a bunch of dataframes so I could get them all. Code is:
#combine the dataframes
df_r_comb = array_of_restaurant_frames[0]
df_eth = array_of_Eth[0]
for frame in array_of_restaurant_frames :
    df_r_comb = pd.concat([df_r_comb,frame], sort=False)
for frame in array_of_Eth :
    df_eth = pd.concat([df_eth,frame], sort=False)

print(df_r_comb.shape)
print(df_eth.shape)
Two sets of restaurants combined - all, and then Ethiopian (the task of the project was to find where to put a new Ethiopian restaurant)
That adds the rows of one dataframe to another. You would need to look at the frames to see if you want to add rows or columns as you combine.


RE: Keras.Predict into Dataframe - Finpyth - Mar-15-2020

Miss spelling, my bad :)
It returns a list that consist of one DataFrame for each of my targets(40).
Thank you for the help!


RE: Keras.Predict into Dataframe - hussainmujtaba - Aug-31-2020

Can't help if the code is not provided.Just take a look at Keras tutorial and see if it helps.
P.S: I don't think providing the code is going to mess up the thesis, may be you can provide with a different dataset