我已经编写了一些代码来在 VertexAI 中使用 Google 的 AutoML 训练模型。我的问题的一个细微差别是我需要手动设置测试列车列。该方法的文档 set_test_train_column 说:
"""Sets the test/train (ml_use) column which designates which data
belongs to the test and train sets. This column must be categorical."""
我的 test/train 列称为“set”,由三个值组成,即“TEST”、“TRAIN”和“VALIDATE”。此列的 dtype 是 'object',其中每个单元格都有一个字符串值。我已经包含了“VALIDATE”,因为在 VertexAI 的 automl 部分中训练模型时设置测试/训练列时这是必需的。
实现这一点的代码是:
dataset_display_name = 'dataset_1'
table_client.set_test_train_column(dataset_display_name=dataset_display_name,
column_spec_display_name='set')
有人可以帮我理解我是否正确实现了这段代码吗?测试/训练列中的值是否正确写入?我没有使用 pd.Categorical 明确说 test/train 列是分类的,这有关系吗?'VALIDATE' 是否应该包含在测试/训练列中?
谢谢!