SIENTIAPDE-1241: Refactor: Improve documentation, exception handling, and configuration in model manager. This commit enhances clarity and robustness by adding detailed docstrings to methods, standardizing exception handling with custom types, and simplifying MLflow configuration.
This commit is contained in:
@@ -78,14 +78,6 @@ class TrainModelParams:
|
||||
ValueError: If any required field is missing or None
|
||||
TypeError: If any field has an incorrect type
|
||||
KeyError: If any required key is missing from the dictionary
|
||||
|
||||
Example:
|
||||
>>> input_data = {
|
||||
... 'variable_columns': ['var1', 'var2'],
|
||||
... 'lag_train': 5,
|
||||
... # ... other fields
|
||||
... }
|
||||
>>> params = TrainModelParams.from_dict(input_data)
|
||||
"""
|
||||
return cls(
|
||||
variable_columns=cls._check_none(
|
||||
@@ -179,10 +171,6 @@ class TrainModelParams:
|
||||
|
||||
Raises:
|
||||
ValueError: If any business rule is violated
|
||||
|
||||
Example:
|
||||
>>> params = TrainModelParams.from_dict(data)
|
||||
>>> params.validate_business_rules() # Raises ValueError if invalid
|
||||
"""
|
||||
# Validate train_size range (10-100%)
|
||||
if not 10 <= self.train_size <= 100:
|
||||
|
||||
Reference in New Issue
Block a user