moe.views.rest package

Submodules

moe.views.rest.bandit_bla module

Classes for bandit_bla endpoints.

Includes:

  1. pretty and backend views
class moe.views.rest.bandit_bla.BanditBLAView(request)[source]

Bases: moe.views.bandit_pretty_view.BanditPrettyView

Views for bandit_bla endpoints.

bandit_bla_view()[source]

Endpoint for bandit_epsilon POST requests.

POST /bandit/bla

Predict the optimal arm from a set of arms, given historical data.

Input:

moe.views.schemas.rest.bandit_bla.BanditBLARequest

Output:

moe.views.schemas.bandit_pretty_view.BanditResponse

Status Codes:
  • 200 – returns a response
  • 500 – server error
pretty_view()[source]

A pretty, browser interactive view for the interface. Includes form request and response.

GET /bandit/bla/pretty
request_schema = <moe.views.schemas.rest.bandit_bla.BanditBLARequest object at 4797063952 (named )>
response_schema = <moe.views.schemas.bandit_pretty_view.BanditResponse object at 4797557840 (named )>

moe.views.rest.bandit_epsilon module

Classes for bandit_epsilon endpoints.

Includes:

  1. pretty and backend views
class moe.views.rest.bandit_epsilon.BanditEpsilonView(request)[source]

Bases: moe.views.bandit_pretty_view.BanditPrettyView

Views for bandit_epsilon endpoints.

bandit_epsilon_view()[source]

Endpoint for bandit_epsilon POST requests.

POST /bandit/epsilon

Predict the optimal arm from a set of arms, given historical data.

Input:

moe.views.schemas.rest.bandit_epsilon.BanditEpsilonRequest

Output:

moe.views.schemas.bandit_pretty_view.BanditResponse

Status Codes:
  • 200 – returns a response
  • 500 – server error
get_params_from_request()[source]

Return the deserialized parameters from the json_body of a request.

We explicitly pull out the hyparparameter_info and use it to deserialize and validate the other parameters (epsilon, total_samples).

This is necessary because we have different hyperparameters for different subtypes.

Returns:A deserialized self.request_schema object
Return type:dict
pretty_view()[source]

A pretty, browser interactive view for the interface. Includes form request and response.

GET /bandit/epsilon/pretty
request_schema = <moe.views.schemas.rest.bandit_epsilon.BanditEpsilonRequest object at 4797777872 (named )>
response_schema = <moe.views.schemas.bandit_pretty_view.BanditResponse object at 4797778000 (named )>

moe.views.rest.bandit_ucb module

Classes for bandit_ucb endpoints.

Includes:

  1. pretty and backend views
class moe.views.rest.bandit_ucb.BanditUCBView(request)[source]

Bases: moe.views.bandit_pretty_view.BanditPrettyView

Views for bandit_ucb endpoints.

bandit_ucb_view()[source]

Endpoint for bandit_epsilon POST requests.

POST /bandit/ucb

Predict the optimal arm from a set of arms, given historical data.

Input:

moe.views.schemas.rest.bandit_ucb.BanditUCBRequest

Output:

moe.views.schemas.bandit_pretty_view.BanditResponse

Status Codes:
  • 200 – returns a response
  • 500 – server error
pretty_view()[source]

A pretty, browser interactive view for the interface. Includes form request and response.

GET /bandit/ucb/pretty
request_schema = <moe.views.schemas.rest.bandit_ucb.BanditUCBRequest object at 4798187664 (named )>
response_schema = <moe.views.schemas.bandit_pretty_view.BanditResponse object at 4798626576 (named )>

moe.views.rest.gp_ei module

Classes for gp_ei endpoints.

Includes:

  1. pretty and backend views
class moe.views.rest.gp_ei.GpEiView(request)[source]

Bases: moe.views.gp_pretty_view.GpPrettyView

Views for gp_ei endpoints.

gp_ei_view()[source]

Endpoint for gp_ei POST requests.

POST /gp/ei

Calculates the Expected Improvement (EI) of a set of points, given historical data.

Input:

moe.views.schemas.rest.GpEiRequest

Output:

