HistGBCLearner

class pyprophet.scoring.classifiers.HistGBCLearner(autotune=False, hgb_params=None, threads=1)[source]

Bases: AbstractLearner

Implements a scikit-learn HistGradientBoostingClassifier-based learner for scoring.

Note

HistGradientBoostingClassifier uses internal parallelism via OpenMP. To control thread usage and avoid CPU oversubscription, set the OMP_NUM_THREADS environment variable BEFORE launching pyprophet:

export OMP_NUM_THREADS=6
pyprophet score --in data.osw --classifier HistGradientBoosting --threads 3

The CLI will automatically set OMP_NUM_THREADS if not already set, but explicit control is more reliable. Setting it after Python/NumPy/Sklearn imports will have no effect.

Use threadpoolctl within the code as a runtime fallback, but OMP_NUM_THREADS must be set before import for guaranteed effect.

- tune

Tune hyperparameters using RandomizedSearchCV.

- learn

Train the HistGradientBoosting model using decoy and target peaks.

- score

Score the given peaks using the trained model.

- get_parameters

Retrieve the parameters of the model.

- set_parameters

Set the parameters of the model.

__init__(autotune=False, hgb_params=None, threads=1)[source]
get_parameters()[source]

Retrieve the parameters of the model.

learn(decoy_peaks, target_peaks, use_main_score=True)[source]

Train the HistGradientBoosting model using decoy and target peaks.

score(peaks, use_main_score)[source]

Score the given peaks using the HistGradientBoosting model.

set_parameters(classifier)[source]

Set the parameters of the model.

tune(decoy_peaks, target_peaks, use_main_score=True, cv_splits=3, n_jobs=-1)[source]

Tune hyperparameters using RandomizedSearchCV.