text: import azureml.core
  from azureml.core import Workspace, Run
  import os
  import shutil
  import pandas as pd
  import numpy as np
  import joblib
  import argparse
  from sklearn.model_selection import train_test_split
  from sklearn.linear_model import LogisticRegression
  from sklearn.metrics import roc_auc_score, roc_curve
  
  
  # add args
  parser = argparse.ArgumentParser()
  parser.add_argument(
          "--reg-rate",
          type=float,
          dest="reg_rate",
          default=0.01,
      )
  args = parser.parse_args()
  
  
  # copy over dataset from source to this folder
  # shutil.copy("../diabetes.csv", "./diabetes.csv")
  dataset = pd.read_csv("./diabetes.csv")
  
  # load workspace
  ws = Workspace.from_config()
  print(f"Azure ML core version: {azureml.core.VERSION}")
  print(f"Azure ML workspace: {ws.name}")
  
  # create run
  run = Run.get_context()
  
  # Separate features and labels
  X = dataset[[
          "Pregnancies",
          "PlasmaGlucose",
          "DiastolicBloodPressure",
          "TricepsThickness",
          "SerumInsulin",
          "BMI",
          "DiabetesPedigree",
          "Age"
      ]].values
  y = dataset["Diabetic"].values
  
  # Split data into training set and test set
  X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.30, random_state=0)
  
  # train model
  run.log("Regularization Rate",  np.float(args.reg_rate))
  model = LogisticRegression(C=1/args.reg_rate, solver="liblinear").fit(X_train, y_train)
  
  # calculate accuracy
  y_hat = model.predict(X_test)
  acc = np.average(y_hat == y_test)
  run.log("Accuracy", np.float(acc))
  
  # calculate AUC
  y_scores = model.predict_proba(X_test)
  auc = roc_auc_score(y_test,y_scores[:,1])
  run.log("AUC", np.float(auc))
  
  # Save the trained model in the outputs folder
  os.makedirs("outputs", exist_ok=True)
  joblib.dump(value=model, filename="outputs/diabetes_model.pkl")
  
  run.complete()