FACSPy.ml.supervisedGating.run_data_setup#
- supervisedGating.run_data_setup(gated_samples, layer, scaling='StandardScaler', n_cells=None)#
Public method to run the data setup. Extracts gated samples and scales the data.
- Parameters:
gated_samples (
list[str]) – A list of sample_IDs of gated sampleslayer (
str) – The slot in adata.layers that contains the data to be used for training the classifier.scaling (
Optional[str]) – Scaling method. Can be one of MinMaxScaler, StandardScaler or RobustScaler.n_cells (
Optional[int]) – If integer, the indicated number of cells will be subsampled for training.
- Return type:
None
Examples
>>> adata = fp.create_dataset([...]) >>> gating = fp.ml.supervisedGating(dataset) >>> gating.run_data_setup( ... gated_samples = ["1", "2", "3"], ... layer = "compensated", ... scaling = "StandardScaler" ... ) >>> gating.setup_classifier("DecisionTreeClassifier") >>> gating.tune_hyperparameters( ... method = "HalvingRandomSearchCV", ... grid = {"max_depth": [10,20,100]} ... ) >>> gating.setup_classifier("DecisionTreeClassifier") >>> sampler = GateSampler(...) >>> gating.sample_cells(sampler) >>> gating.train() >>> gating.gate_dataset()