Here is link to the sample for using the environments.
@Ramr-msft
Having solved the above issue, I am now receiving the warning;
"Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies...."
I am using the curated environment, AzureML-sklearn-0.24-ubuntu18.04-py37-cpu which contains the packages;
scikit-learn==0.24.1
numpy>=1.16.0
pandas~=1.1.x
Following is the Notebook code;
from azureml.core import Workspace, Environment
from azureml.core import ScriptRunConfig, Experiment
ws = Workspace.from_config()
myenv = Environment.get(workspace=ws, name="AzureML-sklearn-0.24-ubuntu18.04-py37-cpu")
exp = Experiment(name="myexp", workspace = ws)
# Instantiate environment
myenv = Environment(name="myenv")
# Add training script to run config
runconfig = ScriptRunConfig(source_directory=".", script="train.py")
# Attach compute target to run config
runconfig.run_config.target = "local"
# Attach environment to run config
runconfig.run_config.environment = myenv
# Submit run
run = exp.submit(runconfig)
The train.py script is taken from the example, here https://learn.microsoft.com/en-us/python/api/overview/azure/ml/?view=azure-ml-py#run
------------------------------ train.py script ----------------------------------
# train.py
from sklearn import svm
import numpy as np
import joblib
import os
# customer ages
X_train = np.array([50, 17, 35, 23, 28, 40, 31, 29, 19, 62])
X_train = X_train.reshape(-1, 1)
# churn y/n
y_train = ["yes", "no", "no", "no", "yes", "yes", "yes", "no", "no", "yes"]
clf = svm.SVC(gamma=0.001, C=100.)
clf.fit(X_train, y_train)
os.makedirs("outputs", exist_ok=True)
joblib.dump(value=clf, filename="outputs/churn-model.pkl")
------------------------------ train.py script ----------------------------------
Can you please assist with the above. Why would I receive the error message when the environment being used is a Microsoft curated environment?
Thank you