vae_cf
vae_cf copied to clipboard
One problem reveals when I rerun the program
Hi Dawen,
I am writing to ask if you ever had the following error when you implemented your program, which is shown in the snapshot attached with this message. This error came out after I converted your Jupyter notebook file into a python file named old_code.py and tried to run it.
After filtering, there are 9990682 watching events from 136677 users and 20720 movies (sparsity: 0.353%)
0 users sampled
1000 users sampled
2000 users sampled
3000 users sampled
4000 users sampled
5000 users sampled
6000 users sampled
7000 users sampled
8000 users sampled
9000 users sampled
0 users sampled
1000 users sampled
2000 users sampled
3000 users sampled
4000 users sampled
5000 users sampled
6000 users sampled
7000 users sampled
8000 users sampled
9000 users sampled
Traceback (most recent call last):
File "old_code.py", line 250, in
Apologize for such inconvenience and thank you for your attention meanwhile! :)
I got a similar error because I was using Python 3 to execute the code.
To rectify it, I changed the numerize function to:
def numerize(tp):
uid = [profile2id[x] for x in tp['userId']]
sid = [show2id[x] for x in tp['movieId']]
return pd.DataFrame(data={'uid': uid, 'sid': sid}, columns=['uid', 'sid'])
You can try using the above function and let me know if it works for you! All the best!
I got a similar error because I was using Python 3 to execute the code.
To rectify it, I changed the numerize function to:
def numerize(tp): uid = [profile2id[x] for x in tp['userId']] sid = [show2id[x] for x in tp['movieId']] return pd.DataFrame(data={'uid': uid, 'sid': sid}, columns=['uid', 'sid'])
You can try using the above function and let me know if it works for you! All the best!
It works my problem fine, there are bugs for me to keep on going though. Thank you!
There are many changes to make if you are using Python 3. All the best!
@shrawansapre Do you have the python 3.5+ file for this repo. If so could you share that. I am struggling to make it work on python 3.5+.
Thanks
def numerize(tp): uid = map(lambda x: profile2id[x], tp['userId']) sid = map(lambda x: show2id[x], tp['movieId']) return pd.DataFrame(data={'uid': [uid], 'sid': [sid]}, columns=['uid', 'sid'])
def numerize(tp): uid = map(lambda x: profile2id[x], tp['userId']) sid = map(lambda x: show2id[x], tp['movieId']) return pd.DataFrame(data={'uid': [uid], 'sid': [sid]}, columns=['uid', 'sid'])
This looks to give an error later on