def threshold()

in sagemaker/source/dataset/dataset_generator.py [0:0]


    def threshold(stats):
        sensor_series = iter(SensorSeries(stats))

        samples = []
        for t in range(100):
            voltage, current, resistance = next(sensor_series)
            samples.append(abs(voltage - current * resistance))

        samples = np.array(samples)
        threshold = samples.mean() + 2 * samples.std()
        return threshold