No project description provided
Project description
Torch Data Bigquery
Torch Dataset
interface for Google BigQuery datasets.
Table of Contents
Installation
pip install torch-data-bigquery
Examples
BigQueryStorageDataset
import torch
from torch_data_bigquery import BigQueryStorageDataset
dataset = BigQueryStorageDataset(
billing_project=PROJECT,
selected_fields=[
"PassengerId",
"Survived",
"Pclass",
],
location=f"bq://your-gcp-project.kaggle_titanic.train",
)
dataloader = torch.utils.data.DataLoader(dataset)
BigQueryDataset
import torch
from torch_data_bigquery import BigQueryDataset
dataset = BigQueryDataset(
billing_project=PROJECT,
query=f"""
SELECT
Survived AS survived, # 1
Pclass AS pclass, # 2
DENSE_RANK() OVER(ORDER by Sex) AS sex, # 3
COALESCE(Age, AVG(Age) OVER()) AS age, # 4
SibSp AS siblings, # 5
Parch AS parents, # 6
Fare AS fare, # 7
DENSE_RANK() OVER(ORDER by Embarked) AS embarked, # 8
FROM `your-gcp-project.kaggle_titanic.train`
""",
)
dataloader = torch.utils.data.DataLoader(dataset)
License
torch-data-bigquery
is distributed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for torch_data_bigquery-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f8fef2fea653bb82843faf2c49a2584505945862a077e73646079234042c526 |
|
MD5 | c07f9b345ae40d320ced41669bb7e6d8 |
|
BLAKE2b-256 | c40039b9057e3b56164923fec11397a97e88760771c01d69c35c5d76114daba7 |
Close
Hashes for torch_data_bigquery-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c830e13280c0879241326cb76d1607588b9c40f9fb77b3124111a18be13757d |
|
MD5 | e902cb57f39b753caf6341b54dfb1f9d |
|
BLAKE2b-256 | 44661e3bc6e3268e91f19fefb58de4682630f14f2cb3558f9cc25d0658d8b95a |