features.py 413 B

123456789101112131415161718192021
  1. from . import config as config
  2. import numpy as np
  3. def compute_feature(feature_choice, samples):
  4. data = []
  5. if feature_choice == 'samples':
  6. data = samples
  7. if feature_choice == 'variances':
  8. incr_samples = []
  9. # evolution of variance
  10. for sample in samples:
  11. incr_samples.append(sample)
  12. data.append(np.var(incr_samples))
  13. return data