Пример #1
0
def gen_m(config):
    num = config['TOTAL_NUM']
    features = pre_process_config(config['FEATURES'])
    # print(features)
    theta1_list = gen_theta(features['theta1'],num)
    theta2_list = gen_theta(features['theta2'],num)
    theta3_list = gen_theta(features['theta3'],num)
    theta4_list = gen_theta(features['theta4'],num)
    theta5_list = gen_theta(features['theta5'],num)
    theta6_list = gen_theta(features['theta6'],num)
    theta7_list = gen_theta(features['theta7'],num)
    theta8_list = gen_theta(features['theta8'],num)
    theta9_list = gen_theta(features['theta9'],num)
    k1_list = gen_theta(features['k1'],num)
    k2_list = gen_theta(features['k2'],num)
    season_list = []
    noise_list = []
    trend_list = []
    for i in range(0,num):
        noise_generator = ng.NoiseGeneratorFactory().get_generator(None)
        trend_generator = tg.TrendGenerator()
        season_generator = sg.SeasonGeneratorFactory(theta5_list[i],theta3_list[i],theta4_list[i],k1_list[i],k2_list[i],forking_depth=7).get_generator(None)

        season = season_generator.gen_season()
        noise = noise_generator.gen(theta6_list[i],theta7_list[i],theta8_list[i],theta9_list[i],len(season[0]))
        trend = trend_generator.gen(theta1_list[i],theta2_list[i],len(season[0]))
        season_list.append(season)
        noise_list.append(noise)
        trend_list.append(trend)
        

        # print(noise[1].shape,trend[1].shape,season[1].shape)
        # print(noise[0].shape,trend[0].shape,season[0].shape)
        print(noise)
        print(trend)
        print(season)
    assembler = assem.AbstractAssembler(season_list,noise_list,trend_list)
    assembler.assemble()
    assembler.save(path=out_path)
Пример #2
0
import generator.trend_generator as tg
import generator.noise_generator as ng
import generator.season_generator as sg
import matplotlib.pyplot as plt

#====================================================================================
# Group1
# spike, beat, type1, type2, control noise level.
season_generator = sg.NormalSeasonGenerator(10,
                                            10,
                                            200,
                                            drift_a=0,
                                            drift_f=0,
                                            forking_depth=7)
noise_generator = ng.Gaussian()
trend_generator = tg.TrendGenerator()

season = season_generator.gen_season()
length = len(season[0])
noise = [
    noise_generator.gen(0, sigma, length)
    for sigma in np.linspace(0.5, 2, 100)
]
trend = trend_generator.gen(0, 0, length)

# assembler = assem.AssemblerWithAdditiveAnomalyInjector_v1(season,noise,trend,'noise',10e-7,0.2,a_type='spike')
assembler = assem.AssemblerWithAdditiveAnomalyInjector_v1(season,
                                                          noise,
                                                          trend,
                                                          'noise',
                                                          10e-7,
Пример #3
0
def gen_v(config):
    config
    # season_generator = sg.SeasonGeneratorFactory(10,10,200,drift_a=0,drift_f=0,forking_depth=7,'vanish')
    noise_generator = ng.Gaussian()
    trend_generator = tg.TrendGenerator()