def atomic_benchmark_estimator(estimator, X_test, verbose=False):
 n_instances = X_test.shape[0]
 runtimes = np.zeros(n_instances, dtype=np.float)
 for i in range(n_instances):
  instance = X_test[[i], :]
  start = time.time()
  estimator.predict(instance)
  runtimes[i] = (time.time() - start)
 if verbose:
  print('atomic_benchmark runtimes:', min(runtimes), scoreatpercentile(runtimes, 50), max(runtimes))
 return runtimes

def atomic_benchmark_estimator ( estimator , X_test , verbose = False ) : n_instances = X_test . shape [ 0 ] runtimes = np . zeros ( n_instances , dtype = np . float ) for i in range ( n_instances ) : instance = X_test [ [ i ] , : ] start = time . time ( ) estimator . predict ( instance ) runtimes [ i ] = ( time . time ( ) - start ) if verbose : print ( 'atomic_benchmark runtimes:' , min ( runtimes ) , scoreatpercentile ( runtimes , 50 ) , max ( runtimes ) ) return runtimes
measure runtime prediction of each instance .