selfSimilarity¶
Parameters¶
Parameter label |
I/O type |
Data type |
Mandatory parameter? |
Default value |
---|---|---|---|---|
|
input |
matrix (2D numpy array) |
yes |
N/A |
|
input |
vector |
yes |
N/A |
|
output |
2D numpy array |
N/A |
N/A |
Functionality¶
Module converts a self-similarity matrix based on the Edit distance between note sequences.
Each element in inputVec
has a segment ID provided by the corresponding element of groupVec
.
Elements of inputVec
with the same segment ID are grouped to sequences.
The selfSimilarityMatrix
contains the pair-wise similarity values between these sequences.
The similarity is computed as 1 minus the Edit distance.
Here are some examples:
inputVec = [1,2,3,4,1,2,3,5,1,2,5,6,1,7,8,9]
groupVec = [0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3]
...
selfSimilarityMatrix = np.array([[1.,0.75,0.5,0.25],[0.75,1.,0.5,0.25],[0.5,0.5,1.,0.25],[0.25,0.25,0.25,1.]]