Hierarchical Representation Model(HRM)[1] is used to predict what costumers will purchase in the next basket, which is an important task in market analysis. This model is inspired by Word2Vec, an work in the area of NLP .

HRM contains two layers: the first layer is used to construct representation of transaction, which models the sequential behaviors, the second layer builds a hybrid representation by aggregating user representation and transaction representation, while the hybrid representations stand for users` preference to items in the next transaction.

HRM offers two operators to aggregate transaction representation in the first layer, and hybrid representation in the second layer, thus with different operators used in two layers, HRM can offer four different combination methods.

Getting Started

1.Download the
2.unpack the files package.bat to compile the source the demo script:

Working with the code

To work with HRM, you can simply run the class hrm.Learn. It should be noted that HRM needs 9 parameters, please refer to Learn to get more information.

Here we give an running example of HRM when choosing max operator in both two layers:

java -Xmx20g -cp hrm.jar hrm.Learn 0.05 25 10 50 50 0.01 0.9 0.5 100 > log


[1]Pengfei Wang, Jiafeng Guo, Yanyan Lan, Jun Xu, Shengxian Wan and Xueqi Cheng. Learning Hierarchical Representation Model for Next Basket Recommendation. In proceeding of SIGIR,2015

Download     Downloads  29  times