ecnet.tasks

Feature selection and hyperparameter-tuning helpers.

ecnet.tasks.select_rfr(dataset, total_importance=0.95, **kwargs)[source]

Reduce descriptor dimensionality by random-forest feature importance.

Parameters:
  • dataset (QSPRDataset) – Input dataset.

  • total_importance (float) – Cumulative importance fraction to retain.

  • **kwargs – Forwarded to sklearn.ensemble.RandomForestRegressor.

Returns:

Selected feature indices and their importances.

Return type:

Tuple[List[int], List[float]]

ecnet.tasks.tune_batch_size(n_bees, n_iter, dataset_train, dataset_eval, n_processes=1, **kwargs)[source]

Tune training batch size with an artificial bee colony search.

Parameters:
  • n_bees (int) – Number of employer bees in the ABC algorithm.

  • n_iter (int) – Number of ABC search iterations.

  • dataset_train (QSPRDataset) – Training dataset.

  • dataset_eval (QSPRDataset) – Evaluation dataset.

  • n_processes (int) – Process count for parallel evaluation. Default 1.

  • **kwargs – Training hyperparameters forwarded to model evaluation.

Returns:

Mapping with key batch_size.

Return type:

dict

ecnet.tasks.tune_model_architecture(n_bees, n_iter, dataset_train, dataset_eval, n_processes=1, **kwargs)[source]

Tune hidden-layer width, depth, and dropout with ABC search.

Parameters:
  • n_bees (int) – Number of employer bees in the ABC algorithm.

  • n_iter (int) – Number of ABC search iterations.

  • dataset_train (QSPRDataset) – Training dataset.

  • dataset_eval (QSPRDataset) – Evaluation dataset.

  • n_processes (int) – Process count for parallel evaluation. Default 1.

  • **kwargs – Training hyperparameters forwarded to model evaluation.

Returns:

Mapping with keys hidden_dim, n_hidden, and dropout.

Return type:

dict

ecnet.tasks.tune_training_parameters(n_bees, n_iter, dataset_train, dataset_eval, n_processes=1, **kwargs)[source]

Tune learning rate and learning-rate decay with ABC search.

Parameters:
  • n_bees (int) – Number of employer bees in the ABC algorithm.

  • n_iter (int) – Number of ABC search iterations.

  • dataset_train (QSPRDataset) – Training dataset.

  • dataset_eval (QSPRDataset) – Evaluation dataset.

  • n_processes (int) – Process count for parallel evaluation. Default 1.

  • **kwargs – Training hyperparameters forwarded to model evaluation.

Returns:

Mapping with keys lr and lr_decay.

Return type:

dict