Code for the paper "Multi-view Graph Learning by Joint Modeling of Consistency and Inconsistency".
- [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.
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 stringoriginal
should be passed into the functions as the metric parameter. - The datasets
Reuters
,Reuters-21578
,BBCSport
, andCiteSeer
are text datasets with word frequence as features and thus should be used with thecosine
metric for computing distance matrices.
- 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 filesconsistent_graph_dca_noMKL_noVS.mexw64
,consistent_graph_dca_MKL_VS.mexw64
, andconsistent_graph_dca_MKL_noVS.mexw64
. And rename the chosen file toconsistent_graph_dca.mexw64
. The default fileconsistent_graph_dca.mexw64
is justconsistent_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).
- Add some helper files to MATLAB path by
- 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 folderMinMaxSelection
. - Recompile
consistent_graph_dca
following guidance in this README. And move compiled fileconsistent_graph_dca.mex???
(the filename extension depends on your system) to folderconsistent_graph_learning
.
- Add some helper files to MATLAB path by
- Windows 64bit
- 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.
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)
@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}
}