Skip to content

add root cause localization transformer #4925

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

Merged
merged 51 commits into from
May 11, 2020
Merged
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
d5ee205
add root cause localization transformer
suxi-ms Mar 10, 2020
f727a79
add test cases
suxi-ms Mar 16, 2020
92de1dc
revert sln changes
suxi-ms Mar 18, 2020
798289c
add evaluation
suxi-ms Mar 18, 2020
f2e128d
temp save for internal review
suxi-ms Mar 20, 2020
51569e3
rename function
suxi-ms Mar 20, 2020
59c6e89
temp save bottom up points for switch desktop
suxi-ms Mar 22, 2020
29216e0
update from laptop
suxi-ms Mar 22, 2020
69da330
save for add test
suxi-ms Mar 23, 2020
e1c5432
add root cause localization algorithm
suxi-ms Mar 23, 2020
3a1d1c5
add root cause localization algorithm
suxi-ms Mar 23, 2020
8f97602
print score, path and directions in sample
suxi-ms Mar 23, 2020
48123f4
merge with master
suxi-ms Mar 23, 2020
c47302f
extract root cause analyzer
suxi-ms Mar 23, 2020
b07ad28
refine code
suxi-ms Mar 23, 2020
c729877
merge with master
suxi-ms Mar 24, 2020
ebbdb0d
update for algorithm
suxi-ms Mar 26, 2020
0d43b0d
add evaluatin
suxi-ms Mar 26, 2020
5778eed
some refine for code
suxi-ms Mar 26, 2020
c9ed044
fix some typo
suxi-ms Mar 27, 2020
e440f25
remove unused code
suxi-ms Mar 27, 2020
feba6f4
reformat code
suxi-ms Mar 27, 2020
686831c
updates
suxi-ms Mar 27, 2020
ddc8a36
update from review
suxi-ms Mar 29, 2020
475ee8a
read double for beta
suxi-ms Apr 1, 2020
8d874ca
remove SignatureDataTransform constructor
suxi-ms Apr 1, 2020
0674ab3
update
suxi-ms Apr 1, 2020
4c5b8fb
update
suxi-ms Apr 1, 2020
08d607c
remove white space
suxi-ms Apr 2, 2020
c688233
refine internal logic
suxi-ms Apr 7, 2020
98637db
update
suxi-ms Apr 8, 2020
4ff2ed1
update
suxi-ms Apr 8, 2020
c22ad50
updated test
suxi-ms Apr 13, 2020
ea7ddbe
update score
suxi-ms Apr 15, 2020
547aef2
update variable name
suxi-ms Apr 17, 2020
8d17c3c
add some comments
suxi-ms Apr 21, 2020
66b614a
refine internal function
suxi-ms Apr 23, 2020
12e7e18
handle for infinity and nan
suxi-ms Apr 24, 2020
e213615
rename the algorithm by removing DT
suxi-ms Apr 26, 2020
30915cd
Update src/Microsoft.ML.TimeSeries/RootCauseAnalyzer.cs
suxi-ms Apr 27, 2020
fda4ec7
fix type
suxi-ms Apr 27, 2020
620ef58
add an else branch when delta is negative
suxi-ms Apr 27, 2020
ae5722f
Merge branch 'master' of https://github.com/suxi-ms/machinelearning
suxi-ms Apr 27, 2020
7f89fea
update model signature
suxi-ms Apr 28, 2020
42dcbc2
update rca interface by removing transformer
suxi-ms May 7, 2020
9893fad
add more documents
suxi-ms May 7, 2020
c831e43
update
suxi-ms May 8, 2020
16f5b33
update
suxi-ms May 9, 2020
9cd8739
update the constructor
suxi-ms May 9, 2020
f80c200
update comments
suxi-ms May 9, 2020
7c1c348
fix typo
suxi-ms May 11, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update the constructor
  • Loading branch information
suxi-ms committed May 9, 2020
commit 9cd8739cb6313b3fc8965d265a73710a16e7d4ef
46 changes: 22 additions & 24 deletions src/Microsoft.ML.TimeSeries/RootCauseAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ private RootCause AnalyzeOneLayer(RootCauseLocalizationInput src)
return dst;
}

