rl_client Reference

class rl_client.Configuration

Container class for all configuration values. Generally is constructed from client.json file read from disk

get(self: rl_client.Configuration, name: str, defval: str) str

Get a config value or default.

Parameters:
  • name – Name of configuration value to get

  • defval – Value to return if name does not exist

Returns:

string value from config

set(self: rl_client.Configuration, arg0: str, arg1: str) None
class rl_client.EpisodeState
property episode_id
class rl_client.LiveModel
choose_rank(*args, **kwargs)

Overloaded function.

  1. choose_rank(self: rl_client.LiveModel, context: str, event_id: str, deferred: bool = False) -> reinforcement_learning::ranking_response

    Request prediction for given context and use the given event_id

    rtype:

    rl_client.RankingResponse

  2. choose_rank(self: rl_client.LiveModel, context: str, deferred: bool = False) -> reinforcement_learning::ranking_response

    Request prediction for given context and let an event id be generated

    rtype:

    rl_client.RankingResponse

refresh_model(self: rl_client.LiveModel) None
report_action_taken(self: rl_client.LiveModel, event_id: str) None
report_outcome(*args, **kwargs)

Overloaded function.

  1. report_outcome(self: rl_client.LiveModel, event_id: str, outcome: str) -> None

  2. report_outcome(self: rl_client.LiveModel, event_id: str, outcome: float) -> None

  3. report_outcome(self: rl_client.LiveModel, episode_id: str, event_id: str, outcome: float) -> None

request_episodic_decision(self: rl_client.LiveModel, event_id: str, previous_id: str, context: str, episode: reinforcement_learning::episode_state) reinforcement_learning::ranking_response
exception rl_client.RLException
code

Get the error code for this exception.

class rl_client.RankingResponse
property actions_probabilities

The list of action ids and corresponding probabilities

Return type:

list[(int,float)]

property chosen_action_id

Action chosen

Return type:

int

property event_id

Either the supplied event ID or auto generated if none was given

Return type:

str

property model_id

ID of model used to make this prediction

Return type:

str

rl_client.create_config_from_json(config_json: str) rl_client.Configuration

Parse the input as JSON and return an rl_client.Configuration object which contains each field.

Parameters:

config_json – JSON string to parse

Returns:

rl_client.Configuration object containing parsed values