Models
fyt.configs.models
¶
AggregatedMetricResult
¶
Bases: BaseModel
key
property
¶
Normalized string name of the metric (single rule: normalize_key).
AggregatedMetricsManagerInput
¶
Bases: BaseModel
scalar_metrics_results
property
¶
The per-run metric results restricted to their scalar results.
collect_metric_values(metric_name)
¶
Collect all values for a specific metric across all runs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metric_name
|
MetricType | str
|
The type of metric to collect |
required |
Returns:
| Type | Description |
|---|---|
list[float]
|
A tuple of (values, seeds) where both lists have the same length. |
list[int]
|
Only includes runs where the metric has a valid finite value. |
get_unique_metric_types()
¶
Get all unique scalar metric types from all runs.
Returns:
| Type | Description |
|---|---|
list[MetricType | str]
|
Sorted list of unique metric types (excluding confusion_matrix) |
CategoricalImputationComponentConfig
¶
CategoricalTransformationComponentConfig
¶
CorrelationFilterConfig
¶
Bases: BaseModel
Configuration for correlation-based feature filtering.
CrossValidationConfig
¶
Bases: BaseModel
Configuration for cross-validation.
DataManagerConfig
¶
Bases: YamlBaseModel
validate_exclude_columns()
¶
Validate that exclude_columns does not contain id_column or target_column.
Returns:
| Type | Description |
|---|---|
DataManagerConfig
|
The validated config instance. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If exclude_columns contains the id_column, the target_column, or an explicitly provided categorical or numerical column. |
validate_test_data_consistency()
¶
Validate that test_data_path is provided if use_test_data is True.
Returns:
| Type | Description |
|---|---|
DataManagerConfig
|
The validated config instance. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If use_test_data is True but test_data_path is not provided. |
DataSplit
¶
Bases: BaseModel
Class for holding train-test split data.
FeatureImportanceConfig
¶
Bases: BaseModel
Configuration for feature importance logging.
FeatureSelectionConfig
¶
Bases: BaseModel
Configuration for feature selection.
FeatureSelectorConfig
¶
MetricResultModel
¶
Bases: BaseModel
key
property
¶
Normalized string name of the metric (single rule: normalize_key).
MetricResults
¶
Bases: BaseModel
scalar_results
property
¶
The scalar metric results from the results list.
get_scalar_metric_value(metric_name)
¶
Get the value of a specific scalar metric.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metric_name
|
MetricType | str
|
The type of metric to retrieve |
required |
Returns:
| Type | Description |
|---|---|
float | None
|
The metric value if found and valid, None otherwise |
NumericalImputationComponentConfig
¶
Bases: PreProcessorComponentConfig
Configuration for a single numerical imputation component.
validate_impute_zeros_with_strategy()
¶
Validate that impute_zeros is only set when strategy is not 'passthrough'.
Returns:
| Type | Description |
|---|---|
'NumericalImputationComponentConfig'
|
The validated config instance. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If impute_zeros is True while strategy is 'passthrough'. |
NumericalTransformationComponentConfig
¶
OptunaCategoricalParam
¶
Bases: OptunaParamModel
Categorical parameter space definition for Optuna.
get_optuna_suggestion(trial)
¶
Get the Optuna suggestion for this categorical parameter.
OptunaConfig
¶
Bases: BaseModel
Configuration for Optuna hyperparameter tuning.
validate_direction_matches_metric()
¶
Reject maximizing loss-like metrics (e.g. log_loss).
Returns:
| Type | Description |
|---|---|
OptunaConfig
|
The validated config instance. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the optimization metric is a loss but direction is 'maximize'. |
OptunaFloatParam
¶
Bases: OptunaParamModel
Float parameter space definition for Optuna.
get_optuna_suggestion(trial)
¶
Get the Optuna suggestion for this float parameter.
OptunaIntParam
¶
Bases: OptunaParamModel
Integer parameter space definition for Optuna.
get_optuna_suggestion(trial)
¶
Get the Optuna suggestion for this integer parameter.
OptunaParamModel
¶
Bases: BaseModel
Parameter space definition for Optuna.
PreProcessorComponentConfig
¶
Bases: BaseModel
Base configuration for a PreProcessor component.
validate_feature_specification()
¶
Validate that features and exclude_features are not both specified.
Returns:
| Type | Description |
|---|---|
'PreProcessorComponentConfig'
|
The validated config instance. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If both 'features' and 'exclude_features' are specified. |
validate_features(all_columns)
¶
Validate the provided features with all the available ones.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
all_columns
|
list[str]
|
List of all available columns. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If 'features' or 'exclude_features' contain duplicates or reference columns not present in the dataset. |
PreProcessorConfig
¶
PredictCommandConfig
¶
RunPipelineCommandConfig
¶
Bases: YamlBaseModel
validate_task_consistency()
¶
Validate that the model type and metrics match the task type.
Returns:
| Type | Description |
|---|---|
RunPipelineCommandConfig
|
The validated config instance. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the model type or a configured metric is incompatible with the configured task. |
validate_test_data_usage()
¶
Validate DataManager and Trainer config consistency for test data usage.
ScalarMetricResult
¶
TargetEncodingConfig
¶
Bases: BaseModel
Configuration for target encoding.
TargetProcessorConfig
¶
TrainerConfig
¶
Bases: YamlBaseModel
Configuration for the Trainer.
validate_validation_size_and_cross_validation()
¶
Warn when validation_size is set but cross-validation will ignore it.