Skip to content

satishpasumarthi/DeepRec

Repository files navigation

DeepRec

Collaborative Deep Learning for Rec. Systems

Environment Dependencies:

Python 2.7
MXNet

Library Dependencies:

getopt
matplotlib
numpy
pickle
sys

Directory Structure:

data - contains all the necessary input data files. Each dataset directory has separate readme file describing each file
results - directory where we saved our recall values and also various comparision plots
experiments - contains files related to all the experiments we did

src code:

Dataset creation

generate_datasets.py : To generate the datasets with given sparseness settings
mult.py: Reads the item-vocab files and feeds to the model as a matrix input
data.py: Wrapper for data.py

Evaluation

evaluate_CDL.py: To calculate recall values
#To calculate recall for citeulike-a(d=a) with dense setting(p=10) and number of encoder layers(l=2)
python evaluate_CDL.py -p 10 -l 2 -d a

cal_precision.py : To calculate mean Average Precision mAP
#To calculate mAP for citeulike-a(d=a) with dense setting(p=10) and number of encoder layers(l=2)
#c defines where to cut off the recommended articles
python cal_precision.py -p 10 -l 2 -d a -c 250

show_recommendation.py : To show the recommendations for a particular user
#To display recommendations for userid 8 (u=8) citeulike-a(d=a) with dense setting(p=10) and number of encoder layers(l=2)
python show_recommendation.py -p 10 -l 2 -d a -u 8

Main Model

autoencoder.py : Stacked Denoising AutoEncoder Model (SDAE)
BCD_one.py: Block Coordinate Descent optimization algorithm
cdl.py : Main Collaborative Deep Learning (CDL) wrapper file
model.py: Feature extraction and preparing data for SDAE
solver.py: Finutune and parameter update

Run:

Case 1:
For citeulike-a dataset (d=a) , with dense setting (P=10) and two encoder layers in SDAE(l=2)
python cdl.py -p 10 -l 2 -d a

Case 2:
For citeulike-t dataset (d=t) , with dense setting (P=3) and two encoder layers in SDAE(l=2)
python cdl.py -p 3 -l 2 -d t

Directory Tree: (output of 'tree -L 3')

.
├── autoencoder.py
├── BCD_one.py
├── cal_precision.py
├── cdl.py
├── data
│   ├── citeulike-a
│   │   ├── mult.dat
│   │   ├── P1
│   │   ├── P10
│   │   ├── P5
│   │   ├── raw_inputs
│   │   └── README.txt
│   └── citeulike-t
│       ├── mult.dat
│       ├── P1
│       ├── P10
│       ├── P3
│       ├── raw_inputs
│       └── README.txt
├── data.py
├── evaluate_CDL.py
├── experiments
│   ├── citeulike-a
│   │   ├── L2_P1
│   │   ├── L2_P10
│   │   ├── L2_P5
│   │   ├── L3_P1
│   │   ├── L3_P10
│   │   └── L3_P5
│   └── citeulike-t
│       ├── L2_P1
│       ├── L2_P3
│       ├── L3_P1
│       └── L3_P3
├── generate_datasets.py
├── model.py
├── mult.py
├── README.md
├── results
│   ├── plot_citeulike_a.py
│   ├── plot_citeulike_t.py
│   ├── plots
│   │   ├── citeulike-a
│   │   ├── citeulike-t
│   │   └── reco.png
│   └── recall
│       ├── baseline
│       └── tf-idf
├── show_recommendation.py
└── solver.py

Git references:

Releases

No releases published

Packages

No packages published

Languages