开始使用免费开始使用

将 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)
编辑并运行代码