function sample=SMOTE(T,N,k,type,attribute,AttVector)
% Implement SMOTE algorithm [1].
% This algorithm resamples the small class through taking each small
% class example and introducing synthetic examples along the line
% segments joining its small class nearest neighbors.
%
% Usage:
% sample=SMOTE(T,N,k,type,attribute,AttVector)
%
% sample: instance matrix.
% it does not contain original set but new synthetic samplesonly
% T : orginal minority class samples. No.Attribute * No.Instance
% N : number of new samples to generate
% k : k-NN used in the algorithm. default value is 5
% type: 'nominal' or 'numeric'.the former using VDM to deal with nominal
% attrinutes when calculate distance while the latter treats nominal
% attribu