moe.views.schemas.rest.GpEiResponse

Status Codes:
  • 200 – returns a response
  • 500 – server error
pretty_view()[source]

A pretty, browser interactive view for the interface. Includes form request and response.

GET /gp/ei/pretty
request_schema = <moe.views.schemas.rest.gp_ei.GpEiRequest object at 4690145808 (named )>
response_schema = <moe.views.schemas.rest.gp_ei.GpEiResponse object at 4690146960 (named )>

moe.views.rest.gp_hyper_opt module

Classes for gp_hyper_opt endpoints.

Includes:

  1. pretty and backend views
class moe.views.rest.gp_hyper_opt.GpHyperOptView(request)[source]

Bases: moe.views.optimizable_gp_pretty_view.OptimizableGpPrettyView

Views for gp_hyper_opt endpoints.

gp_hyper_opt_view()[source]

Endpoint for gp_hyper_opt POST requests.

POST /gp/hyper_opt

Calculates the optimal hyperparameters for a gaussian process, given historical data.

Input:

moe.views.schemas.rest.gp_hyper_opt.GpHyperOptRequest

Output:

moe.views.schemas.rest.gp_hyper_opt.GpHyperOptResponse

Status Codes:
  • 200 – returns a response
  • 500 – server error
pretty_view()[source]

A pretty, browser interactive view for the interface. Includes form request and response.

GET /gp/hyper_opt/pretty
request_schema = <moe.views.schemas.rest.gp_hyper_opt.GpHyperOptRequest object at 4798530512 (named )>
response_schema = <moe.views.schemas.rest.gp_hyper_opt.GpHyperOptResponse object at 4798530640 (named )>

moe.views.rest.gp_mean_var module

Classes for gp_mean, gp_var, and gp_mean_var (and _diag) endpoints.

Includes:

  1. pretty and backend views
class moe.views.rest.gp_mean_var.GpMeanVarBaseView(request)[source]

Bases: moe.views.gp_pretty_view.GpPrettyView

Base View class for gp_mean, gp_var, gp_mean_var, and _diag endpoints.

gp_mean_var_response_dict(compute_mean=False, compute_var=False, var_diag=False)[source]

Produce a response dict (to be serialized) for gp_mean, gp_var, gp_mean_var, and _diag POST requests.

Parameters:
  • compute_mean (bool) – whether to compute the GP mean
  • compute_var (bool) – whether to compute the GP variance or covariance
  • var_diag (bool) – whether to compute the full GP covariance or just the variance terms
Returns:

dict with ‘endpoint’ and optionally ‘mean’ and ‘var’ keys depending on inputs

Return type:

dict

request_schema = <moe.views.schemas.rest.gp_mean_var.GpMeanVarRequest object at 4796432144 (named )>
class moe.views.rest.gp_mean_var.GpMeanVarDiagView(request)[source]

Bases: moe.views.rest.gp_mean_var.GpMeanVarBaseView

Views for gp_mean_var_diag endpoints.

gp_mean_var_diag_view()[source]

Endpoint for gp_mean_var_diag POST requests.

POST /gp/mean_var/diag

Calculates the GP mean and variance of a set of points, given historical data.

Input:

moe.views.schemas.rest.gp_mean_var.GpMeanVarRequest

Output:

moe.views.schemas.rest.gp_mean_var.GpMeanVarDiagResponse

Status Codes:
  • 200 – returns a response
  • 500 – server error
pretty_view()[source]

A pretty, browser interactive view for the interface. Includes form request and response.

GET /gp/mean_var/diag/pretty
response_schema = <moe.views.schemas.rest.gp_mean_var.GpMeanVarDiagResponse object at 4796600464 (named )>
class moe.views.rest.gp_mean_var.GpMeanVarView(request)[source]

Bases: moe.views.rest.gp_mean_var.GpMeanVarBaseView

Views for gp_mean_var endpoints.

gp_mean_var_view()[source]

Endpoint for gp_mean_var POST requests.

POST /gp/mean_var

Calculates the GP mean and covariance of a set of points, given historical data.

Input:

moe.views.schemas.rest.gp_mean_var.GpMeanVarRequest

