You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MetricSifter is a feature reduction framework designed to accurately identify anomalous metrics caused by faults for enhancing fault localization. Our key insight is that the change point times inside the failure duration are close to each other for the failure-related metrics. MetricSifter detects change points per metric, localizes the time frame with the highest change point density, and excludes metrics with no change points in that time frame. The offline change point detection is implemented by ruptures, and the segmentation of the detected change points is based on kernel density estimation (KDE).
Installation
You can install metricsifter package from PyPI via pip install metricsifter.
Getting Started
frommetricsifter.sifterimportSifterfromtests.sample_gen.generatorimportgenerate_synthetic_data## Create time series datanormal_data, abonormal_data, _, _, anomalous_nodes=generate_synthetic_data(num_node=20, num_edge=20, num_normal_samples=55, num_abnormal_samples=15, anomaly_type=0)
data=pd.concat([normal_data, abonormal_data], axis=0, ignore_index=True)
## Remove the variables of time series datasifter=Sifter(penalty_adjust=2.0, n_jobs=1)
sifted_data=sifter.run(data=data)
print("(#removed metrics) / (#total metrics):", len(set(data.columns) -set(siftered_data.columns)), "/", len(data.columns))
print("difference between prediction and ground truth:", set(siftered_data.columns) -anomalous_nodes)
assertset(sifted_data.columns) -anomalous_nodes==set()
The example of original synthetic data and its sifted data is shown in the following figure.
Before
After
For developers
Run test cases with the following commands.
# Install dependencies for development
python -m pip install -r requirements-dev.txt
# Run test cases
pytest -s -v tests