def get_price(l_config, form_info, use_memorized_only, for_test=False):
  ss = seti_server.make_from_config(l_config.model_configs)

  # Generate a price for the form.
  form = to_renter_form(form_info)
  print 'Form: '
  print(form)
  #print 'Age: '
  #print(form.get_age())
  fe = feature_extractor.FeatureExtractor(for_test)
  seti = fe.to_seti(form)
  price = ss.score(seti, use_memorized_only)
  return price
Exemplo n.º 2
0
def testLearn():
  d = gen_offline_model.main(['gen_offline_model.py', 'regression_test'])
  # Make sure that every SETI object that we generate, we have the exact price for
  # when run back through the code.
  l_config = d['l_config']
  ss = seti_server.make_from_config(l_config.model_configs)
  err = []
  i = 0
  for seti in d['setis']:
    #print 'Row %d. Label: %.4ff' % (i, seti.label) 
    price = ss.score(seti)
    assertFloatEquals(price, seti.label)
    #err.append(i)
    i += 1
    #if i == 1000:
    #  break
  print 'Num setis: %d' % i
  print 'Num mismatched setis: %d' % len(err)
  print 'Rows: %s' % (str(err))