Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TimeSeries Explanation] Score is NaN #5274

Closed
lisahua opened this issue Jul 1, 2020 · 1 comment
Closed

[TimeSeries Explanation] Score is NaN #5274

lisahua opened this issue Jul 1, 2020 · 1 comment
Assignees

Comments

@lisahua
Copy link
Contributor

lisahua commented Jul 1, 2020

System information

  • OS version/distro: .Net 4.8
  • .NET Version (eg., dotnet --info): ML.Net 1.5.0

Issue

  • What did you do? Invoke var prediction = this.mlContext.AnomalyDetection.LocalizeRootCause(input);
  • What happened? rootCauseItem.Score = double.NaN
  • What did you expect? Should return a meaningful score (either 0 or 1)

Source code / logs

Please paste or attach the code or logs or traces that would be helpful to diagnose the issue you are reporting.

string jsonString = ""{\"AnomalyTimestamp\":\"1997-05-19T00:00:00\",\"AnomalyDimension\":{\"__Sandbox.Categories.CategoryName__\":\"\"},\"Slices\":[{\"TimeStamp\":\"1997-05-19T00:00:00\",\"Points\":[{\"Value\":8995.35,\"ExpectedValue\":-120.28187410606782,\"IsAnomaly\":true,\"Dimension\":{\"__Sandbox.Categories.CategoryName__\":\"Beverages\"},\"Delta\":9115.6318741060677},{\"Value\":1282.02,\"ExpectedValue\":1374.808978001977,\"IsAnomaly\":false,\"Dimension\":{\"__Sandbox.Categories.CategoryName__\":\"Condiments\"},\"Delta\":-92.788978001977057},{\"Value\":1686.7,\"ExpectedValue\":2014.8946291211198,\"IsAnomaly\":false,\"Dimension\":{\"__Sandbox.Categories.CategoryName__\":\"Confections\"},\"Delta\":-328.19462912111976},{\"Value\":174.15,\"ExpectedValue\":215.02809847811903,\"IsAnomaly\":false,\"Dimension\":{\"__Sandbox.Categories.CategoryName__\":\"Dairy Products\"},\"Delta\":-40.878098478119028},{\"Value\":12138.22,\"ExpectedValue\":9066.203,\"IsAnomaly\":true,\"Dimension\":{\"__Sandbox.Categories.CategoryName__\":\"\"},\"Delta\
":3072.017}]}],\"AggregateType\":0,\"AggregateSymbol\":\"\"}"
";
var input = JsonConvert.DeserializeObject<RootCauseLocalizationInput>(jsonString); // using Newtonsoft.Json
var prediction = this.mlContext.AnomalyDetection.LocalizeRootCause(input);

The input is like:

{
	"AnomalyTimestamp": "1997-05-19T00:00:00",
	"AnomalyDimension": {
		"__Sandbox.Categories.CategoryName__": ""
	},
	"Slices": [
		{
			"TimeStamp": "1997-05-19T00:00:00",
			"Points": [
				{
					"Value": 8995.35,
					"ExpectedValue": -120.28187410606782,
					"IsAnomaly": true,
					"Dimension": {
						"__Sandbox.Categories.CategoryName__": "Beverages"
					},
					"Delta": 9115.631874106068
				},
				{
					"Value": 1282.02,
					"ExpectedValue": 1374.808978001977,
					"IsAnomaly": false,
					"Dimension": {
						"__Sandbox.Categories.CategoryName__": "Condiments"
					},
					"Delta": -92.78897800197706
				},
				{
					"Value": 1686.7,
					"ExpectedValue": 2014.8946291211199,
					"IsAnomaly": false,
					"Dimension": {
						"__Sandbox.Categories.CategoryName__": "Confections"
					},
					"Delta": -328.19462912111978
				},
				{
					"Value": 174.15,
					"ExpectedValue": 215.02809847811904,
					"IsAnomaly": false,
					"Dimension": {
						"__Sandbox.Categories.CategoryName__": "Dairy Products"
					},
					"Delta": -40.87809847811903
				},
				{
					"Value": 12138.22,
					"ExpectedValue": 9066.203,
					"IsAnomaly": true,
					"Dimension": {
						"__Sandbox.Categories.CategoryName__": ""
					},
					"Delta": 3072.017
				}
			]
		}
	],
	"AggregateType": 0,
	"AggregateSymbol": ""
}

And the output:

{
	"Items": [
		{
			"Score": "NaN",
			"Path": [
				"__Sandbox.Categories.CategoryName__"
			],
			"Dimension": {
				"__Sandbox.Categories.CategoryName__": "Beverages"
			},
			"Direction": 0
		}
	]
}
@lisahua
Copy link
Contributor Author

lisahua commented Jul 2, 2020

Fixed already in #5218

@lisahua lisahua closed this as completed Jul 2, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Mar 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants