feat: enhance training workflow with model metadata loading and refactor data handling
- Introduced a new activity to load model metadata from the model store. - Refactored training logic to utilize new model metadata and improved parameter handling. - Updated the `TrainModelParams` class to include additional fields for model configuration. - Replaced deprecated utility functions with a custom train-test split implementation. - Removed unused utility functions and cleaned up the data manager repository. - Adjusted experiment tracking to include model-specific metadata in notifications.
This commit is contained in:
@@ -24,7 +24,6 @@ def valid_train_params_dict():
|
||||
'train_size': 80,
|
||||
'shuffle': True,
|
||||
'experiment_run_id': 1,
|
||||
'experiment_name': 'test_experiment',
|
||||
'removed_intervals': [],
|
||||
'model_name': 'Linear Regression',
|
||||
'degree': 1,
|
||||
@@ -61,7 +60,6 @@ def test_train_model_params_from_dict_success(valid_train_params_dict):
|
||||
assert params.train_size == 80
|
||||
assert params.shuffle is True
|
||||
assert params.experiment_run_id == 1
|
||||
assert params.experiment_name == 'test_experiment'
|
||||
assert params.removed_intervals == []
|
||||
|
||||
|
||||
@@ -297,25 +295,14 @@ def test_validate_business_rules_whitespace_file_name(valid_train_params_dict):
|
||||
params.validate_business_rules()
|
||||
|
||||
|
||||
def test_validate_business_rules_empty_experiment_name(valid_train_params_dict):
|
||||
"""Test validate_business_rules raises error when experiment_name is empty."""
|
||||
def test_validate_business_rules_model_name_empty(valid_train_params_dict):
|
||||
"""Test validate_business_rules raises error when model_name is empty."""
|
||||
from model_manager.utils.models.train_model_params import TrainModelParams
|
||||
|
||||
valid_train_params_dict['experiment_name'] = ''
|
||||
valid_train_params_dict['model_name'] = ''
|
||||
params = TrainModelParams.from_dict(valid_train_params_dict)
|
||||
|
||||
with pytest.raises(ValueError, match='experiment_name cannot be empty or whitespace'):
|
||||
params.validate_business_rules()
|
||||
|
||||
|
||||
def test_validate_business_rules_whitespace_experiment_name(valid_train_params_dict):
|
||||
"""Test validate_business_rules raises error when experiment_name is whitespace."""
|
||||
from model_manager.utils.models.train_model_params import TrainModelParams
|
||||
|
||||
valid_train_params_dict['experiment_name'] = ' \n '
|
||||
params = TrainModelParams.from_dict(valid_train_params_dict)
|
||||
|
||||
with pytest.raises(ValueError, match='experiment_name cannot be empty or whitespace'):
|
||||
with pytest.raises(ValueError, match='model_name cannot be empty or whitespace'):
|
||||
params.validate_business_rules()
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ def sample_params():
|
||||
train_size=80,
|
||||
shuffle=True,
|
||||
experiment_run_id=123,
|
||||
experiment_name='test-experiment',
|
||||
removed_intervals=[],
|
||||
model_name='Linear Regression',
|
||||
degree=1,
|
||||
|
||||
Reference in New Issue
Block a user