Skip to content

Commit 46fdbfb

Browse files
DavidZeLiang1228David Liang
and
David Liang
authored
MVAD sample refine (#21899)
* Add multivariate sample * MVAD sample refine * resolve comments * resolve comments * resolve comments * MVAD sample refine * remove credential info * bug fix * remove timeout * remove timeout * refine the Multivaraite Anomaly Detection sample result to be more readable * remove saved model file Co-authored-by: David Liang <[email protected]>
1 parent eb27e74 commit 46fdbfb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

sdk/anomalydetector/azure-ai-anomalydetector/samples/sample_multivariate_detect.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,16 @@ def delete_model(self, model_id):
165165
assert result is not None
166166

167167
print("Result ID:\t", result.result_id)
168-
print("Result summary:\t", result.summary)
168+
print("Result status:\t", result.summary.status)
169169
print("Result length:\t", len(result.results))
170170

171+
# See detailed inference result
172+
for r in result.results:
173+
print("timestamp: {}, is_anomaly: {:<5}, anomaly score: {:.4f}, severity: {:.4f}, contributor count: {:<4d}".format(r.timestamp, str(r.value.is_anomaly), r.value.score, r.value.severity, len(r.value.contributors) if r.value.is_anomaly else 0))
174+
if r.value.contributors:
175+
for contributor in r.value.contributors:
176+
print("\tcontributor variable: {:<10}, contributor score: {:.4f}".format(contributor.variable, contributor.contribution_score))
177+
171178
# Export model
172179
sample.export_model(model_id, "model.zip")
173180

0 commit comments

Comments
 (0)