SIENTIAPDE-1430: Implement advanced model training capabilities and enhanced data preprocessing. This includes support for Polynomial Regression with configurable degree and interaction terms, flexible per-variable lag configurations, and new data filtering options by date range and removed intervals. Comprehensive business validations are now enforced for all parameters, and MLflow logging has been extended to capture these detailed configurations. Additionally, Reduced Coulomb Energy (RCE) metrics are added for drift detection, with a new changelog documenting all pipeline parameter updates.

This commit is contained in:
Bruno Domingues
2025-12-17 21:39:43 -03:00
parent 4d6674758c
commit 6e8f87b2a3
10 changed files with 796 additions and 81 deletions

View File

@@ -81,13 +81,15 @@ def test_linear_regression_model_fit():
def test_linear_regression_model_fit_without_variable_columns():
"""Test LinearRegressionModel fit raises AssertionError without variable_columns."""
"""Test LinearRegressionModel fit infers variable_columns when not set."""
model = LinearRegressionModel(target_variable='target')
data = pd.DataFrame({'var1': [1, 2, 3], 'target': [3, 5, 7]})
with raises(AssertionError, match='variable_columns must be set before fitting'):
model.fit(data)
# Model should infer variable_columns from data (all columns except target)
result = model.fit(data)
assert result is model
assert model.variable_columns == ['var1']
def test_linear_regression_model_predict_without_clipping():
@@ -196,7 +198,7 @@ def test_data_preprocessor_init_with_custom_steps_order():
assert 'Normalization' in preprocessor.steps_order
assert 'Feature Creation' in preprocessor.steps_order
assert len(preprocessor.steps_order) == 7
assert len(preprocessor.steps_order) == 8 # Now includes RANGE_SELECTION step
def test_data_preprocessor_get_scaler():