Skip to content

Commit a6bbc40

Browse files
authored
Fix prediction metrics when specifying tracker.key (#793)
1 parent 5d58b09 commit a6bbc40

File tree

1 file changed

+3
-4
lines changed
  • pkg/workloads/cortex/lib/type

1 file changed

+3
-4
lines changed

pkg/workloads/cortex/lib/type/api.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,10 @@ def latency_metric(self, start_time):
106106
"Value": (time.time() - start_time) * 1000, # milliseconds
107107
}
108108

109-
def prediction_metrics(self, prediction):
110-
predicted_value = self.tracker.extract_predicted_value(prediction)
109+
def prediction_metrics(self, prediction_value):
111110
if self.tracker.model_type == "classification":
112111
dimensions_with_class = self.metric_dimensions() + [
113-
{"Name": "Class", "Value": str(predicted_value)}
112+
{"Name": "Class", "Value": str(prediction_value)}
114113
]
115114
return {
116115
"MetricName": "Prediction",
@@ -122,5 +121,5 @@ def prediction_metrics(self, prediction):
122121
return {
123122
"MetricName": "Prediction",
124123
"Dimensions": self.metric_dimensions(),
125-
"Value": float(predicted_value),
124+
"Value": float(prediction_value),
126125
}

0 commit comments

Comments
 (0)