Compocyte.core.tunerΒΆ

Hyperparameter tuner utilities.

This module contains helper code for tuning hyperparameters of local classifiers, storing results and orchestrating grid/random search runs.

class Compocyte.core.tuner.Tuner(database_path: str, adata_path: str, hierarchy: dict, root_node: str, obs_names: list)[source]ΒΆ

Bases: object

get_best_trial(node) dict[source]ΒΆ
make_db() None[source]ΒΆ
make_entry(node: str, trials: int, fraction_correct: float, fraction_matches: int, n_features: int, hidden_layers: str, dropout: float, epochs: int, batch_size: int, starting_lr: float, max_lr: float, momentum: float, beta: float, gamma: float, threshold: float) None[source]ΒΆ
train_from_tuner(save_path: str, adata: scanpy.AnnData, parallelize=True, max_cells: int = None, stratify_by: str = None, processes: int = None) HierarchicalClassifier[source]ΒΆ
trial_run(cv_key: str, n_features: int, hidden_layers: list, dropout: float, epochs: int, batch_size: int, starting_lr: float, max_lr: float, momentum: float, beta: float, gamma: float, test_factor: int, parallelize: bool = True, num_threads=None, standardize_separately: str = None) None[source]ΒΆ