#!/usr/bin/env python from yhat import Yhat #yh = Yhat("*****@*****.**", "RoVGt5VDZfHkdBLx2rre76sg998cD4IuJiYzzNmNp48") yh = Yhat("*****@*****.**", "HaDobDyJtFoQQPZ9xRkCJrI44OB6EW8hC6IfUMsGzo8") checkoo_models = yh.show_models() for model in checkoo_models['models']: print model newcase = { 'loc':'BeiJing', 'major':'Computer Science/Engineering', 'vtype':'F1', 'ventry':'New', 'byear':'2013', 'bmonth':'7', 'bday':'20' } checkoo_version = 14 print yh.predict('CKModel',checkoo_version,newcase)
# <markdowncell> # <p>Deploy to Yhat</p> # <codecell> yh = Yhat("YOUR USERNAME", "YOUR API KEY") # <codecell> print yh.upload("NamedEntityFindr", clf) # <codecell> [model for model in yh.show_models()['models'] if model['name'] == "NamedEntityFindr"] # <codecell> results_from_server = yh.raw_predict("NamedEntityFindr", 1, data) results_from_server # <codecell> print 'sanity check.' print 'results all match => %s' \ % np.all(np.array(results['entities']) == np.array(results_from_server['prediction']['entities'])) # <markdowncell> # <h2>Final Thoughts</h2>