qbiocode.embeddings.embed module#

Summary#

Functions:

get_embeddings

This function applies the specified embedding technique to the training and test datasets.

Reference#

get_embeddings(embedding, X_train, X_test, n_neighbors=30, n_components=None, method=None)[source]#

This function applies the specified embedding technique to the training and test datasets.

Parameters:
  • embedding (str) – The embedding technique to use. Options are ‘none’, ‘pca’, ‘nmf’, ‘lle’, ‘isomap’, ‘spectral’, or ‘umap’.

  • X_train (array-like) – The training dataset.

  • X_test (array-like) – The test dataset.

  • n_neighbors (int, optional) – Number of neighbors for certain embeddings. Defaults to 30.

  • n_components (int, optional) – Number of components for the embedding. If None, it defaults to the number of features in X_train.

  • method (str, optional) – Method for Locally Linear Embedding. Defaults to None.

Returns:

Transformed training and test datasets.

Return type:

tuple