Output:

moe.views.schemas.rest.gp_mean_var.GpMeanVarResponse

Status Codes:
  • 200 – returns a response
  • 500 – server error
pretty_view()[source]

A pretty, browser interactive view for the interface. Includes form request and response.

GET /gp/mean_var/pretty
response_schema = <moe.views.schemas.rest.gp_mean_var.GpMeanVarResponse object at 4796432336 (named )>
class moe.views.rest.gp_mean_var.GpMeanView(request)[source]

Bases: moe.views.rest.gp_mean_var.GpMeanVarBaseView

Views for gp_mean_var endpoints.

gp_mean_view()[source]

Endpoint for gp_mean POST requests.

POST /gp/mean

Calculates the GP mean of a set of points, given historical data.

Input:

moe.views.schemas.rest.gp_mean_var.GpMeanVarRequest

Output:

moe.views.schemas.rest.gp_mean_var.GpMeanResponse

Status Codes:
  • 200 – returns a response
  • 500 – server error
pretty_view()[source]

A pretty, browser interactive view for the interface. Includes form request and response.

GET /gp/mean/pretty
response_schema = <moe.views.schemas.rest.gp_mean_var.GpMeanResponse object at 4796601488 (named )>
class moe.views.rest.gp_mean_var.GpVarDiagView(request)[source]

Bases: moe.views.rest.gp_mean_var.GpMeanVarBaseView

Views for gp_var_diag endpoints.

gp_var_diag_view()[source]

Endpoint for gp_var_diag POST requests.

POST /gp/var/diag

Calculates the GP variance of a set of points, given historical data.

Input:

moe.views.schemas.rest.gp_mean_var.GpMeanVarRequest

Output:

moe.views.schemas.rest.gp_mean_var.GpVarDiagResponse

Status Codes:
  • 200 – returns a response
  • 500 – server error
pretty_view()[source]

A pretty, browser interactive view for the interface. Includes form request and response.

GET /gp/var/diag/pretty
response_schema = <moe.views.schemas.rest.gp_mean_var.GpVarDiagResponse object at 4796602064 (named )>
class moe.views.rest.gp_mean_var.GpVarView(request)[source]

Bases: moe.views.rest.gp_mean_var.GpMeanVarBaseView

Views for gp_var endpoints.

gp_var_view()[source]

Endpoint for gp_var POST requests.

POST /gp/var

Calculates the GP covariance of a set of points, given historical data.

Input:

moe.views.schemas.rest.gp_mean_var.GpMeanVarRequest

Output:

moe.views.schemas.rest.gp_mean_var.GpVarResponse

Status Codes:
  • 200 – returns a response
  • 500 – server error
pretty_view()[source]

A pretty, browser interactive view for the interface. Includes form request and response.

GET /gp/var/pretty
response_schema = <moe.views.schemas.rest.gp_mean_var.GpVarResponse object at 4796601744 (named )>

moe.views.rest.gp_next_points_constant_liar module

Classes for gp_next_points_constant_liar endpoints.

Includes:

  1. pretty and backend views

Support for:

  • ‘constant_liar_min’ - lie_value is equal to the min of all points sampled so far
  • ‘constant_liar_max’ - lie_value is equal to the max of all points sampled so far
  • ‘constant_liar_mean’ - lie_value is equal to the mean of all points sampled so far
class moe.views.rest.gp_next_points_constant_liar.GpNextPointsConstantLiar(request)[source]

Bases: moe.views.gp_next_points_pretty_view.GpNextPointsPrettyView

Views for gp_next_points_constant_liar endpoints.

get_lie_value(params)[source]

Return the lie value associated with the lie_method, unless lie_value is explicitly given.

gp_next_points_constant_liar_view()[source]

Endpoint for gp_next_points_constant_liar POST requests.

POST /gp/next_points/constant_liar

Calculates the next best points to sample, given historical data, using Constant Liar (CL).

Input:

moe.views.schemas.rest.gp_next_points_constant_liar.GpNextPointsConstantLiarRequest

Output:

moe.views.schemas.gp_next_points_pretty_view.GpNextPointsResponse

