<jupyter_start><jupyter_text>Import<jupyter_code>import azureml.core
from azureml.core import Workspace, Dataset, Run, Environment
from azureml.widgets import RunDetails
import pandas as pd

ws = Workspace.from_config()
print(f"Azure ML version: {azureml.core.VERSION}")
print(f"Workspace: {ws.name}")<jupyter_output>Azure ML version: 1.33.0
Workspace: tdp-ml<jupyter_text>Data handling function<jupyter_code>ws.datasets
default_ds = ws.get_default_datastore()

if "diabetes dataset" not in ws.datasets:
    default_ds.upload_files(
        files=["../../data/diabetes.csv","../../data/diabetes.csv"],
        target_path="diabetes_data/",
        overwrite=True,
        show_progress=True,
    )

    tabular_dataset = Data.Tabular.from_delimited_files(path=(default_ds, "diabetes-data/*.csv"))

    try:
        tabular_dataset = tabular_dataset.register(
            workspace=ws,
            name="diabetes dataset",
            description="diabetes data",
            tags={
                "format": "CSV",
            },
            create_new_version=True,
        )
        print("Dataset registered successfully")
    except Exception as e:
        print(e)
else:
    print("Dataset already registered")<jupyter_output>Dataset already registered<jupyter_text>Review run<jupyter_code># load previous run
run = ws.get_run("mslearn-train-diabetes_1629907005_2bd6cb62")

# get run's environment
env = run.get_environment()
ws.environments?
envs = Environment.list(workspace=ws)
for env in envs:
    print(env)
# list envs, excluding AzureML presets
for env in envs:
    if not env.startswith("AzureML"):
        print("Name",env)
        print("packages", envs[env].python.conda_dependencies.serialize_to_string())

# Get logged metrics
metrics = run.get_metrics()
for key in metrics.keys():
        print(key, metrics.get(key))
print('\n')
for file in run.get_file_names():
    print(file)<jupyter_output>Regularization Rate 0.01
Accuracy 0.7893333333333333
AUC 0.8568480296867549
ROC aml://artifactId/ExperimentRun/dcid.mslearn-train-diabetes_1629907005_2bd6cb62/ROC_1629907012.png


ROC_1629907012.png
azureml-logs/60_control_log.txt
azureml-logs/70_driver_log.txt
logs/azureml/8_azureml.log
logs/azureml/dataprep/backgroundProcess.log
logs/azureml/dataprep/backgroundProcess_Telemetry.log
outputs/diabetes_model.pkl
{'fraction_non_alphanumeric': 0.1125913192952299, 'fraction_numerical': 0.04039535883111302, 'mean_word_length': 4.08296943231441, 'pattern_counts': {'":': 1, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '448611', 'license': 'MIT', 'n_tokens_mistral': 856, 'n_tokens_neox': 783, 'n_words': 140, 'path': 'custom/work-with-compute-in-azure-machine-learning/scratchpaper.ipynb', 'repo_name': 'petersontylerd/mslearn-dp100', 'size': '2327'}