Azure ML Studio 未在模型下显示数据集
Azure ML Studio not showing datasets under models
我在 Azure ML 笔记本中注册了一个模型及其数据集。在 ML Studio 中,我可以看到数据集下列出的模型,但模型下没有列出任何数据集。我应该怎么做才能在模型下列出数据集?
- 数据集下列出的模型:
- 模型下未列出的数据集:
- 笔记本代码:
import pickle
import sys
from azureml.core import Workspace, Dataset, Model
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.utils import assert_all_finite
workspace = Workspace('<snip>', '<snip>', '<snip>')
dataset = Dataset.get_by_name(workspace, name='creditcard')
data = dataset.to_pandas_dataframe()
data.dropna(inplace=True)
X = data.drop(labels=["Class"], axis=1, inplace=False)
y = data["Class"]
model = make_pipeline(StandardScaler(), GradientBoostingClassifier())
model.fit(X, y)
with open('creditfraud_sklearn_model.pkl', 'wb') as outfile:
pickle.dump(model, outfile)
Model.register(
Workspace = workspace,
model_name = 'creditfraud_sklearn_model',
model_path = 'creditfraud_sklearn_model.pkl',
description = 'Gradient Boosting classifier for Kaggle credit-card fraud',
model_framework = Model.Framework.SCIKITLEARN,
model_framework_version = sys.modules['sklearn'].__version__,
sample_input_dataset = dataset,
sample_output_dataset = dataset)
看起来需要调用 add_dataset_references()
才能在模型下显示数据集:
model_registration.add_dataset_references([("input dataset", dataset)])
我在 Azure ML 笔记本中注册了一个模型及其数据集。在 ML Studio 中,我可以看到数据集下列出的模型,但模型下没有列出任何数据集。我应该怎么做才能在模型下列出数据集?
- 数据集下列出的模型:
- 模型下未列出的数据集:
- 笔记本代码:
import pickle
import sys
from azureml.core import Workspace, Dataset, Model
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.utils import assert_all_finite
workspace = Workspace('<snip>', '<snip>', '<snip>')
dataset = Dataset.get_by_name(workspace, name='creditcard')
data = dataset.to_pandas_dataframe()
data.dropna(inplace=True)
X = data.drop(labels=["Class"], axis=1, inplace=False)
y = data["Class"]
model = make_pipeline(StandardScaler(), GradientBoostingClassifier())
model.fit(X, y)
with open('creditfraud_sklearn_model.pkl', 'wb') as outfile:
pickle.dump(model, outfile)
Model.register(
Workspace = workspace,
model_name = 'creditfraud_sklearn_model',
model_path = 'creditfraud_sklearn_model.pkl',
description = 'Gradient Boosting classifier for Kaggle credit-card fraud',
model_framework = Model.Framework.SCIKITLEARN,
model_framework_version = sys.modules['sklearn'].__version__,
sample_input_dataset = dataset,
sample_output_dataset = dataset)
看起来需要调用 add_dataset_references()
才能在模型下显示数据集:
model_registration.add_dataset_references([("input dataset", dataset)])