LinearLearner

class pyprophet.scoring.classifiers.LinearLearner[source]

Bases: AbstractLearner

Implements a linear classifier for scoring.

- score

Score the given peaks using the linear model.

- averaged_learner

Create an averaged learner from multiple parameter sets.

- set_parameters

Set the parameters of the linear model.

- get_weights

Retrieve feature weights from the model.

classmethod averaged_learner(params, **kwargs)[source]

Create an averaged learner from multiple parameter sets.

get_weights(features: List[str]) DataFrame[source]

Return a DataFrame with feature names and their weights, sorted by absolute weight.

Parameters:

features (List[str]) – List of feature names.

Returns:

DataFrame containing feature names and weights.

Return type:

pd.DataFrame

score(peaks, use_main_score)[source]

Score the given peaks using the linear model.

set_parameters(classifier)[source]

Set the parameters of the linear model.