Spaces:
Sleeping
Sleeping
Download analytics/performance_analysis.py from GenAICoder/Risk_Manager: direct link, hf CLI and curl.
- Browser
- Download file 526 Bytes
-
https://huggingface.co/spaces/GenAICoder/Risk_Manager/resolve/e89ed92ff97671bd845f97862bd8dcdcb905bb1d/analytics/performance_analysis.py
- Command line
-
hf download hf://spaces/GenAICoder/Risk_Manager@e89ed92ff97671bd845f97862bd8dcdcb905bb1d/analytics/performance_analysis.py
-
curl -L -o performance_analysis.py https://huggingface.co/spaces/GenAICoder/Risk_Manager/resolve/e89ed92ff97671bd845f97862bd8dcdcb905bb1d/analytics/performance_analysis.py
526 Bytes
| # analytics/performance_analysis.py | |
| from metrics.metric_registry import ( | |
| METRIC_FUNCTIONS | |
| ) | |
| def generate_metric_view( | |
| df, | |
| metric_name, | |
| group_col=None, | |
| filters=None | |
| ): | |
| metric_config = METRIC_FUNCTIONS[ | |
| metric_name | |
| ] | |
| metric_function = metric_config[ | |
| "function" | |
| ] | |
| metric_params = metric_config[ | |
| "params" | |
| ] | |
| result = metric_function( | |
| df=df, | |
| group_col=group_col, | |
| filters=filters, | |
| **metric_params | |
| ) | |
| return result |