Retrieving features from feature groups
Once feature groups are populated, to retrieve features from the feature store, there are two APIs available – get_record and batch_get_record. The following code block shows retrieving a single record from a feature group using the get_record API:
record_identifier_value = str('300')
response = sagemaker_fs_runtime_client.get_record
(FeatureGroupName=weather_feature_group_name_online,
RecordIdentifierValueAsString=record_identifier_value)
response
Response from the code block looks similar to the following figure:
{'ResponseMetadata': {'RequestId': '195debf2-3b10-4116-98c7-142dc13e9df3',
  'HTTPStatusCode': 200,
  'HTTPHeaders': {'x-amzn-requestid': '195debf2-3b10-4116-98c7-142dc13e9df3',
   'content-type': 'application/json',
   'content-length': '214',
  ...