Skip to content

fkid009/BPR-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BPR-MF: Bayesian Personalized Ranking with Matrix Factorization

This repository implements the core idea of the BPR (Bayesian Personalized Ranking) paper by Rendle et al., using NumPy-based matrix factorization.

BPR is designed for learning personalized item rankings from implicit feedback (e.g., clicks, purchases), and optimizes pairwise ranking using stochastic gradient descent.

How to Run

1. Prepare interaction data

The input file should be a .csv file with at least two columns user_id, item_id.

A sample file (ex_data.csv) is provided in the data/ folder.

2. Train the model

Run main.py using the following command:

python main.py --data_file ex_data \
               --latent_dim 32 \
               --reg 0.01 \
               --learning_rate 0.01 \
               --epochs 100 \
               --num_samples 1000

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages