I am working on eCommerce Events History in Cosmetics Shop dataset which you can find whole dataset here. I have to take one item from each user's basket and then predict that item.
Simply, I have dataset like this :
import pandas as pd
pd.read_clipboard(sep='\s\s+')
df3 = pd.DataFrame([[1,12,111], [1, 13,111], [1, 14,111]], columns=['user_id', 'product_id','session_id'])
user_id product_id session_id
0 1 12 111
1 1 13 111
2 1 14 111
I want to transform that dataset to below form :
user_id product_id1 product_id2 product_id3 session_id target_id
0 1 NaN 12.0 13 111 11
1 1 11.0 NaN 13 111 12
As you see target_id column is consist of removed item from each user's basket. After getting this dataset I want to do classification to predict this removed item