GRU4Rec is the original Theano implementation of the algorithm in "Session-based Recommendations with Recurrent Neural Networks" paper, published at ICLR 2016 and its follow-up "Recurrent Neural Networks with Top-k Gains for Session-based Recommendations". The code is optimized for execution on the GPU.
Other
747
stars
222
forks
source link
In traing data the items are indexed, but in test data are not, is there anything wrong? #15
in traing data:
self.predict = None self.error_during_train = False itemids = data[self.item_key].unique() if not retrain: self.n_items = len(itemids) self.itemidmap = pd.Series(data=np.arange(self.n_items), index=itemids) data = pd.merge(data, pd.DataFrame({self.item_key: itemids, 'ItemIdx': self.itemidmap[itemids].values}), on=self.item_key, how='inner') offset_sessions = self.init(data)
and use "ItemIdx":
out_idx = data.ItemIdx.values[start]
but in test data(use "item_key"):
in_idx[valid_mask] = test_data[item_key].values[start_valid]
Is there anything wrong?