Code covered by the BSD License  

Highlights from
Kennard-Stone algorithm (KS) for data partition

  • Rank=ks(X)+++ Employ the Kennard-Stone algorithm for selecting the representative samples;
  • demo.mgenerate a dataset with 200 samples and 2 variables.
  • View all files

Kennard-Stone algorithm (KS) for data partition

by

 

28 Feb 2013 (Updated )

A state-of-the-art algorithm for partitioning a data into a training set and a test set

demo.m
% generate a dataset with 200 samples and 2 variables.
X=randn(200,2);
% plot the distribution of the samples
plot(X(:,1),X(:,2),'.');
% perform Kennard-Stone partition
Rank=ks(X);
% select the most representitve 20 samples;
index=Rank(1:20);
%+++ show the selected 20 samples;
hold on;
plot(X(index,1),X(index,2),'ro','markersize',10);



Contact us