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

docs: add snippets for visualizing a time series and creating a time series model for the Limit forecasted values in time series model tutorial #1310

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 41 commits into from
Feb 24, 2025
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
9c16442
merge main
rey-esp Jan 14, 2025
fa41486
temp snippet
rey-esp Jan 14, 2025
61cc9b6
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Jan 15, 2025
43f6acf
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Jan 21, 2025
a8d4b5a
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Jan 22, 2025
e92a752
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Jan 22, 2025
5f36534
Merge branch 'b338872698-bigframes-limit-0' of github.com:googleapis/…
rey-esp Jan 22, 2025
c5020ff
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Jan 22, 2025
f0e7f24
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Jan 24, 2025
51c4e5f
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Jan 27, 2025
34bd2e4
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Jan 28, 2025
a976efb
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Jan 29, 2025
3d42261
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Jan 29, 2025
239cdbe
fix typo
rey-esp Jan 29, 2025
82a5a58
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Jan 29, 2025
972abe0
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Jan 29, 2025
d1c57ac
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Jan 30, 2025
31c1e30
Delete demo.ipynb
rey-esp Jan 30, 2025
8138077
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Jan 30, 2025
cec581f
Update samples/snippets/limit_single_timeseries_forecasting_model_tes…
rey-esp Jan 30, 2025
582746d
Update samples/snippets/limit_single_timeseries_forecasting_model_tes…
rey-esp Jan 30, 2025
2293f13
Update samples/snippets/limit_single_timeseries_forecasting_model_tes…
rey-esp Jan 30, 2025
2f533d6
Update samples/snippets/limit_single_timeseries_forecasting_model_tes…
rey-esp Jan 30, 2025
336109f
Update samples/snippets/limit_single_timeseries_forecasting_model_tes…
rey-esp Jan 30, 2025
3a735a3
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Jan 30, 2025
71d20e2
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Feb 6, 2025
2ec31cc
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Feb 10, 2025
7a2c893
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Feb 10, 2025
2417408
add plot line for visualization
rey-esp Feb 10, 2025
f208543
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Feb 10, 2025
b28ee89
Merge branch 'b338872698-bigframes-limit-0' of github.com:googleapis/…
rey-esp Feb 10, 2025
c6870c0
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Feb 11, 2025
f196805
change bar chart to line chart
rey-esp Feb 11, 2025
d3d69f8
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Feb 12, 2025
05484e8
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Feb 13, 2025
90cf6b4
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Feb 14, 2025
a4e746f
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Feb 19, 2025
e913037
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Feb 19, 2025
6a2a4f8
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Feb 20, 2025
395a486
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Feb 20, 2025
62a931a
Merge branch 'main' into b338872698-bigframes-limit-0
rey-esp Feb 24, 2025
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (t
# you may not use this file except in compliance wi
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in
# distributed under the License is distributed on a
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eit
# See the License for the specific language governi
# limitations under the License.


def test_limit_single_timeseries(random_model_id: str) -> None:
your_model_id = random_model_id

# [START bigquery_dataframes_bqml_limit_forecast_visualize]
import bigframes.pandas as bpd

df = bpd.read_gbq("bigquery-public-data.new_york.citibike_trips")

features = bpd.DataFrame(
{
"num_trips": df.starttime,
"date": df["starttime"].dt.date,
}
)
num_trips = features.groupby(["date"]).count()
rey-esp marked this conversation as resolved.
Show resolved Hide resolved

num_trips.plot.line()
# [END bigquery_dataframes_bqml_limit_forecast_visualize]

# [START bigquery_dataframes_bqml_limit_forecast_create]
from bigframes.ml import forecasting
import bigframes.pandas as bpd

df = bpd.read_gbq("bigquery-public-data.new_york.citibike_trips")

features = bpd.DataFrame(
{
"start_station_id": df["start_station_id"],
"num_trips": df.starttime,
"date": df["starttime"].dt.date,
}
)
num_trips = features.groupby(["date", "start_station_id"], as_index=False).count()
model = forecasting.ARIMAPlus()

X = num_trips[["date"]]
y = num_trips[["num_trips"]]
id_col = num_trips[["start_station_id"]]

model.fit(X, y, id_col=id_col)

model.to_gbq(
your_model_id, # For example: "bqml_tutorial.nyc_citibike_arima_model",
replace=True,
)
# [END bigquery_dataframes_bqml_limit_forecast_create]
assert df is not None
assert features is not None
assert num_trips is not None
Morty Proxy This is a proxified and sanitized view of the page, visit original site.