pydvl.utils.types
¶
This module contains types, protocols, decorators and generic function transformations. Some of it probably belongs elsewhere.
SupervisedModel
¶
Bases: Protocol
This is the minimal Protocol that valuation methods require from models in order to work.
All that is needed are the standard sklearn methods fit()
, predict()
and
score()
.
fit
¶
predict
¶
ensure_seed_sequence
¶
ensure_seed_sequence(
seed: Optional[Union[Seed, SeedSequence]] = None
) -> SeedSequence
If the passed seed is a SeedSequence object then it is returned as is. If it is a Generator the internal protected seed sequence from the generator gets extracted. Otherwise, a new SeedSequence object is created from the passed (optional) seed.
PARAMETER | DESCRIPTION |
---|---|
seed |
Either an int, a Generator object a SeedSequence object or None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
SeedSequence
|
A SeedSequence object. |
New in version 0.7.0