Closed groceryheist closed 2 years ago
The problem is that you're passing an np.matrix
as input. You should pass an np.array
instead:
import trimap
import numpy as np
import pandas as pd
cossims = pd.read_feather("wiki_rule_cosinesimilarities.feather")
distmat = 1 - np.matrix(cossims.iloc[:,0:cossims.shape[0]],'double')
# convert to np.array
distmat = np.array(distmat)
tmap = trimap.TRIMAP(use_dist_matrix=True)
tmap = tmap.fit_transform(distmat)
Sorry, I understand that use_dist_matrix
is a bit misleading! I'll add a line to convert the input into a numpy array.
To reproduce:
I'm attaching the data in a zipfile. wiki_rule_cosinesimilarities.feather.zip