|
| 1 | +# Feature Group Sample |
| 2 | + |
| 3 | +This sample demonstrates how to create a feature group using the Amazon AWS Controllers for Kubernetes (ACK) service controller for Amazon SageMaker. |
| 4 | + |
| 5 | +Inspiration for this sample was taken from the notebook on [Fraud Detection with Amazon SageMaker FeatureStore](https://sagemaker-examples.readthedocs.io/en/latest/sagemaker-featurestore/sagemaker_featurestore_fraud_detection_python_sdk.html). |
| 6 | + |
| 7 | +## Prerequisites |
| 8 | + |
| 9 | +This sample assumes that you have completed the [common prerequisites](https://github.com/aws-controllers-k8s/sagemaker-controller/blob/main/samples/README.md). |
| 10 | + |
| 11 | +### Create an S3 bucket: |
| 12 | + |
| 13 | +Since we are using the offline store in this example, you need to set up an s3 bucket. [Here are directions](https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html) to set up your s3 bucket through the S3 Console, AWS SDK, or AWS CLI. |
| 14 | + |
| 15 | +### Updating the Feature Group Specification: |
| 16 | + |
| 17 | +In the `my-feature-group.yaml` file, modify the placeholder values with those associated with your account and feature group. |
| 18 | + |
| 19 | +## Creating your Feature Group |
| 20 | + |
| 21 | +### Create a Feature Group: |
| 22 | + |
| 23 | +To submit your prepared feature group specification, apply the specification to your Kubernetes cluster as such: |
| 24 | + |
| 25 | +``` |
| 26 | +$ kubectl apply -f my-feature-group.yaml |
| 27 | +featuregroup.sagemaker.services.k8s.aws/my-feature-group created |
| 28 | +``` |
| 29 | + |
| 30 | +### List Feature Groups: |
| 31 | + |
| 32 | +To list all feature groups created using the ACK controller use the following command: |
| 33 | + |
| 34 | +``` |
| 35 | +$ kubectl get featuregroup |
| 36 | +``` |
| 37 | + |
| 38 | +### Describe a Feature Group: |
| 39 | + |
| 40 | +To get more details about the feature group once it's submitted, like checking the status, errors or parameters of the feature group use the following command: |
| 41 | + |
| 42 | +``` |
| 43 | +$ kubectl describe featuregroup my-feature-group |
| 44 | +``` |
| 45 | + |
| 46 | +## Ingesting Data into your Feature Group |
| 47 | + |
| 48 | +Note that ingestion is **not** supported in the controller. |
| 49 | +To ingest data from the my-sample-data.csv file into your feature group, use the following command: |
| 50 | + |
| 51 | +``` |
| 52 | +$ python3 data_ingestion.py -i my-sample-data.csv -fg my-feature-group |
| 53 | +``` |
| 54 | + |
| 55 | +## Deleting your Feature Group |
| 56 | + |
| 57 | +To delete the feature group, use the following command: |
| 58 | + |
| 59 | +``` |
| 60 | +$ kubectl delete featuregroup my-feature-group |
| 61 | +featuregroup.sagemaker.services.k8s.aws "my-feature-group" deleted |
| 62 | +``` |
0 commit comments