gt4sd.properties.scorer module¶
Summary¶
Classes:
Property Predictor Scorer for molecules. |
|
Property Predictor Scorer. |
|
Property Predictor Scorer for protein. |
Reference¶
- class PropertyPredictorScorer(name, scoring_function, target)[source]¶
Bases:
DistanceScorer
Property Predictor Scorer.
- __init__(name, scoring_function, target)[source]¶
Scoring function that calculates a generic score for a property.
- Parameters
name (
str
) – name of the property to score. Needed for validation.scoring_function (
PropertyPredictor
) – callable scoring function.target (
Union
[float
,int
]) – target score that will be used to get the distance to the score of a molecule or protein (not be confused with parameters[“target”]).
- score(sample)[source]¶
Generates a score for a given molecule or protein.
- Parameters
sample (
str
) – molecule or protein.- Return type
float
- Returns
A score for the given molecule or protein.
- score_list(sample_list)[source]¶
Generates a list of scores for a given molecule or protein list.
- Parameters
samples_list – A List of molecules or proteins.
- Return type
List
[float
]- Returns
A List of scores
- predictor(sample)[source]¶
Generates a prediction for a given molecule or protein.
- Parameters
sample (
str
) – molecule or protein.- Return type
Union
[float
,int
]- Returns
A score for the given SMILES
- validate_input(sample, property_name)[source]¶
Validates the sample in input. If self.name is a property available for molecules, check that sample is a SMILES. If self.name is a property available for proteins, check that sample is a protein.
- Parameters
sample (
str
) – molecule or protein.- Raises
ValueError – if the sample is not a valid SMILES or protein given a certain property.
- Return type
None
- Returns
True if the input is valid.
- __doc__ = 'Property Predictor Scorer.'¶
- __module__ = 'gt4sd.properties.scorer'¶
- class MoleculePropertyPredictorScorer(name, scoring_function, target)[source]¶
Bases:
PropertyPredictorScorer
Property Predictor Scorer for molecules.
- __init__(name, scoring_function, target)[source]¶
Scoring function that calculates a generic score for a property in molecules.
- Parameters
name (
str
) – name of the property to score.scoring_function (
PropertyPredictor
) – callable scoring function.target (
Union
[float
,int
]) – target score that will be used to get the distance to the score of a molecule or protein (not be confused with parameters[“target”]).
- __annotations__ = {}¶
- __doc__ = 'Property Predictor Scorer for molecules.'¶
- __module__ = 'gt4sd.properties.scorer'¶
- class ProteinPropertyPredictorScorer(name, scoring_function, target)[source]¶
Bases:
PropertyPredictorScorer
Property Predictor Scorer for protein.
- __init__(name, scoring_function, target)[source]¶
Scoring function that calculates a generic score for a property in proteins.
- Parameters
name (
str
) – name of the property to score.scoring_function (
PropertyPredictor
) – callable scoring function.target (
Union
[float
,int
]) – target score that will be used to get the distance to the score of a molecule or protein (not be confused with parameters[“target”]).
- __annotations__ = {}¶
- __doc__ = 'Property Predictor Scorer for protein.'¶
- __module__ = 'gt4sd.properties.scorer'¶