Skip to content

Commit

Permalink
feat: add regression line to residuals metric (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
dtria91 authored Jul 16, 2024
1 parent c5511ed commit c2f5437
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions api/app/models/metrics/model_quality_dto.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class ResidualsMetrics(BaseModel):
standardized_residuals: List[float]
predictions: List[float]
targets: List[float]
regression_line: List[List[float]]

model_config = ConfigDict(populate_by_name=True, alias_generator=to_camel)

Expand Down
1 change: 1 addition & 0 deletions api/tests/commons/db_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ def get_sample_current_dataset(
'standardized_residuals': [0.02, 0.03],
'targets': [1, 2.2, 3],
'predictions': [1.3, 2, 4.5],
'regression_line': [[1.2, 0.3], [1.4, 2.3]],
},
}

Expand Down
4 changes: 2 additions & 2 deletions init-data/init_db.sql

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ class ResidualsMetrics(BaseModel):
standardized_residuals: List[float]
predictions: List[float]
targets: List[float]
regression_line: List[List[float]]

model_config = ConfigDict(populate_by_name=True, alias_generator=to_camel)

Expand Down
3 changes: 2 additions & 1 deletion sdk/tests/apis/model_current_dataset_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,8 @@ def test_regression_model_quality_ok(self):
"correlationCoefficient": {correlation_coefficient},
"standardizedResiduals": [0.02, 0.03],
"targets": [1, 2.2, 3],
"predictions": [1.3, 2, 4.5]
"predictions": [1.3, 2, 4.5],
"regression_line": [[1.2, 0.3], [1.4, 2.3]]
}}
}},
"grouped_metrics": {{
Expand Down
3 changes: 2 additions & 1 deletion sdk/tests/apis/model_reference_dataset_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,8 @@ def test_regression_model_metrics_ok(self):
"correlationCoefficient": {correlation_coefficient},
"standardizedResiduals": [0.02, 0.03],
"targets": [1, 2.2, 3],
"predictions": [1.3, 2, 4.5]
"predictions": [1.3, 2, 4.5],
"regression_line": [[1.2, 0.3], [1.4, 2.3]]
}}
}}
}}""",
Expand Down

0 comments on commit c2f5437

Please sign in to comment.