gamboviol / bpr

Bayesian Personalized Ranking
212 stars 87 forks source link

Please help me,why xrange is not defined #11

Open weiyidounai opened 7 years ago

weiyidounai commented 7 years ago

Traceback (most recent call last): File "D:/PycharmProjects/recommendation algorithm/bpr.py", line 289, in model.train(data,sampler,num_iters) File "D:/PycharmProjects/recommendation algorithm/bpr.py", line 45, in train self.init(data) File "D:/PycharmProjects/recommendation algorithm/bpr.py", line 62, in init self.create_loss_samples() File "D:/PycharmProjects/recommendation algorithm/bpr.py", line 70, in create_loss_samples self.loss_samples = [t for t in sampler.generate_samples(data, num_loss_samples)] File "D:/PycharmProjects/recommendation algorithm/bpr.py", line 70, in self.loss_samples = [t for t in sampler.generate_samples(data, num_loss_samples)] File "D:/PycharmProjects/recommendation algorithm/bpr.py", line 168, in generatesamples for in xrange(self.num_samples(self.data.nnz)): NameError: name 'xrange' is not defined

datvp09 commented 6 years ago

if you use python 3, use range() instead