You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to perform k-means classification on the potential distance of the query dataset.
I simply called the extend_to_data function on the query dataset to do so.
However, I don't think the function gives me the potential distance.
defextend_to_data(self, data, **kwargs):
"""Build transition matrix from new data to the graph Creates a transition matrix such that `Y` can be approximated by a linear combination of landmarks. Any transformation of the landmarks can be trivially applied to `Y` by performing `transform_Y = transitions.dot(transform)` Parameters ---------- Y: array-like, [n_samples_y, n_features] new data for which an affinity matrix is calculated to the existing data. `n_features` must match either the ambient or PCA dimensions Returns ------- transitions : array-like, [n_samples_y, self.data.shape[0]] Transition matrix from `Y` to `self.data` """kernel=self.build_kernel_to_data(data, **kwargs)
ifsparse.issparse(kernel):
pnm=sparse.hstack(
[
sparse.csr_matrix(kernel[:, self.clusters==i].sum(axis=1))
foriinnp.unique(self.clusters)
]
)
else:
pnm=np.array(
[
np.sum(kernel[:, self.clusters==i], axis=1).Tforiinnp.unique(self.clusters)
]
).transpose()
pnm=normalize(pnm, norm="l1", axis=1)
returnpnm
Rather, it gives me the transition matrix, which I think is the diffusion probability matrix (transitioned optimal_t times).
So, to transform the transition matrix to the informational distance, I copied from the _calculate_potential function:
After merging reference.seurat and query.seurat, I visualized the phate dimensions and phate.k clusters.
The query.seurat points overlapped on the reference.seurat points, however, the phate.k position was a little off.
Reference:
Query:
Did I make a mistake? Also,
is there a direct way to obtain the potential distance matrix of newdata (query)?, or
is reference-based mapping with PHATE just not feasible?
Thank you.
The text was updated successfully, but these errors were encountered:
I am trying to perform k-means classification on the potential distance of the query dataset.
I simply called the extend_to_data function on the query dataset to do so.
However, I don't think the function gives me the potential distance.
Rather, it gives me the transition matrix, which I think is the diffusion probability matrix (transitioned optimal_t times).
So, to transform the transition matrix to the informational distance, I copied from the _calculate_potential function:
My attempt of mapping a query data on the reference dataset.
After merging reference.seurat and query.seurat, I visualized the phate dimensions and phate.k clusters.
The query.seurat points overlapped on the reference.seurat points, however, the phate.k position was a little off.
Reference:
Query:
Thank you.
The text was updated successfully, but these errors were encountered: