jay*_*tai 1 python amazon-s3 amazon-web-services amazon-sagemaker
我是 python 编程的新手。遵循 AWS 学习路径:
执行以下块(在 conda_python3 中)时出现错误:
test_data_array = test_data.drop(['y_no', 'y_yes'], axis=1).values #load the data into an array
xgb_predictor.content_type = 'text/csv' # set the data type for an inference
xgb_predictor.serializer = csv_serializer # set the serializer type
predictions = xgb_predictor.predict(test_data_array).decode('utf-8') # predict!
predictions_array = np.fromstring(predictions[1:], sep=',') # and turn the prediction into an
array
print(predictions_array.shape)
Run Code Online (Sandbox Code Playgroud)
AttributeError Traceback (most recent call last) in 1 test_data_array = test_data.drop(['y_no', 'y_yes'], axis=1).values #将数据加载到数组中----> 2 xgb_predictor.content_type = ' text/csv' # 为推理设置数据类型 3 xgb_predictor.serializer = csv_serializer # 设置序列化类型 4 预测 = xgb_predictor.predict(test_data_array).decode('utf-8') # 预测!5 predictions_array = np.fromstring(predictions[1:], sep=',') # 并将预测转成数组
属性错误:无法设置属性
我已经查看了几个先前的问题,但在创建数据类型时找不到与此错误相关的太多信息。
在此先感谢您的帮助。
| 归档时间: |
|
| 查看次数: |
1193 次 |
| 最近记录: |