Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@ def embedDistanceMatrix(dmatDf, method='kpca', n_components=2, **kwargs):
return

assert xy.shape[0] == dmatDf.shape[0]
xyDf = pd.DataFrame(xy[:, :n_components], index=dmatDf.index, columns=np.arange(n_components))

if isinstance(dmatDF, pd.DataFrame):
xyDf = pd.DataFrame(xy[:, :n_components], index=dmatDf.index, columns=np.arange(n_components))
else:
xyDf = pd.DataFrame(xy[:, :n_components], columns=np.arange(n_components))

if method == 'kpca':
"""Not sure how negative eigenvalues should be handled here, but they are usually
small so it shouldn't make a big difference"""
Expand Down