Tuner Tuner¶
- class dffml.tuner.tuner.Tuner(config: Optional[Type[BaseConfig]])[source]¶
Abstract base class which should be derived from and implemented using various tuners.
- CONFIG¶
alias of
TunerConfig
- CONTEXT¶
alias of
TunerContext
- class dffml.tuner.tuner.TunerConfig[source]¶
- no_enforce_immutable()¶
By default, all properties of a config object are immutable. If you would like to mutate immutable properties, you must explicitly call this method using it as a context manager.
Examples
>>> from dffml import config >>> >>> @config ... class MyConfig: ... C: int >>> >>> config = MyConfig(C=2) >>> with config.no_enforce_immutable(): ... config.C = 1
- class dffml.tuner.tuner.TunerContext(parent: Tuner)[source]¶
- abstract async optimize(model: ModelContext, feature: Feature, accuracy_scorer: AccuracyContext, train_data: SourcesContext, test_data: SourcesContext) float [source]¶
Abstract method to optimize hyperparameters
- Parameters:
model (ModelContext) – The Model which needs to be used.
feature (Feature) – The Target feature in the data.
accuracy_scorer (AccuracyContext) – The accuracy scorer that needs to be used.
train_data (SourcesContext) – The train_data to train models on, with the hyperparameters provided.
sources (SourcesContext) – The test_data to score against and optimize hyperparameters.
- Returns:
The highest score value(optimized score)
- Return type: