

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 刪除功能群組
<a name="feature-store-delete-feature-group"></a>

您可以使用主控台或 Amazon SageMaker Feature Store API 來刪除特徵群組。透過主控台使用特徵存放區的指示取決於您是否已啟用 Studio 或 Studio Classic 作為預設體驗。如需兩者之間差異的詳細資訊，或如何變更您的預設值，請參閱 [Amazon SageMaker Studio](studio-updated.md)。

以下各節提供如何刪除特徵群組的概觀。

**Topics**
+ [使用主控台來刪除特徵群組](#feature-store-delete-feature-group-studio)
+ [刪除功能群組範例 Python 程式碼](#feature-store-delete-feature-group-example)

## 使用主控台來刪除特徵群組
<a name="feature-store-delete-feature-group-studio"></a>

本節顯示兩種在主控台中刪除特徵群組的方法，取決於您的預設體驗：Studio 或 Studio Classic。

### 如果 Studio 是您的預設體驗 (主控台)，請刪除特徵群組
<a name="feature-store-delete-feature-group-studio-updated"></a>

1. 遵循[啟動 Amazon SageMaker Studio Classic](studio-launch.md) 中的指示開啟 Studio 主控台。

1. 在左側導覽窗格中，選擇**資料**以展開下拉式清單。

1. 從下拉式清單中，選擇 **Feature Store**。

1. (選用) 若要檢視您的特徵群組，請選擇**我的帳戶**。若要檢視共用特徵群組，請選擇**跨帳戶**。

1. 在**特徵群組目錄**標籤中，於**特徵群組名稱**下選擇您要刪除的特徵群組。

1. 選擇**刪除特徵群組**。

1. 在快顯視窗中，透過在欄位中輸入 **delete** 來確認刪除，然後選擇**刪除**。

## 刪除功能群組範例 Python 程式碼
<a name="feature-store-delete-feature-group-example"></a>

下列程式碼會使用 [https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DeleteFeatureGroup.html](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DeleteFeatureGroup.html) API 作業來刪除使用 適用於 Python (Boto3) 的 AWS SDK的特徵群組。它假設您已設定 Feature Store 並建立了一個特徵群組。如需有關入門的更多相關資訊，請參閱[功能儲存範例筆記本簡介](feature-store-introduction-notebook.md)。

```
import sagemaker
from sagemaker.feature_store.feature_group import FeatureGroup

sagemaker_session = sagemaker.Session()
fg_name = 'your-feature-group-name'

my_fg = FeatureGroup(name=fg_name, sagemaker_session=sagemaker_session)
my_fg.delete()
```