Skip to content

Commit

Permalink
Add missing type aliases in custom metrics in how_to_make_custom_metr…
Browse files Browse the repository at this point in the history
…ic_and_test example. (#1349)
  • Loading branch information
Liraim authored Oct 22, 2024
1 parent d3e21fb commit 3106c3b
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@
"outputs": [],
"source": [
"class MyMetricResult(MetricResult):\n",
" class Config:\n",
" type_alias = \"evidently:metric_result:MyMetricResult\"\n",
" sum_value: float"
]
},
Expand All @@ -119,6 +121,8 @@
"outputs": [],
"source": [
"class MyMetric(Metric[MyMetricResult]):\n",
" class Config:\n",
" type_alias = \"evidently:metric:MyMetric\"\n",
" column_name: str\n",
"\n",
" def __init__(self, column_name: str):\n",
Expand Down Expand Up @@ -235,6 +239,8 @@
"\n",
"\n",
"class MyMetricResult(MetricResult):\n",
" class Config:\n",
" type_alias = \"evidently:metric_result:MyMetricResult\"\n",
" feature_name: str\n",
" current_sum_value: float\n",
" x_values_for_hist: list\n",
Expand All @@ -243,6 +249,8 @@
"\n",
"\n",
"class MyMetric(Metric[MyMetricResult]):\n",
" class Config:\n",
" type_alias = \"evidently:metric:MyMetric\"\n",
" column_name: str\n",
"\n",
" def __init__(self, column_name: str) -> None:\n",
Expand Down

0 comments on commit 3106c3b

Please sign in to comment.