@@ -2106,9 +2106,10 @@ def create_model(
2106
2106
optimization_objective = None ,
2107
2107
project = None ,
2108
2108
region = None ,
2109
- model_metadata = {} ,
2109
+ model_metadata = None ,
2110
2110
include_column_spec_names = None ,
2111
2111
exclude_column_spec_names = None ,
2112
+ disable_early_stopping = False ,
2112
2113
** kwargs
2113
2114
):
2114
2115
"""Create a model. This will train your model on the given dataset.
@@ -2168,6 +2169,10 @@ def create_model(
2168
2169
exclude_column_spec_names(Optional[str]):
2169
2170
The list of the names of the columns you want to exclude and
2170
2171
not train your model on.
2172
+ disable_early_stopping(Optional[bool]):
2173
+ True if disable early stopping. By default, the early stopping
2174
+ feature is enabled, which means that AutoML Tables might stop
2175
+ training before the entire training budget has been used.
2171
2176
Returns:
2172
2177
google.api_core.operation.Operation:
2173
2178
An operation future that can be used to check for
@@ -2180,6 +2185,9 @@ def create_model(
2180
2185
to a retryable error and retry attempts failed.
2181
2186
ValueError: If required parameters are missing.
2182
2187
"""
2188
+ if model_metadata is None :
2189
+ model_metadata = {}
2190
+
2183
2191
if (
2184
2192
train_budget_milli_node_hours is None
2185
2193
or train_budget_milli_node_hours < 1000
@@ -2212,6 +2220,8 @@ def create_model(
2212
2220
model_metadata ["train_budget_milli_node_hours" ] = train_budget_milli_node_hours
2213
2221
if optimization_objective is not None :
2214
2222
model_metadata ["optimization_objective" ] = optimization_objective
2223
+ if disable_early_stopping :
2224
+ model_metadata ["disable_early_stopping" ] = True
2215
2225
2216
2226
dataset_id = dataset_name .rsplit ("/" , 1 )[- 1 ]
2217
2227
columns = [
0 commit comments