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

flowchart has problem #139

Open
taroyutao opened this issue Jun 10, 2022 · 0 comments
Open

flowchart has problem #139

taroyutao opened this issue Jun 10, 2022 · 0 comments

Comments

@taroyutao
Copy link

import numpy as np
import pandas as pd
from adtk.data import validate_series
import matplotlib.pyplot as plt
from adtk.visualization import plot
from adtk.transformer import DoubleRollingAggregate
from adtk.detector import ThresholdAD, QuantileAD
from adtk.aggregator import AndAggregator

故障检测

from adtk.pipe import Pipenet

steps = {
# 长窗口历史数据扫描,规避持续异常跳变
"more_step_roll_aggr": {
"model": DoubleRollingAggregate(
agg="max",
window=(20, 1),
diff="diff"
),
"input": "original",
},
# 确保递增是一直持续存在
"abs_more_step_roll_aggr": {
"model": ThresholdAD(
high=0
),
"input": "more_step_roll_aggr"
},

# 短窗口数据扫描,相对变化率(斜率)判断
"one_step_change": {
    "model": DoubleRollingAggregate(
        agg="mean",
        window=(3, 1),
        diff="rel_diff"
    ),
    "input": "original",
},
"abs_one_step_change": {
    "model": ThresholdAD(high=0.2),
    "input": "one_step_change"
},

"base_level_detect1": {
    "model": ThresholdAD(high=100),
    "input": "original"
},

"positive_level_shift": {
    "model": AndAggregator(),
    "input": ["abs_more_step_roll_aggr", "abs_one_step_change", "base_level_detect"]
}

}

pipenet = Pipenet(steps)
pipenet.plot_flowchart()

plt.show()

plt.savefig('net1.png')
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant