Skip to content

youweiliang/Multi-view_Graph_Learning

Repository files navigation

Multi-view Graph Learning

Code for the paper "Multi-view Graph Learning by Joint Modeling of Consistency and Inconsistency".

News

  • [Sep, 2020]: The code of the 7 multi-view spectral clustering algorithms (and a single-view spectral clustering algorithm) used for comparison in our paper is uploaded to this repository.
  • [Sep, 2020]: All datasets used in our paper are uploaded to Baidu Cloud and Google Drive.

Dataset

All datasets used in our paper are available at Baidu Cloud with code pqti and Google Drive. Each dataset is a mat file containing 2 variables fea (i.e., a MATLAB cell of features) and gt (i.e., ground truth label), except the file flower17.mat which contains a cell of distance matrices and ground truth since features are unavailable.

  • The distance matrices in flower17.mat should be squared before passing them into the SGF and DGF functions, and the string original should be passed into the functions as the metric parameter.
  • The datasets Reuters, Reuters-21578, BBCSport, and CiteSeer are text datasets with word frequence as features and thus should be used with the cosine metric for computing distance matrices.

Preparation

  • Using with MATLAB
    • Windows 64bit
      • Add some helper files to MATLAB path by addpath('MinMaxSelection'); addpath('util') command in MATLAB command window.
      • In the folder consistent_graph_learning, according to whether there is MKL or Visual Studio (VS) installed on your machine, choose one among the three files consistent_graph_dca_noMKL_noVS.mexw64, consistent_graph_dca_MKL_VS.mexw64, and consistent_graph_dca_MKL_noVS.mexw64. And rename the chosen file to consistent_graph_dca.mexw64. The default file consistent_graph_dca.mexw64 is just consistent_graph_dca_noMKL_noVS.mexw64, which assumes no MKL and no Visual Studio installed. If your dataset size is larger than 20,000, it is highly recommended to install MKL for better performance (it's free).
    • Windows 32bit, Linux, Mac OS
      • Add some helper files to MATLAB path by addpath('MinMaxSelection'); addpath('util') command in MATLAB command window.
      • Recompile the helper functions by running minmax_install in folder MinMaxSelection.
      • Recompile consistent_graph_dca following guidance in this README. And move compiled file consistent_graph_dca.mex??? (the filename extension depends on your system) to folder consistent_graph_learning.
  • Using with C++ or C
    For folks without MATLAB and for industrial usage, the Consistent Graph Learning algorithm is coded in C++ (or C with slight modification). So, it should be trivial to integrate it into a C++ or C application. Also, a pure MATLAB implementation should be simple by following the algorithm in the paper and would be as faster as a C++ implementation with MKL, since the computational bottleneck of the Consistent Graph Learning lies in large matrix multiplication and MATLAB internally uses MKL for matrix multiplication. Therefore, if using C++ or C implementation and the dataset size is larger than 20,000, it is highly recommended to install MKL (it's free). See this README.

Example usage

cd ./consistent_graph_learning
load('../data/UCI_Digits.mat', 'fea', 'gt')  % load features and ground truth
numClust = length(unique(gt)); 
[label, com_a] = SGF(fea, numClust);  % clustering labels and the learned consistent graph
score = getFourMetrics(label, gt)  % 4 metrics: ACC, ARI, NMI, purity
[label, com_a] = DGF(fea, numClust);
score = getFourMetrics(label, gt)

Citation

@article{liang2020multi,
  title={Multi-view Graph Learning by Joint Modeling of Consistency and Inconsistency},
  author={Liang, Youwei and Huang, Dong and Wang, Chang-Dong and Yu, Philip S},
  journal={arXiv preprint arXiv:2008.10208},
  year={2020}
}

About

Code for the paper "Multi-view Graph Learning by Joint Modeling of Consistency and Inconsistency"

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published