FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(automl): expose disable_early_stopping option for create_model by helinwang · Pull Request #9779 · googleapis/google-cloud-python · GitHub

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2106,9 +2106,10 @@ def create_model(
optimization_objective=None,
project=None,
region=None,
model_metadata={},
model_metadata=None,
include_column_spec_names=None,
exclude_column_spec_names=None,
disable_early_stopping=False,
**kwargs
):
"""Create a model. This will train your model on the given dataset.
Expand Down Expand Up @@ -2168,6 +2169,10 @@ def create_model(
exclude_column_spec_names(Optional[str]):
The list of the names of the columns you want to exclude and
not train your model on.
disable_early_stopping(Optional[bool]):
True if disable early stopping. By default, the early stopping
feature is enabled, which means that AutoML Tables might stop
training before the entire training budget has been used.
Returns:
google.api_core.operation.Operation:
An operation future that can be used to check for
Expand All @@ -2180,6 +2185,9 @@ def create_model(
to a retryable error and retry attempts failed.
ValueError: If required parameters are missing.
"""
if model_metadata is None:
model_metadata = {}

if (
train_budget_milli_node_hours is None
or train_budget_milli_node_hours < 1000
Expand Down Expand Up @@ -2212,6 +2220,8 @@ def create_model(
model_metadata["train_budget_milli_node_hours"] = train_budget_milli_node_hours
if optimization_objective is not None:
model_metadata["optimization_objective"] = optimization_objective
if disable_early_stopping:
model_metadata["disable_early_stopping"] = True

dataset_id = dataset_name.rsplit("/", 1)[-1]
columns = [
Expand Down

Back | FazBrowse Home | New Git URL