def sim_to_dist(mat): """ (matrix) -> matrix invert the similarity matrix to distance matrix """ from ve.simmat.lmatrix import lmatrix return lmatrix(labels=mat.labels, data= 1 - mat)