Azure / Azure/MachineLearningNotebooks

AML: When using ParallelRun with a Tabular Dataset, is the delimiter always a `space` - clarify documenation/example

未关闭
#1,486 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
ADO Data4ML MLOps Pipelines
主要语言
Jupyter Notebook
星标
4.4k
派生
2.6k
PR 合并指标
30 天内没有已合并 PR

描述

@keijik @cody-dkdc @gregce

In [this example notebook](https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/machine-learning-pipelines/parallel-run/tabular-dataset-inference-iris.ipynb) you show the delimter in the file that is written to as being a space. Using space a delimiter seems like a really dangerous choice. Can you change what the delimiter is? If so how? It seems like from this example that this is the default delimiter for tabular datasets which seem problematic.

![image](https://user-images.githubusercontent.com/1483922/119240979-54192a80-bb08-11eb-9b48-246650a3f5ed.png)

The scoring script for this [example is here](https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/machine-learning-pipelines/parallel-run/Code/iris_score.py) as you can see, space is not indicated anywhere in the scoring script, so how does this delimiter come out? If this is the default delimiter, I think this is worth explaining.

[iris_score.py](https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/machine-learning-pipelines/parallel-run/Code/iris_score.py)

```py
import io
import pickle
import argparse
import numpy as np

from azureml.core.model import Model
from sklearn.linear_model import LogisticRegression

from azureml_user.parallel_run import EntryScript

def init():
global iris_model

logger = EntryScript().logger
logger.info("init() is called.")

parser = argparse.ArgumentParser(description="Iris model serving")
parser.add_argument('--model_name', dest="model_name", required=True)
args, unknown_args = parser.parse_known_args()

model_path = Model.get_model_path(args.model_name)
with open(model_path, 'rb') as model_file:
iris_model = pickle.load(model_file)

def run(input_data):
logger = EntryScript().logger
logger.info("run() is called with: {}.".format(input_data))

# make inference
num_rows, num_cols = input_data.shape
pred = iris_model.predict(input_data).reshape((num_rows, 1))

# cleanup output
result = input_data.drop(input_data.columns[4:], axis=1)
result['variety'] = pred

return result
```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。