Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix: the imported samples error and use peek() #688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions 6 samples/snippets/imported_onnx_model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_imported_sklearn_onnx_model() -> None:

PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT", "bigframes-dev")

# [START bigquery_dataframes_imported_sklearn_onnx_tutorial_import_tensorflow_models]
# [START bigquery_dataframes_imported_sklearn_onnx_tutorial_import_onnx_models]
import bigframes
from bigframes.ml.imported import ONNXModel

Expand All @@ -31,13 +31,13 @@ def test_imported_sklearn_onnx_model() -> None:
imported_onnx_model = ONNXModel(
model_path="gs://cloud-samples-data/bigquery/ml/onnx/pipeline_rf.onnx"
)
# [END bigquery_dataframes_imported_sklearn_onnx_tutorial_import_tensorflow_models]
# [END bigquery_dataframes_imported_sklearn_onnx_tutorial_import_onnx_models]
assert imported_onnx_model is not None

# [START bigquery_dataframes_imported_sklearn_onnx_tutorial_make_predictions]
import bigframes.pandas as bpd

df = bpd.read_gbq("bigquery-public-data.ml_datasets.iris")
predictions = imported_onnx_model.predict(df)
predictions.head(5)
predictions.peek(5)
# [END bigquery_dataframes_imported_sklearn_onnx_tutorial_make_predictions]
3 changes: 2 additions & 1 deletion 3 samples/snippets/imported_tensorflow_model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def test_imported_tensorflow_model() -> None:
import bigframes.pandas as bpd

df = bpd.read_gbq("bigquery-public-data.hacker_news.full")
predictions = imported_tensorflow_model.predict(df)
df_pred = df.rename(columns={"title": "input"})
predictions = imported_tensorflow_model.predict(df_pred)
predictions.head(5)
ashleyxuu marked this conversation as resolved.
Show resolved Hide resolved
# [END bigquery_dataframes_imported_tensorflow_tutorial_make_predictions]
Morty Proxy This is a proxified and sanitized view of the page, visit original site.