algorithm.py 392 B

1234567891011121314
  1. import numpy as np
  2. def calc_chratios(data,pos_map,start,end):
  3. view = data[[pos_map.succ_count, pos_map.fail_count, pos_map.commit_count], :]
  4. view = view[:, start:end]
  5. all = np.cumsum(view, axis=1)
  6. succ = all[0, :]
  7. commit = all[0, :] + all[1, :]
  8. commit += 0.0000001
  9. y = succ / commit
  10. y = y.ravel()
  11. return int(all[0, -1]), int(all[0, -1] + all[1, -1]), y