torchcell.transforms

PyG transforms applied to cell graphs. regression_to_classification and its COO variants normalize regression labels, bin them into classification targets, and invert the binning; hetero_to_dense_mask converts the sparse adjacencies of a HeteroData graph into boolean masks.

coo_regression_to_classification

Transforms converting COO-format regression labels to classification targets.

Classes

coo_regression_to_classification.COOLabelNormalizationTransform

Transform for normalizing labels in COO format with different strategies.

coo_regression_to_classification.BaseBinningStrategy

Base class for strategies that bin continuous values into classes.

coo_regression_to_classification.EqualWidthStrategy

Binning strategy with bins of equal width across the value range.

coo_regression_to_classification.EqualFrequencyStrategy

Binning strategy with bins holding roughly equal sample counts.

coo_regression_to_classification.AutoBinStrategy

Binning strategy that picks the bin count from the data's spread.

coo_regression_to_classification.COOLabelBinningTransform

Transform binning COO-format continuous labels into class indices.

coo_regression_to_classification.COOInverseCompose

A transform that applies the inverse of a sequence of transforms in reverse order.

hetero_to_dense_mask

Transform converting sparse hetero adjacencies to dense boolean masks.

Classes

hetero_to_dense_mask.HeteroToDenseMask

Convert sparse hetero adjacencies to boolean dense masks.

regression_to_classification

Transforms that bin regression labels into classification targets and invert them.

Classes

regression_to_classification.LabelNormalizationTransform

Transform for normalizing labels with different strategies.

regression_to_classification.BaseBinningStrategy

Base strategy providing shared clamping and encoding for label binning.

regression_to_classification.EqualWidthStrategy

Binning strategy with bins of equal width across the value range.

regression_to_classification.EqualFrequencyStrategy

Binning strategy with quantile-based bins of roughly equal frequency.

regression_to_classification.AutoBinStrategy

Binning strategy that infers the bin count from the data std and range.

regression_to_classification.LabelBinningTransform

Transform converting continuous labels into binned classification targets.

regression_to_classification.InverseCompose

A transform that applies the inverse of a sequence of transforms in reverse order.

Functions

regression_to_classification.resolve_label_type

Return the lower-cased label_type of a binning config, refusing unknown ones.