python - Pandas Item to features matrix in to item-item matrix -
i have binary matrix have following structure
df = pd.dataframe({"col1": [0,1,0,1,1], "col2": [1,0,1,0,0],"col3": [1,1,1,0,1],"col4": [1,0,0,1,0]},index=['a', 'b', 'c', 'd', 'e'])
and applying similarity measure(jaccard distance) each row , want have type of item-item matrix end(the intersections values should comes jaccard
function\not actual values used here). final outcome should this.
b c d e 0 3 2 1 1 b 0 1 2 3 c 0 1 4 d 0 2 e 0
i have jaccard similarity function defined jaccard()
want know how apply df
can have type of representation matrix end. thank you!
Comments
Post a Comment