FeatureGroup
Source:
src/AWS/SageMaker/FeatureGroup.ts
An Amazon SageMaker Feature Store FeatureGroup — a typed, versioned table of ML features with an optional low-latency online store (for inference lookups) and an S3-backed offline store (for training).
With the online store enabled, functions read and write records at runtime
via the AWS.SageMaker.GetRecord / AWS.SageMaker.PutRecord bindings.
Creating Feature Groups
Section titled “Creating Feature Groups”import * as AWS from "alchemy/AWS";
const features = yield* AWS.SageMaker.FeatureGroup("UserFeatures", { recordIdentifierFeatureName: "user_id", eventTimeFeatureName: "event_time", featureDefinitions: [ { FeatureName: "user_id", FeatureType: "String" }, { FeatureName: "event_time", FeatureType: "String" }, { FeatureName: "clicks", FeatureType: "Integral" }, ], onlineStoreConfig: { EnableOnlineStore: true },});Runtime Access
Section titled “Runtime Access”// initconst putRecord = yield* AWS.SageMaker.PutRecord(features);const getRecord = yield* AWS.SageMaker.GetRecord(features);
// runtimeyield* putRecord({ Record: [ { FeatureName: "user_id", ValueAsString: "user-123" }, { FeatureName: "event_time", ValueAsString: new Date().toISOString() }, { FeatureName: "clicks", ValueAsString: "42" }, ],});const { Record } = yield* getRecord({ RecordIdentifierValueAsString: "user-123",});