開始使用免費開始

將 t-SNE 套用到 ANSUR 資料

t-SNE 非常適合用來視覺化探索高維度資料集。在這個練習中,你會把它套用到 ANSUR 資料集。你將從已載入的資料集 df 中移除非數值欄,並在此數值資料集上擬合 TSNE

本練習屬於課程

Python 的降維

檢視課程

練習說明

  • 從資料集中刪除非數值欄。
  • 建立一個 TSNE 模型,learning rate 設為 50。
  • 在數值資料集上對模型進行擬合與轉換。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Non-numerical columns in the dataset
non_numeric = ['Branch', 'Gender', 'Component']

# Drop the non-numerical columns from df
df_numeric = df.____(____, axis=____)

# Create a t-SNE model with learning rate 50
m = ____(____)

# Fit and transform the t-SNE model on the numeric dataset
tsne_features = m.____(____)
print(tsne_features.shape)
編輯並執行程式碼