Azure-Samples / Azure-Samples/AnomalyDetector

Error when running build_figure function

Open
#24 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
110
Forks
161
PR merge metrics
No merged PRs in 30d

Description

> Please provide us with the following information:
> ---------------------------------------------------------------

### This issue is for a: (mark with an `x`)
```
- [X ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
```

### Minimal steps to reproduce
>Running build_figure on Azure Databricks gives me an error. This error only appears when an anomaly is detected (true value). It seems the API is working but there is an issue with the graphic metrics. Please help.

### Any log messages given by the failure
> TypeError: '<' not supported between instances of 'numpy.ndarray' and 'str'

### Expected/desired behavior
> plot graphic

### OS and Version?
> Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

### Versions
>

### Mention any other details that might be useful
The API json returns the following:

{'expectedValues': [32665291.70172784,
33126536.996231694,
33865005.04719163,
34952357.23318992,
35880900.59326456,
37577731.376328364,
38848479.527605504,
39229845.6539477,
39204805.413964026,
39140353.48327427,
39398425.48938306,
39449252.09822685,
40268366.13005982,
40644059.92747147,
40745047.82169999,
40588707.92813035,
40709590.79101679,
41226068.09549811,
41583736.57405577,
42750007.902109794,
43388166.20935269,
43861988.96543184,
43929405.35518512,
44565830.92097248,
45524780.42355837,
46516265.8981908,
47209112.43948283,
47373845.95996373,
47263873.577261515,
46747494.82823343,
46508338.83566142,
46591706.77988794,
46516265.8981908,
47209112.43948283,
47373845.95996373],
'isAnomaly': [False,
False,
False,
True,
True,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
True,
True,
True,
True,
True,
True,
True],
'isNegativeAnomaly': [False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
True,
True,
True],
'isPositiveAnomaly': [False,
False,
False,
True,
True,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
True,
True,
True,
True,
False,
False,
False],
'lowerMargins': [1633264.585086394,
1656326.8498115838,
1693250.2523595802,
1747617.861659497,
1794045.0296632275,
1878886.568816416,
1942423.9763802737,
1961492.282697387,
1960240.2706982046,
1957017.674163714,
1969921.274469152,
1972462.6049113423,
2013418.3065029904,
2032202.9963735715,
2037252.3910849988,
2029435.3964065164,
2035479.5395508409,
2061303.4047749043,
2079186.828702785,
2137500.3951054886,
2169408.3104676306,
2193099.448271595,
2196470.267759256,
2228291.5460486263,
2276239.0211779177,
2325813.294909537,
2360455.6219741404,
2368692.29799819,
2363193.6788630784,
2337374.741411671,
2325416.9417830706,
2329585.3389943987,
2325813.294909537,
2360455.6219741404,
2368692.29799819],
'period': 7,
'upperMargins': [1633264.585086394,
1656326.8498115875,
1693250.252359584,
1747617.861659497,
1794045.0296632275,
1878886.568816416,
1942423.9763802737,
1961492.282697387,
1960240.2706982046,
1957017.674163714,
1969921.274469152,
1972462.6049113423,
2013418.3065029904,
2032202.9963735715,
2037252.3910849988,
2029435.3964065164,
2035479.5395508409,
2061303.4047749043,
2079186.828702785,
2137500.3951054886,
2169408.3104676306,
2193099.448271595,
2196470.267759256,
2228291.5460486263,
2276239.0211779177,
2325813.294909537,
2360455.6219741404,
2368692.29799819,
2363193.6788630784,
2337374.741411671,
2325416.9417830706,
2329585.3389943987,
2325813.294909537,
2360455.6219741404,
2368692.29799819]}

> ---------------------------------------------------------------
> Thanks! We'll be in touch soon.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the build_figure call in the AnomalyDetector sample with the provided API JSON, focusing on the anomaly-detected path that raises the numpy.ndarray versus str TypeError. Check how the expectedValues, anomaly flags, and margins are passed to the graphic metrics, then verify that the anomaly response produces a plot without the error.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, jupyter-notebook, numpy, python
Domain
cloud, data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.