Previous topic

tuning module

Next topic

classifier module

This Page

distance module

bregman.distance.bhatt(d, z)
d = bhatt(d,z) 
Bhattacharyya-weighted distance for vector of distances, d, and pair-wise prior products, z.
bregman.distance.corr_coeff(A, B)
::
d = corr_coeff(A,B): Return Pearson’s product moment correlation coefficients Second dimension (num columns) of A and B must be the same
bregman.distance.corr_dist(A, B)
::
d = corr_dist(A,B): Return Pearson’s product moment correlation distance Second dimension (num columns) of A and B must be the same
bregman.distance.cosine(A, B)
::
d = cosine(A,B) Return the cosine distance between two matrices Second dimension (num columns) of A and B must be the same
bregman.distance.dot_normed(A, B)
d = dot_normed(A,B)
Return the normed dot-product distance between two matrices
Second dimension (num columns) of A and B must be the same
bregman.distance.dtw(M)
p,q,D = dtw(M) 
Use dynamic programming to find a min-cost path through matrix M.
Return state sequence in p,q, and cost matrix in D     
Ported from Matlab version by Dan Ellis, GPL v2
bregman.distance.euc(A, B, old_algorithm=False)
d = euc(A,B)
Return the Euclidean distance between two matrices.
Second dimension (num columns) of A and B must be the same.
bregman.distance.euc2(A, B)
d = euc2(A,B) , a faster implementation of Euclidean distance
Return the Euclidean distance between two matrices.
Second dimension (num columns) of A and B must be the same.
bregman.distance.euc_normed(A, B)
d = euc_normed(A,B)
Return the normed Euclidean distance between two matrices
Second dimension (num columns) of A and B must be the same
bregman.distance.kl(a, b, symmetric=False)
::
d = kl(a,b, symmetric) Kullback-Leibler divergence for two PMFs/histograms a and b - vectors with the same dimensionality with sum(a)==sum(b)==1 symmetric - Boolean flag to indicate use of symmetric kl
bregman.distance.mds(D, n=0, tol=0.90000000000000002)
P = mds(D,[n, tol])
Multidimensional scaling of distance matrix D.

inputs:
 D   - a distance matrix (similarity=0, dissimilarity=1)
      must be symmetric, positive, semidefinite,
      i.e. all values >=0 and D[i,j] == D[j,i]
 n   - dimensionality of result [default (automatic)]
 tol - tolerance [0-1] of auto selected dimensions [0.9] 

 outputs:
 P - a matrix of points in n dimensions
 s - Kruskal stress of solution