nextml / NEXT

NEXT is a machine learning system that runs in the cloud and makes it easy to develop, evaluate, and apply active learning in the real-world. Ask better questions. Get better results. Faster. Automated.
http://nextml.org
Apache License 2.0
160 stars 54 forks source link

getting experiment data with GET / POST #180

Closed remcinerney closed 7 years ago

remcinerney commented 7 years ago

Is it possible to get the core experiment data with a GET / POST request?

I am trying to replicate query_page on my own server, and at the moment it requires use of the resource manager to get the data... namely: experiment = resource_manager.get_experiment(exp_uid)

There seems to be a lot of unnecessary overhead in doing this so is it possible to do this through a GET / POST request instead?

lalitkumarj commented 7 years ago

Yes...and this is recommended. Take a look in the query page code which uses next_widget.js to do a post request.

You can't avoid the resource manager...that's what translates the exp_uid into an App object to build the experiment. On Apr 12, 2017 10:12 AM, "remcinerney" notifications@github.com wrote:

Is it possible to get the core experiment data with a GET / POST request?

I am trying to replicate query_page on my own server, and at the moment it requires use of the resource manager to get the data... namely: experiment = resource_manager.get_experiment(exp_uid)

There seems to be a lot of unnecessary overhead in doing this so is it possible to do this through a GET / POST request instead?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nextml/NEXT/issues/180, or mute the thread https://github.com/notifications/unsubscribe-auth/ABWhGMKOTM8uo5U1p_YH3M5xTdpltdF6ks5rvNvogaJpZM4M7e4H .

lalitkumarj commented 7 years ago

And by query page code I meant the html file.

Btw, do you mind moving this convo over to the gitter? I can monitor things there. On Apr 12, 2017 10:17 AM, "Lalit Jain" lalitkumarj@gmail.com wrote:

Yes...and this is recommended. Take a look in the query page code which uses next_widget.js to do a post request.

You can't avoid the resource manager...that's what translates the exp_uid into an App object to build the experiment. On Apr 12, 2017 10:12 AM, "remcinerney" notifications@github.com wrote:

Is it possible to get the core experiment data with a GET / POST request?

I am trying to replicate query_page on my own server, and at the moment it requires use of the resource manager to get the data... namely: experiment = resource_manager.get_experiment(exp_uid)

There seems to be a lot of unnecessary overhead in doing this so is it possible to do this through a GET / POST request instead?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nextml/NEXT/issues/180, or mute the thread https://github.com/notifications/unsubscribe-auth/ABWhGMKOTM8uo5U1p_YH3M5xTdpltdF6ks5rvNvogaJpZM4M7e4H .

remcinerney commented 7 years ago

Just sent a message on gitter... hopefully I got the right page

stsievert commented 7 years ago

On Gitter @lalitkumarj said

NEXT has a RESTFUL API so you can look at an example test_api script to see how you can post to it for example: https://github.com/nextml/NEXT/blob/master/apps/CardinalBanditsPureExploration/tests/test_api.py This uses test_utils https://github.com/nextml/NEXT/blob/master/next/apps/test_utils.py If you are writing a web app on another machine that calls NEXT you want to do the post calls serverside not client side to avoid CORS issues So basically, make your getQuery dictionary for api calls - then post it to NEXT from your web server using any method you want, you will get a response and you can choose to render that any way you want in your custom query page