利用Vertex AI进行机器学习模型训练与可解释性分析
1. 使用Vertex AI训练自定义机器学习模型
在能够启动Vertex AI训练、监控训练过程并保存TensorFlow训练的模型后,接下来就可以进入模型评估阶段。
1.1 评估训练好的模型
- 加载测试数据 :首先需要将测试数据加载到Jupyter Notebook中,代码如下:
from io import BytesIO
import numpy as np
from tensorflow.python.lib.io import file_io
dest = 'gs://data-bucket-417812395597/'
test_x = np.load(BytesIO(file_io.read_file_to_string(dest+'test_x', binary_mode=True)))
test_y = np.load(BytesIO(file_io.read_file_to_string(dest+'test_y', binary_mode=True)))
print(test_x.shape, test_y.shape)
- 创建JSON负载 :将测试数据的实例转换为JSON格式并保存到云存储位置,以便批量推理模块读取并进行推理。
import json
BATCH_PRE
超级会员免费看
订阅专栏 解锁全文

被折叠的 条评论
为什么被折叠?



