Demo code of BMLS in the paper of "Bayesian multi-label learning with sparse features and labels, and label co-occurrences", Artificial Intelligence and Statistics (AISTATS) 2018. Paper
-
The code is a mixture of Matlab and C++. The code has been tested in MacOS and Linux (Ubuntu). To run it on Windows, you need to re-compile all the .c files with MEX and a C++ complier.
-
Requirements: Matlab 2016b (or later).
-
We have offered the Bibtex dataset used in the paper, which is downloaded from The Extreme Classification Repository and stored in MAT format:
bibtex.mat contains:
X_tr
andX_te
: N by D feature (sparse and binary) matrix for N instances with D features for training and testing, respectively.Y_tr
andY_te
: N by L label (sparse and binary) matrix for N instances with L labels for training and testing, respectively.
bibtex_missing_label.mat contains:
Y_tr
: N by L label (sparse and binary) matrix for N instances with L labels for training, where we randomly removed 80% entries from the label matrix.
bibtex_missing_instance.mat contains:
X_tr
: N by D feature (sparse and binary) matrix for N instances with D features for training, where we reduced the size of training instances to 20%.Y_tr
: N by L label (sparse and binary) matrix for N instances with L labels for training, where we reduced the size of training instances to 20%.
Please prepare your own datasets in the above format. If you want to use the bibtex dataset, please cite the original papers, which are cited in our paper.
- Run the demos:
-demo.m
: run the original version of BMLS on bibtex.
-demo_missing_label.m
: run BMLS with label co-occurrences in the case with missing labels.
-demo_missing_instance.m
: run BMLS with label co-occurrences in the case with fewer traning instances.
-
CRT_sum_mex.c
,Multrnd_Matrix_mex_fast.c
andMultrnd_mijk.c
,truncated_Poisson_rnd.m
are borrowed from NBP_PFA and EPM, respectively, of Mingyuan Zhou. If you want to use the above code please cite the related papers. -
The code has no support but if you find any bugs, please contact me by email ([email protected]).