FACSPy.ml.supervisedGating.tune_hyperparameters#
- supervisedGating.tune_hyperparameters(method, grid, **hyperparameter_search_kwargs)#
Method to tune hyperparameters of the classifier.
- Parameters:
method (
Literal['HalvingRandomSearchCV','HalvingGridSearchCV','RandomizedSearchCV','GridSearchCV']) – One of HalvingRandomSearchCV, GridSearchCV or RandomizedSearchCV. The method that is used for the gridsearch.grid (
dict) – The parameters to test. For further documentation, refer to the sklearn documentation.
- 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") >>> gating.train() >>> gating.gate_dataset()