Automated ML¶
automatically run all models and provid the scores for each model and also show the best.
models¶
AutoML's forecasting regression models assume that all features provided by the user are known into the future, at least up to the forecast horizon.
rerun failed experiment¶
from azureml.core import Workspace, Experiment
# Load the workspace and experiment objects
workspace = Workspace.from_config()
experiment = Experiment(workspace, "experiment-name')
# Get the failed runs
failed_runs = experiment.get_runs(type='Failed')
# Re-run the experiment
for failed_run in failed_runs:
new_run = failed_run.re_run()
deploy using python¶
https://towardsdatascience.com/how-to-deploy-scikit-learn-models-to-azure-container-instances-a0a59d0d07a1
Setup Training Environment from terminal
get ml ws config
experiment¶
import time
from azureml.core import Workspace, Experiment
automl_settings = {
"name": f'auto_feature_engineering_{time.time()}',
"task": "regression",
"iterations": 10,
"iteration_timeout_minutes": 10,
"max_cores_per_iteration": 1,
"max_concurrent_iterations": 10,
"primary_metric": 'r2_score',
"experiment_exit_score": 0.985,
"debug_log": f'automl_errors{time.time()}.log',
"verbosity": logging.ERROR,
}
# Local compute
automl_config = AutoMLConfig(
preprocess=False,
X=X_train,
y=y_train,
X_valid=X_valid,
y_valid=y_valid,
path=project_folder,
**automl_settings,
)
# Training the model
experiment = Experiment(ws, experiment_name)
local_run = experiment.submit(automl_config, show_output=True)