Title: | R API Wrapper for SigOpt |
---|---|
Description: | Interfaces with the 'SigOpt' API. More info at <https://sigopt.com>. |
Authors: | Alexandra Johnson [aut, cre] |
Maintainer: | Alexandra Johnson <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.1 |
Built: | 2024-12-08 06:50:02 UTC |
Source: | CRAN |
Create an experiment
create_experiment(body)
create_experiment(body)
body |
POST body of create request |
experiment created by SigOpt
env <- Sys.getenv("NOT_CRAN") if (!identical(env, "true")) { 0 } else { create_experiment(list( name="R test experiment", parameters=list( list(name="x1", type="double", bounds=list(min=0, max=100)), list(name="x2", type="double", bounds=list(min=0, max=100)) ) ))}
env <- Sys.getenv("NOT_CRAN") if (!identical(env, "true")) { 0 } else { create_experiment(list( name="R test experiment", parameters=list( list(name="x1", type="double", bounds=list(min=0, max=100)), list(name="x2", type="double", bounds=list(min=0, max=100)) ) ))}
Create an observation for an experiment
create_observation(experiment_id, body)
create_observation(experiment_id, body)
experiment_id |
the id of an experiment to create an observation for |
body |
POST body of create request |
observation created by SigOpt
env <- Sys.getenv("NOT_CRAN") if (!identical(env, "true")) { 0 } else { experiment <- create_experiment(list( name="R test experiment", parameters=list( list(name="x1", type="double", bounds=list(min=0, max=100)), list(name="x2", type="double", bounds=list(min=0, max=100)) ) )) suggestion <- create_suggestion(experiment$id) create_observation(experiment$id, list(suggestion=suggestion$id, value=99.08)) create_observation(experiment$id, list(suggestion=suggestion$id, value=99.58, value_stddev=0.1))}
env <- Sys.getenv("NOT_CRAN") if (!identical(env, "true")) { 0 } else { experiment <- create_experiment(list( name="R test experiment", parameters=list( list(name="x1", type="double", bounds=list(min=0, max=100)), list(name="x2", type="double", bounds=list(min=0, max=100)) ) )) suggestion <- create_suggestion(experiment$id) create_observation(experiment$id, list(suggestion=suggestion$id, value=99.08)) create_observation(experiment$id, list(suggestion=suggestion$id, value=99.58, value_stddev=0.1))}
Create a suggestion for an experiment
create_suggestion(experiment_id, body = NULL)
create_suggestion(experiment_id, body = NULL)
experiment_id |
the id of an experiment to create an suggestion for |
body |
POST body of create request |
suggestion created by SigOpt
env <- Sys.getenv("NOT_CRAN") if (!identical(env, "true")) { 0 } else { experiment <- create_experiment(list( name="R test experiment", parameters=list( list(name="x1", type="double", bounds=list(min=0, max=100)), list(name="x2", type="double", bounds=list(min=0, max=100)) ) )) create_suggestion(experiment$id)}
env <- Sys.getenv("NOT_CRAN") if (!identical(env, "true")) { 0 } else { experiment <- create_experiment(list( name="R test experiment", parameters=list( list(name="x1", type="double", bounds=list(min=0, max=100)), list(name="x2", type="double", bounds=list(min=0, max=100)) ) )) create_suggestion(experiment$id)}
Fetch an experiment
fetch_experiment(experiment_id, body = NULL)
fetch_experiment(experiment_id, body = NULL)
experiment_id |
the id of an experiment to fetch |
body |
Url params of GET request |
SigOpt experiment with id experiment_id
env <- Sys.getenv("NOT_CRAN") if (!identical(env, "true")) { 0 } else { experiment <- create_experiment(list( name="R test experiment", parameters=list( list(name="x1", type="double", bounds=list(min=0, max=100)), list(name="x2", type="double", bounds=list(min=0, max=100)) ) )) fetch_experiment(experiment$id)}
env <- Sys.getenv("NOT_CRAN") if (!identical(env, "true")) { 0 } else { experiment <- create_experiment(list( name="R test experiment", parameters=list( list(name="x1", type="double", bounds=list(min=0, max=100)), list(name="x2", type="double", bounds=list(min=0, max=100)) ) )) fetch_experiment(experiment$id)}
Franke function - http://www.sfu.ca/~ssurjano/franke2d.html
franke(x, y)
franke(x, y)
x |
First dimension |
y |
Second dimension |
The franke function evaluated at x,y
franke(0,1)
franke(0,1)
Get the SigOpt API token from the SIGOPT_API_TOKEN environment variable or user input
sigopt_api_token(force = FALSE)
sigopt_api_token(force = FALSE)
force |
force entry of SigOpt API token, even if present |
SigOpt API token
Get the SigOpt API url from the SIGOPT_API_URL environment variable or use default Most users will be ok with the default value
sigopt_api_url()
sigopt_api_url()
Base url for SigOpt API requests
sigopt_GET
and sigopt_POST
, which perform the HTTP requests
User agent for current version of SigOpt R API Client
sigopt_api_user_agent()
sigopt_api_user_agent()
User agent
sigopt_GET
and sigopt_POST
, which perform the HTTP requests
Create authentication for SigOpt API, using HTTP Basic Auth
sigopt_auth(api_token = sigopt_api_token())
sigopt_auth(api_token = sigopt_api_token())
api_token |
SigOpt API token |
http basic authentiation with api_token as username and no password
Check content returned by the SigOpt API
sigopt_check(req)
sigopt_check(req)
req |
result of request to the SigOpt API |
invisible(), stops if there is an error status code
sigopt_GET
and sigopt_POST
, which call this function interally
GET request to SigOpt API path, with json encoded body
sigopt_GET(path, query = NULL, api_token = sigopt_api_token())
sigopt_GET(path, query = NULL, api_token = sigopt_api_token())
path |
path of SigOpt API url to POST to |
query |
list of query parameters to be url-encoded |
api_token |
SigOpt api token |
result of request to SigOpt API, needs to be JSON decoded
sigopt_parse
, which parses the result of this function
Parse content returned by the SigOpt API
sigopt_parse(req)
sigopt_parse(req)
req |
result of request to the SigOpt API |
json decoding of request object
sigopt_GET
and sigopt_POST
, which call this function interally
POST request to SigOpt API path, with json encoded body
sigopt_POST(path, body, api_token = sigopt_api_token())
sigopt_POST(path, body, api_token = sigopt_api_token())
path |
path of SigOpt API url to POST to |
body |
POST body, will be json-encoded |
api_token |
SigOpt api token |
result of request to SigOpt API, needs to be JSON decoded
sigopt_parse
, which parses the result of this function