Rating each user and item by iterating a behavior matrix.
- user score:
$\mathbf e = (e_1, \cdots, e_u, \cdots, e_M)^\top \in \mathbb R^M $ - item score:
$\mathbf q = (q_1, \cdots, q_u, \cdots, q_N)^\top \in \mathbb R^N $ - behavior matrix:
$A = {A_{ui}} \in \mathbb R^{M\times N}$ - in iteration
$t$ : $$ \mathbf e^{(t)} = \frac 1 Z A \ \mathbf q^{(t-1)} \ \mathbf q^{(t)} = \frac 1 Z A^\top \ \mathbf e^{(t)} $$ where$Z$ is for normalization. In this implementation,$Z$ takes the max value (inducing max score tobe 1).
configure in file ./src/config.ini
iteration
: max num of iteration for trainstop_err
: threthold value of RSE difference of two adjacent iterations to stop traintop_num
: number of top users(Experts) and top items(high quality items) to output
- training data file is setted in config file:
file: train_data
- format (each line):
uid pid score
- user score:
file: user_score
- item score:
file: item_score
- top users(Expert):
file: top_user
- top items:
file: top_item
you can use ./src/demo.sh
to for a complete demonstration
cd ./lib; make clean; make
cd ./src; make clean; make
cd ./src
./generate_data.py
cd src
./spear config.ini
SPEAR: SPAMMING-RESISTANT EXPERTISE ANALYSIS AND RANKING IN COLLABORATIVE TAGGING SYSTEMS