Skip to content

Commit cb0daab

Browse files
authored
Merge pull request #50807 from JakeBjorke/patch-1
Remove indented code block
2 parents 3b36f6b + 527a925 commit cb0daab

File tree

1 file changed

+37
-36
lines changed

1 file changed

+37
-36
lines changed

articles/machine-learning/how-to-configure-auto-train.md

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ Requirements for training data:
7777
The following code examples demonstrate how to store the data in these formats.
7878

7979
* TabularDataset
80+
8081
```python
8182
from azureml.core.dataset import Dataset
8283
from azureml.opendatasets import Diabetes
@@ -88,14 +89,14 @@ The following code examples demonstrate how to store the data in these formats.
8889

8990
* Pandas dataframe
9091

91-
```python
92-
import pandas as pd
93-
from sklearn.model_selection import train_test_split
92+
```python
93+
import pandas as pd
94+
from sklearn.model_selection import train_test_split
9495

95-
df = pd.read_csv("your-local-file.csv")
96-
train_data, test_data = train_test_split(df, test_size=0.1, random_state=42)
97-
label = "label-col-name"
98-
```
96+
df = pd.read_csv("your-local-file.csv")
97+
train_data, test_data = train_test_split(df, test_size=0.1, random_state=42)
98+
label = "label-col-name"
99+
```
99100

100101
## Fetch data for running experiment on remote compute
101102

@@ -125,14 +126,14 @@ Use custom validation dataset if random split is not acceptable, usually time se
125126
## Compute to run experiment
126127

127128
Next determine where the model will be trained. An automated machine learning training experiment can run on the following compute options:
128-
* Your local machine such as a local desktop or laptop – Generally when you have small dataset and you are still in the exploration stage.
129-
* A remote machine in the cloud – [Azure Machine Learning Managed Compute](concept-compute-target.md#amlcompute) is a managed service that enables the ability to train machine learning models on clusters of Azure virtual machines.
129+
* Your local machine such as a local desktop or laptop – Generally when you have small dataset and you are still in the exploration stage.
130+
* A remote machine in the cloud – [Azure Machine Learning Managed Compute](concept-compute-target.md#amlcompute) is a managed service that enables the ability to train machine learning models on clusters of Azure virtual machines.
130131

131-
See this [GitHub site](https://github.com/Azure/MachineLearningNotebooks/tree/master/how-to-use-azureml/automated-machine-learning) for examples of notebooks with local and remote compute targets.
132+
See this [GitHub site](https://github.com/Azure/MachineLearningNotebooks/tree/master/how-to-use-azureml/automated-machine-learning) for examples of notebooks with local and remote compute targets.
132133

133-
* An Azure Databricks cluster in your Azure subscription. You can find more details here - [Setup Azure Databricks cluster for Automated ML](how-to-configure-environment.md#azure-databricks)
134+
* An Azure Databricks cluster in your Azure subscription. You can find more details here - [Setup Azure Databricks cluster for Automated ML](how-to-configure-environment.md#azure-databricks)
134135

135-
See this [GitHub site](https://github.com/Azure/MachineLearningNotebooks/tree/master/how-to-use-azureml/azure-databricks/automl) for examples of notebooks with Azure Databricks.
136+
See this [GitHub site](https://github.com/Azure/MachineLearningNotebooks/tree/master/how-to-use-azureml/azure-databricks/automl) for examples of notebooks with Azure Databricks.
136137

137138
<a name='configure-experiment'></a>
138139

@@ -142,30 +143,30 @@ There are several options that you can use to configure your automated machine l
142143

143144
Some examples include:
144145

145-
1. Classification experiment using AUC weighted as the primary metric with experiment timeout minutes set to 30 minutes and 2 cross-validation folds.
146-
147-
```python
148-
automl_classifier=AutoMLConfig(
149-
task='classification',
150-
primary_metric='AUC_weighted',
151-
experiment_timeout_minutes=30,
152-
blacklist_models=['XGBoostClassifier'],
153-
training_data=train_data,
154-
label_column_name=label,
155-
n_cross_validations=2)
156-
```
157-
2. Below is an example of a regression experiment set to end after 60 minutes with five validation cross folds.
158-
159-
```python
160-
automl_regressor = AutoMLConfig(
161-
task='regression',
162-
experiment_timeout_minutes=60,
163-
whitelist_models=['kNN regressor'],
164-
primary_metric='r2_score',
165-
training_data=train_data,
166-
label_column_name=label,
167-
n_cross_validations=5)
168-
```
146+
1. Classification experiment using AUC weighted as the primary metric with experiment timeout minutes set to 30 minutes and 2 cross-validation folds.
147+
148+
```python
149+
automl_classifier=AutoMLConfig(
150+
task='classification',
151+
primary_metric='AUC_weighted',
152+
experiment_timeout_minutes=30,
153+
blacklist_models=['XGBoostClassifier'],
154+
training_data=train_data,
155+
label_column_name=label,
156+
n_cross_validations=2)
157+
```
158+
2. Below is an example of a regression experiment set to end after 60 minutes with five validation cross folds.
159+
160+
```python
161+
automl_regressor = AutoMLConfig(
162+
task='regression',
163+
experiment_timeout_minutes=60,
164+
whitelist_models=['kNN regressor'],
165+
primary_metric='r2_score',
166+
training_data=train_data,
167+
label_column_name=label,
168+
n_cross_validations=5)
169+
```
169170

170171
The three different `task` parameter values (the third task-type is `forecasting`, and uses a similar algorithm pool as `regression` tasks) determine the list of models to apply. Use the `whitelist` or `blacklist` parameters to further modify iterations with the available models to include or exclude. The list of supported models can be found on [SupportedModels Class](https://docs.microsoft.com/python/api/azureml-train-automl-client/azureml.train.automl.constants.supportedmodels) for ([Classification](https://docs.microsoft.com/python/api/azureml-train-automl-client/azureml.train.automl.constants.supportedmodels.classification), [Forecasting](https://docs.microsoft.com/python/api/azureml-train-automl-client/azureml.train.automl.constants.supportedmodels.forecasting), and [Regression](https://docs.microsoft.com/python/api/azureml-train-automl-client/azureml.train.automl.constants.supportedmodels.regression)).
171172

0 commit comments

Comments
 (0)