Status Codes:
  • 200 – returns a response
  • 500 – server error
pretty_view()[source]

A pretty, browser interactive view for the interface. Includes form request and response.

GET /gp/next_points/constant_liar/pretty
request_schema = <moe.views.schemas.rest.gp_next_points_constant_liar.GpNextPointsConstantLiarRequest object at 4784572688 (named )>

moe.views.rest.gp_next_points_epi module

Classes for gp_next_points_epi endpoints.

Includes:

  1. pretty and backend views
class moe.views.rest.gp_next_points_epi.GpNextPointsEpi(request)[source]

Bases: moe.views.gp_next_points_pretty_view.GpNextPointsPrettyView

Views for gp_next_points_epi endpoints.

gp_next_points_epi_view()[source]

Endpoint for gp_next_points_epi POST requests.

POST /gp/next_points/epi

Calculates the next best points to sample, given historical data, using Expected Parallel Improvement (EPI).

Input:

moe.views.schemas.gp_next_points_pretty_view.GpNextPointsRequest

Output:

moe.views.schemas.gp_next_points_pretty_view.GpNextPointsResponse

Status Codes:
  • 200 – returns a response
  • 500 – server error
pretty_view()[source]

A pretty, browser interactive view for the interface. Includes form request and response.

GET /gp/next_points/epi/pretty

moe.views.rest.gp_next_points_kriging module

Classes for gp_next_points_kriging endpoints.

Includes:
  1. pretty and backend views
class moe.views.rest.gp_next_points_kriging.GpNextPointsKriging(request)[source]

Bases: moe.views.gp_next_points_pretty_view.GpNextPointsPrettyView

Views for gp_next_points_kriging endpoints.

gp_next_points_kriging_view()[source]

Endpoint for gp_next_points_kriging POST requests.

POST /gp/next_points/kriging

Calculates the next best points to sample, given historical data, using Kriging.

Input:

moe.views.schemas.rest.gp_next_points_kriging.GpNextPointsKrigingRequest

Output:

moe.views.schemas.gp_next_points_pretty_view.GpNextPointsResponse

Status Codes:
  • 200 – returns a response
  • 500 – server error
pretty_view()[source]

A pretty, browser interactive view for the interface. Includes form request and response.

request_schema = <moe.views.schemas.rest.gp_next_points_kriging.GpNextPointsKrigingRequest object at 4689224144 (named )>

Module contents

The REST interface for the MOE webapp.

Internal Gaussian Process (GP) endpoints:

  • gp_ei

    POST /gp/ei

    Calculates the Expected Improvement (EI) of a set of points, given historical data.

    GET /gp/ei/pretty
  • gp_mean_var

    POST /gp/mean_var

    Calculates the GP mean and covariance of a set of points, given historical data.

    GET /gp/mean_var/pretty

Next points endpoints:

  • gp_next_points_epi

    POST /gp/next_points/epi

    Calculates the next best points to sample, given historical data, using Expected Parallel Improvement (EPI).

    GET /gp/next_points/epi/pretty
  • gp_next_points_constant_liar

    POST /gp/next_points/constant_liar

    Calculates the next best points to sample, given historical data, using Constant Liar (CL).

    GET /gp/next_points/constant_liar/pretty
  • gp_next_points_kriging

    POST /gp/next_points/kriging

    Calculates the next best points to sample, given historical data, using Kriging.

    GET /gp/next_points/kriging/pretty

Bandit endpoints:

  • bandit_epsilon

    POST /bandit/epsilon

    Calculates the arm allocations and the best arm to pull next using Epsilon policy, given subtype, historical data, hyperparameters.

    GET /bandit/epsilon/pretty
  • bandit_ucb

    POST /bandit/ucb

    Calculates the arm allocations and the best arm to pull next using UCB policy, given subtype, historical data, hyperparameters.

    GET /bandit/ucb/pretty
  • bandit_bla

    POST /bandit/bla

    Calculates the arm allocations and the best arm to pull next using BLA policy, given subtype, historical data, hyperparameters.

    GET /bandit/bla/pretty