Dataset
Combines all tables and the task definition into a dataset ready for training.
Parameters
Section titled “Parameters”| Name | Type | Description | Optional |
|---|---|---|---|
connector | SnowflakeConnector | The connector object used for sending requests to the GNN reasoner. | No |
dataset_name | str | A user-defined name for the dataset, which must comply with Snowflake object identifier rules. | No |
tables | list of GNNTable instances | A collection of table objects that constitute the dataset. | No |
task_description | NodeTask or LinkTask | The target task assigned to the GNN | No |
Returns
Section titled “Returns”An instance of the Dataset class.
Example
Section titled “Example”from relationalai_gnns import Dataset
dataset = Dataset( connector=connector, dataset_name="my_first_dataset", tables=[table_with_ckey_1, table_with_ckey_2, table_with_foreign_keys], task_description=node_task)Attributes
Section titled “Attributes”| Name | Description | Type |
|---|---|---|
experiment_name | A dataset is uniquely identified by its experiment name, which is automatically generated in the format dataset_name_task_type_task_name. The experiment name is also visible through the JobMonitor. | str |
metadata_dict | A dictionary describing the dataset’s tables and task. | dict |
Methods
Section titled “Methods”| Name | Description | Returns |
|---|---|---|
visualize_dataset | Generates a visual representation of the dataset schema, encompassing its tables and the defined task. | DatasetDiagram |
print_data_config | Prints in json format a dictionary describing the dataset’s tables and task. | None |
.visualize_dataset()
Section titled “.visualize_dataset()”Generates a visual representation of the dataset schema, encompassing its tables and the defined task.
Parameters
Section titled “Parameters”| Name | Type | Description | Optional |
|---|---|---|---|
show_dtypes | bool | Whether to show the data types of each column. Default is False. | Yes |
Returns
Section titled “Returns”A DatasetDiagram object. Call .display() to render it inline in a Jupyter notebook,
.save("schema.png") to write it to a file, or access .source for the raw Graphviz DOT string.
Rendering requires the Graphviz dot command-line tool to be installed on your system
(brew install graphviz on macOS, apt install graphviz on Linux).
Example
Section titled “Example”# Auto-renders inline when returned from a Jupyter cell:dataset.visualize_dataset()
# Or call display() explicitly:dataset.visualize_dataset().display()
# Save to a file (format inferred from extension):dataset.visualize_dataset().save("schema.svg")import streamlit as st
diagram = dataset.visualize_dataset(show_dtypes=True)st.image(diagram._render("png")).print_data_config()
Section titled “.print_data_config()”Prints in json format a dictionary describing the dataset’s tables and task.
Example
Section titled “Example”dataset.print_data_config()