scglue.data.estimate_balancing_weight¶
-
scglue.data.
estimate_balancing_weight
(*adatas, use_rep=None, use_batch=None, resolution=1.0, cutoff=0.5, power=4.0, key_added='balancing_weight')[source]¶ Estimate balancing weights in an unsupervised manner
- Parameters
*adatas – Datasets to be balanced
use_rep (
Optional
[str
]) – Data representation based on which to match clustersuse_batch (
Optional
[str
]) – Estimate balancing per batch (batch keys and categories must match across all datasets)resolution (
float
) – Leiden clustering resolutioncutoff (
float
) – Cosine similarity cutoffpower (
float
) – Cosine similarity power (for increasing contrast)key_added (
str
) – Newobs
key added for the balancing weight
Note
While the joint similarity array would have a size of \(K^n\) (where \(K\) is the average number of clusters per dataset, and \(n\) is the number of datasets), a sparse implementation was used, so the scalability regarding dataset number should be good.
- Return type