protected List<Point> GetTotalPointsForAnomalyTimestamp(RootCauseLocalizationInput src)
private List<Point> GetTotalPointsForAnomalyTimestamp(RootCauseLocalizationInput src)
{
MetricSlice slice = src.Slices.Single(slice => slice.TimeStamp.Equals(src.AnomalyTimestamp));
return slice.Points;
}

protected DimensionInfo SeperateDimension(Dictionary<string, Object> dimensions, Object aggSymbol)
private DimensionInfo SeperateDimension(Dictionary<string, Object> dimensions, Object aggSymbol)
{
DimensionInfo info = DimensionInfo.CreateDefaultInstance();
DimensionInfo info = new DimensionInfo();
foreach (KeyValuePair<string, Object> entry in dimensions)
{
string key = entry.Key;
Expand All @@ -79,7 +79,7 @@ protected DimensionInfo SeperateDimension(Dictionary<string, Object> dimensions,
return info;
}

protected Tuple<PointTree, PointTree, Dictionary<string, Point>> GetPointsInfo(RootCauseLocalizationInput src, DimensionInfo dimensionInfo)
private Tuple<PointTree, PointTree, Dictionary<string, Point>> GetPointsInfo(RootCauseLocalizationInput src, DimensionInfo dimensionInfo)
{
PointTree pointTree = new PointTree();
PointTree anomalyTree = new PointTree();
Expand Down Expand Up @@ -117,7 +117,7 @@ protected Dictionary<string, Object> GetSubDim(Dictionary<string, Object> dimens
return new Dictionary<string, object>(keyList.Select(dim => new KeyValuePair<string, object>(dim, dimension[dim])).ToDictionary(kvp => kvp.Key, kvp => kvp.Value));
}

protected List<RootCauseItem> LocalizeRootCauseByDimension(PointTree anomalyTree, PointTree pointTree, Dictionary<string, Object> anomalyDimension, List<string> aggDims)
private List<RootCauseItem> LocalizeRootCauseByDimension(PointTree anomalyTree, PointTree pointTree, Dictionary<string, Object> anomalyDimension, List<string> aggDims)
{
BestDimension best = null;
if (anomalyTree.ChildrenNodes.Count == 0)
Expand Down Expand Up @@ -682,25 +682,23 @@ private bool IsAggregationDimension(Object val, Object aggSymbol)
}
}

public class DimensionInfo
internal class DimensionInfo
{
public List<string> DetailDims { get; set; }
public List<string> AggDims { get; set; }
internal List<string> DetailDims { get; set; }
internal List<string> AggDims { get; set; }

public static DimensionInfo CreateDefaultInstance()
public DimensionInfo()
{
DimensionInfo instance = new DimensionInfo();
instance.DetailDims = new List<string>();
instance.AggDims = new List<string>();
return instance;
DetailDims = new List<string>();
AggDims = new List<string>();
}
}

public class PointTree
internal class PointTree
{
public Point ParentNode;
public Dictionary<string, List<Point>> ChildrenNodes;
public List<Point> Leaves;
internal Point ParentNode;
internal Dictionary<string, List<Point>> ChildrenNodes;
internal List<Point> Leaves;

public PointTree()
{
Expand All @@ -709,11 +707,11 @@ public PointTree()
}
}

public sealed class BestDimension : IComparable
public class BestDimension : IComparable
{
public string DimensionKey;
public Dictionary<string, int> AnomalyDis;
public Dictionary<string, int> PointDis;
internal string DimensionKey;
internal Dictionary<string, int> AnomalyDis;
internal Dictionary<string, int> PointDis;

public BestDimension()
{
Expand All @@ -733,10 +731,10 @@ public int CompareTo(object obj)
}
}

public class RootCauseScore
internal class RootCauseScore
{
public double Surprise;
public double ExplainaryScore;
internal double Surprise;
internal double ExplainaryScore;

public RootCauseScore(double surprise, double explainaryScore)
{
Expand Down