Example #1
0
def run_ensemble(params):
    driver_id, verbose = params
    results = []
    for i, get_data, model, repeat in STACK:
        results.append((run_model(
            (i, driver_id, model, get_data, repeat)), WEIGHTS[i]))

    predictions = np.array([r[0][0] * r[1] for r in results]).sum(0)
    testY = results[0][0][1]

    if verbose >= 1:
        logging.info('finished driver %s' % driver_id)

    return predictions, testY
def run_ensemble(params):
  driver_id, verbose = params
  results = []
  for i, get_data, model, repeat in STACK:
    results.append((
        run_model((i, driver_id, model, get_data, repeat)),
        WEIGHTS[i]
    ))

  predictions = np.array([r[0][0] * r[1] for r in results]).sum(0)
  testY = results[0][0][1]

  if verbose >= 1:
    logging.info('finished driver %s' % driver_id)

  return predictions, testY
Example #3
0
def compute_weights(params):
  driver_id, verbose, stack_option = params

  stack = STACK if stack_option == 's' else MODELS

  predictions = {}
  for i, get_data, model, repeat in stack:
    start_time = time.time()
    predictions[i], testY = run_model((i, driver_id, model, get_data, repeat))

    if verbose == 2:
      logging.info('%s: %.2f' % (i, time.time() - start_time))

  if verbose >= 1:
    logging.info('finished driver %s' % driver_id)

  return driver_id, predictions, testY