Knowledge Discovery Lab

Bipart Distance Metric Learning


Bipart Distance Metric Learning

Bipart is a novel algorithm for combining two distance metrics - one learned from the training set, and one learned from the test set.  The two distance metrics are combined using the Bipart trick, to form the Bipart distance metric.  This is a general framework for turning any two subspace learning or distance learning techniques into one semi-supervised learning method.

The following figure shows how Bipart can be used to perform classification and regression from accelerometer readings of individuals performing activities.



Source Code

MATLAB code for the Bipart method can be found here:

Bipart prediction with k-nearest neighbor prediction can be done with the following code:

============test code================
trainfea = rand(100,5); %#dimension * #features
% class labels: 1,2,3,4 for training set
traingnd = [ones(25,1) * 1; ones(25,1) * 2; ones(25,1) * 3; ones(25,1) * 4];
testfea = rand(80,5);
% groups: 2, 3, 4, 5 for test set
testgroup = [ones(20,1) * 2; ones(20,1) * 3; ones(20,1) * 4; ones(20,1) * 5];
options.k1 = 2;
options.k2 = 4;
[predlabel] = bipart(trainfea, traingnd, testfea, testgroup, options);



Please send correspondence to Yang Mu.


  1. Y. Mu*, H. Lo*, W. Ding, K. Amaral**, S. E. Crouter, “Bipart: Learning Block Structure for Activity Detection,” IEEE Transactions on Knowledge and Data Engineering (TKDE), Pages 2397-2409, Volume 25, Issue 10, doi: 10.1109/TKDE.2014.2300480, Oct. 2014.
    PDF link,
  2. Hamidreza Mohebbi*, Wei Ding, Yang Mu, “Learning Weighted Distance Metric from Group Level Information and Its Parallel Implementation,” Applied Intelligence, 10.1007/s10489-016-0826-7, Volume 46, Issue 1, pp 180–196, January, 2017.
    PDF link,
  3. Xiang Ren+, Wei Ding, Scott E. Crouter, Yang Mu, Rong Xie, “Activity recognition and intensity estimation in youth from accelerometer data aided by machine learning,” Applied Intelligence, 45(2): 512-529, September, 2016.
    PDF link,
Comments (0) Trackbacks (0)

No comments yet.

Leave a comment

You must be logged in to post a comment.

Trackbacks are disabled.