Skip to main content

program

Context Objects

class Context()

Context of the feature request.

Arguments:

  • fqn (str): Fully Qualified Name of the feature.
  • keys (Dict[str,str]): the keys(identifiers) we request the value for.
  • timestamp (datetime): the timestamp when the request for this feature was made by the user

get_feature

def get_feature(selector: str,
keys: Dict[str, str] = None) -> [primitive, datetime]

Get feature value for a dependant feature.

Behind the scenes, the LabSDK will return you the value for the requested Feature Selector and keys at the appropriate timestamp of the request. That means that we'll use the request's timestamp when replying features. Cool right? 😎

Arguments:

  • selector (str): Feature Selector of the feature, including aggregation function if exists.
  • keys (str): the keys(identifiers) we request the value for.

Returns:

a tuple of (value, timestamp)

get_prediction

def get_prediction(selector: str,
keys: Dict[str, str] = None) -> Tuple[any, datetime]

Get the predicted value from a model.

Behind the scenes, the LabSDK will call the model server and deliver back the prediction from the requested Model's FQN and keys at the appropriate timestamp of the request. That means that we'll use the request's timestamp when replying features. Cool right? 😎

Arguments:

  • selector (str): Fully Qualified Name of the model.
  • keys (str): the keys(identifiers) we request the value for. By default, the keys of the current context are used.

Returns:

a tuple of (prediction, timestamp)