-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Missing Values Handling (#378)
* variable code fixes * bc auroc sampling error calculation * refactor auroc sampling error nan handling * auroc realized perf nan handling * realized ap missing value handling * upd bc metrics missing value handling * upd realized perf mc missing value handling * upd realized perf regr missing value handling and fixes * upd dle missing value handling * wip update CBPE missing value handling * update CBPE BC missing value handling * update MC CBPE missing value handling * remove redundant methods/classes * linting updates * linting for DLE * performance calculation linting updates * remove unneeded import * mypy fixes * more mypy fixes * mypy updates * cbpe lingint * sampling error update * ap fix * code fixes wip * nan code updates * Removed some superfluous comments * Remove exception re-raise as it causes the "fallback scenario" to be ignored. * mypy and linting --------- Co-authored-by: Niels Nuyttens <[email protected]>
- Loading branch information
Showing
16 changed files
with
1,889 additions
and
850 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Author: Niels Nuyttens <[email protected]> | ||
# | ||
# License: Apache Software License 2.0 | ||
"""Base Classes for performane calculation.""" | ||
import abc | ||
import logging | ||
from logging import Logger | ||
|
@@ -134,7 +135,6 @@ def sampling_error(self, data: pd.DataFrame): | |
Returns | ||
------- | ||
sampling_error: float | ||
The expected sampling error. | ||
|
@@ -153,6 +153,7 @@ def alert(self, value: float) -> bool: | |
---------- | ||
value: float | ||
Value of a calculated metric. | ||
Returns | ||
------- | ||
bool: bool | ||
|
@@ -206,18 +207,22 @@ def get_chunk_record(self, chunk_data: pd.DataFrame) -> Dict: | |
|
||
@property | ||
def display_name(self) -> str: | ||
"""Get metric display name.""" | ||
return self.name | ||
|
||
@property | ||
def column_name(self) -> str: | ||
"""Get metric column name.""" | ||
return self.components[0][1] | ||
|
||
@property | ||
def display_names(self) -> List[str]: | ||
"""Get metric display names.""" | ||
return [c[0] for c in self.components] | ||
|
||
@property | ||
def column_names(self) -> List[str]: | ||
"""Get metric column names.""" | ||
return [c[1] for c in self.components] | ||
|
||
|
||
|
@@ -256,6 +261,8 @@ def create(cls, key: str, use_case: ProblemType, **kwargs) -> Metric: | |
|
||
@classmethod | ||
def register(cls, metric: str, use_case: ProblemType) -> Callable: | ||
"""Register performance metric class in MetricFactory.""" | ||
|
||
def inner_wrapper(wrapped_class: Type[Metric]) -> Type[Metric]: | ||
if metric in cls.registry: | ||
if use_case in cls.registry[metric]: | ||
|
Oops, something went wrong.