Skip to content

EpsilonDiagnosis - Diff between normal_data and abnormal_data #63

@igorestevanjasinski

Description

@igorestevanjasinski

I would like a help to understand how to using EpsilonDiagnosis, in the case to train a model with historical data for example 90 days and in the moment of an incident use the function find_root_causes with an abnormal_data dataframe to find the root cause, but when testing I got this error.

`---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[33], line 1
----> 1 results = model.find_root_causes(anomaly_df)
2 print(results.to_dict())

File ~/.local/lib/python3.10/site-packages/pyrca/analyzers/epsilon_diagnosis.py:88, in EpsilonDiagnosis.find_root_causes(self, abnormal_df, **kwargs)
85 self.correlations[colname] = 0
86 else:
87 self.correlations[colname] = np.square(
---> 88 np.cov(self.normal_df[colname].values, abnormal_df[colname].values)[0, 1]
89 ) / (np.var(self.normal_df[colname].values) * np.var(abnormal_df[colname].values))
90 if self.correlations[colname] > self.statistics[colname]:
91 root_cause_nodes.append((colname, self.correlations[colname]))

File <array_function internals>:180, in cov(*args, **kwargs)

File ~/.local/lib/python3.10/site-packages/numpy/lib/function_base.py:2639, in cov(m, y, rowvar, bias, ddof, fweights, aweights, dtype)
2637 if not rowvar and y.shape[0] != 1:
2638 y = y.T
-> 2639 X = np.concatenate((X, y), axis=0)
2641 if ddof is None:
2642 if bias == 0:

File <array_function internals>:180, in concatenate(*args, **kwargs)

ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 1, the array at index 0 has size 2881 and the array at index 1 has size 73`

It seems the two dataframes need to have the same amount of lines, but I think this is not achievable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions