dynamo.tl.DDRTree

dynamo.tl.DDRTree(X, maxIter, sigma, gamma, eps=0, dim=2, Lambda=1.0, ncenter=None, keep_history=False)[source]

Provides an implementation of the framework of reversed graph embedding (RGE).

This function is a python version of the DDRTree algorithm originally written in R. (https://cran.r-project.org/web/packages/DDRTree/DDRTree.pdf)

Parameters:
  • X (ndarray) – The matrix on which DDRTree would be implemented.

  • maxIter (int) – The max number of iterations.

  • sigma (float) – The bandwidth parameter.

  • gamma (float) – Regularization parameter for k-means.

  • eps (int) – The threshold of convergency to stop the iteration. Defaults to 0.

  • dim (int) – The number of dimensions reduced to. Defaults to 2.

  • Lambda (float) – Regularization parameter for inverse praph embedding. Defaults to 1.0.

  • ncenter (Optional[int]) – The number of center genes to be considered. If None, all genes would be considered. Defaults to None.

  • keep_history (bool) – Whether to keep relative parameters during each iteration and return. Defaults to False.

Return type:

Union[DataFrame, Tuple[ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, List[ndarray]]]

Returns:

A dataframe containing W, Z, Y, stree, R, objs for each iterations if keep_history is True. Otherwise, a tuple (Z, Y, stree, R, W, Q, C, objs). The items in the tuple is from the last iteration. Z is the reduced dimension; Y is the latent points as the center of Z; stree is the smooth tree graph embedded in the low dimension space; R is used to transform the hard assignments used in K-means into soft assignments; W is the orthogonal set of d (dimensions) linear basis; Q is (I + lambda L)^(-1), where L = diag(B1) - B, a Laplacian matrix. C equals to XQ^(-1)X^T; objs is a list containing convergency conditions during the iterations.