Skip to content

Problem with scaling parametrs pluging #264

@DavideDC95

Description

@DavideDC95

Describe the bug
If in plugins it is passed a scaler for the parametrs there is an inconsistency between predict and thruth solution

To Reproduce
pod = POD()
rbf = RBF()
db = Database(param, snapshots.T)
rom = ROM(db, pod, rbf, plugins=[
DatabaseScaler(StandardScaler(), 'reduced', 'snapshots'),
DatabaseScaler(StandardScaler(), 'reduced', 'parameters')
])
rom.fit()
test_param = param[2]
truth_sol = db.snapshots_matrix[2]
predicted_sol = rom.predict(test_param).snapshots_matrix[0]
np.testing.assert_allclose(predicted_sol, truth_sol,
rtol=1e-5, atol=1e-5)

Expected behavior
AssertionError:
Not equal to tolerance rtol=1e-05, atol=1e-05

Output
E Mismatched elements: 2500 / 2500 (100%)
E Max absolute difference among violations: 32.81964758
E Max relative difference among violations: 47.42442793
E ACTUAL: array([ 8.536083, 8.370944, 8.204127, ..., 0.628054, -0.241309,
E -1.047201], shape=(2500,))
E DESIRED: array([ 6.31744 , 6.15722 , 5.99945 , ..., 0.53165 , -0.714494,
E -1.77711 ], shape=(2500,), dtype=float32)

Additional context
For the moment this possibility is removed since in erzb.plugin.scaler.py I added

"
if target == 'parameters': #TODO
raise NotImplementedError("Scaling of parameters not implemented yet.")
"
that block the scaling on parameter. The bug remains to be solved

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions