Triplet Loss-Based Metric Learning for Single-Cell Data
Source:R/scLearn_model_learning.R
runLMNN.Rd
Implements a triplet loss-based linear transformation learning to map gene expression into an embedding space where cells of the same type are close and those of different types are farther apart. This is a deep metric learning alternative to LMNN.
Usage
runLMNN(
high_varGenes,
expression_profile,
sample_information,
k = 5,
margin = 1,
learn_rate = 1e-04,
max_iter = 100,
seed = 1,
verbose = TRUE
)
Arguments
- high_varGenes
Character vector of highly variable gene names.
- expression_profile
A numeric matrix of gene expression values (genes x cells).
- sample_information
A named vector of cell type labels (names match column names of expression_profile).
- k
Number of positive neighbors per anchor to form triplets (default: 5).
- margin
Margin between positive and negative pairs (default: 1.0).
- learn_rate
Learning rate for updates (default: 1e-4).
- max_iter
Number of optimization iterations (default: 100).
- seed
Random seed (default: 1).
- verbose
Logical; whether to print progress messages (default: TRUE).