Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- lib/python3.12/site-packages/wandb/plot/__init__.py +30 -0
- lib/python3.12/site-packages/wandb/plot/bar.py +71 -0
- lib/python3.12/site-packages/wandb/plot/custom_chart.py +124 -0
- lib/python3.12/site-packages/wandb/plot/line.py +75 -0
- lib/python3.12/site-packages/wandb/plot/pr_curve.py +186 -0
- lib/python3.12/site-packages/wandb/plot/scatter.py +66 -0
- lib/python3.12/site-packages/wandb/plot/utils.py +184 -0
- lib/python3.12/site-packages/wandb/sdk/__pycache__/__init__.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_alerts.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_config.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_helper.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_init.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_login.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_metric.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_require.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_require_helpers.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_settings.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_setup.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_summary.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_sweep.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_sync.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_watch.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/__init__.py +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/__init__.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/_graphql_fragments.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/_internal_artifact.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/_validators.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_download_logger.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_file_cache.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_instance_cache.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_manifest.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_manifest_entry.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_saver.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_state.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_ttl.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/exceptions.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/staging.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/storage_handler.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/storage_layout.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/storage_policy.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__init__.py +300 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/__init__.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/add_aliases.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/artifact_collection_membership_files.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/artifact_version_files.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/create_artifact_collection_tag_assignments.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/delete_aliases.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/delete_artifact_collection_tag_assignments.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/delete_artifact_portfolio.cpython-312.pyc +0 -0
- lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/delete_artifact_sequence.cpython-312.pyc +0 -0
lib/python3.12/site-packages/wandb/plot/__init__.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Chart Visualization Utilities
|
| 2 |
+
|
| 3 |
+
This module offers a collection of predefined chart types, along with functionality
|
| 4 |
+
for creating custom charts, enabling flexible visualization of your data beyond the
|
| 5 |
+
built-in options.
|
| 6 |
+
"""
|
| 7 |
+
|
| 8 |
+
__all__ = [
|
| 9 |
+
"line",
|
| 10 |
+
"histogram",
|
| 11 |
+
"scatter",
|
| 12 |
+
"bar",
|
| 13 |
+
"roc_curve",
|
| 14 |
+
"pr_curve",
|
| 15 |
+
"confusion_matrix",
|
| 16 |
+
"line_series",
|
| 17 |
+
"plot_table",
|
| 18 |
+
"visualize", # doc:exclude
|
| 19 |
+
]
|
| 20 |
+
|
| 21 |
+
from wandb.plot.bar import bar
|
| 22 |
+
from wandb.plot.confusion_matrix import confusion_matrix
|
| 23 |
+
from wandb.plot.custom_chart import CustomChart, plot_table
|
| 24 |
+
from wandb.plot.histogram import histogram
|
| 25 |
+
from wandb.plot.line import line
|
| 26 |
+
from wandb.plot.line_series import line_series
|
| 27 |
+
from wandb.plot.pr_curve import pr_curve
|
| 28 |
+
from wandb.plot.roc_curve import roc_curve
|
| 29 |
+
from wandb.plot.scatter import scatter
|
| 30 |
+
from wandb.plot.viz import Visualize, visualize
|
lib/python3.12/site-packages/wandb/plot/bar.py
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
from typing import TYPE_CHECKING
|
| 4 |
+
|
| 5 |
+
from wandb.plot.custom_chart import plot_table
|
| 6 |
+
|
| 7 |
+
if TYPE_CHECKING:
|
| 8 |
+
import wandb
|
| 9 |
+
from wandb.plot.custom_chart import CustomChart
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def bar(
|
| 13 |
+
table: wandb.Table,
|
| 14 |
+
label: str,
|
| 15 |
+
value: str,
|
| 16 |
+
title: str = "",
|
| 17 |
+
split_table: bool = False,
|
| 18 |
+
) -> CustomChart:
|
| 19 |
+
"""Constructs a bar chart from a wandb.Table of data.
|
| 20 |
+
|
| 21 |
+
Args:
|
| 22 |
+
table: A table containing the data for the bar chart.
|
| 23 |
+
label: The name of the column to use for the labels of each bar.
|
| 24 |
+
value: The name of the column to use for the values of each bar.
|
| 25 |
+
title: The title of the bar chart.
|
| 26 |
+
split_table: Whether the table should be split into a separate section
|
| 27 |
+
in the W&B UI. If `True`, the table will be displayed in a section named
|
| 28 |
+
"Custom Chart Tables". Default is `False`.
|
| 29 |
+
|
| 30 |
+
Returns:
|
| 31 |
+
CustomChart: A custom chart object that can be logged to W&B. To log the
|
| 32 |
+
chart, pass it to `wandb.log()`.
|
| 33 |
+
|
| 34 |
+
Example:
|
| 35 |
+
|
| 36 |
+
```python
|
| 37 |
+
import random
|
| 38 |
+
import wandb
|
| 39 |
+
|
| 40 |
+
# Generate random data for the table
|
| 41 |
+
data = [
|
| 42 |
+
["car", random.uniform(0, 1)],
|
| 43 |
+
["bus", random.uniform(0, 1)],
|
| 44 |
+
["road", random.uniform(0, 1)],
|
| 45 |
+
["person", random.uniform(0, 1)],
|
| 46 |
+
]
|
| 47 |
+
|
| 48 |
+
# Create a table with the data
|
| 49 |
+
table = wandb.Table(data=data, columns=["class", "accuracy"])
|
| 50 |
+
|
| 51 |
+
# Initialize a W&B run and log the bar plot
|
| 52 |
+
with wandb.init(project="bar_chart") as run:
|
| 53 |
+
# Create a bar plot from the table
|
| 54 |
+
bar_plot = wandb.plot.bar(
|
| 55 |
+
table=table,
|
| 56 |
+
label="class",
|
| 57 |
+
value="accuracy",
|
| 58 |
+
title="Object Classification Accuracy",
|
| 59 |
+
)
|
| 60 |
+
|
| 61 |
+
# Log the bar chart to W&B
|
| 62 |
+
run.log({"bar_plot": bar_plot})
|
| 63 |
+
```
|
| 64 |
+
"""
|
| 65 |
+
return plot_table(
|
| 66 |
+
data_table=table,
|
| 67 |
+
vega_spec_name="wandb/bar/v0",
|
| 68 |
+
fields={"label": label, "value": value},
|
| 69 |
+
string_fields={"title": title},
|
| 70 |
+
split_table=split_table,
|
| 71 |
+
)
|
lib/python3.12/site-packages/wandb/plot/custom_chart.py
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
from dataclasses import dataclass
|
| 4 |
+
from typing import Any
|
| 5 |
+
|
| 6 |
+
import wandb
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
@dataclass
|
| 10 |
+
class CustomChartSpec:
|
| 11 |
+
spec_name: str
|
| 12 |
+
fields: dict[str, Any]
|
| 13 |
+
string_fields: dict[str, Any]
|
| 14 |
+
key: str = ""
|
| 15 |
+
panel_type: str = "Vega2"
|
| 16 |
+
split_table: bool = False
|
| 17 |
+
|
| 18 |
+
@property
|
| 19 |
+
def table_key(self) -> str:
|
| 20 |
+
if not self.key:
|
| 21 |
+
raise wandb.Error("Key for the custom chart spec is not set.")
|
| 22 |
+
if self.split_table:
|
| 23 |
+
return f"Custom Chart Tables/{self.key}_table"
|
| 24 |
+
return f"{self.key}_table"
|
| 25 |
+
|
| 26 |
+
@property
|
| 27 |
+
def config_value(self) -> dict[str, Any]:
|
| 28 |
+
return {
|
| 29 |
+
"panel_type": self.panel_type,
|
| 30 |
+
"panel_config": {
|
| 31 |
+
"panelDefId": self.spec_name,
|
| 32 |
+
"fieldSettings": self.fields,
|
| 33 |
+
"stringSettings": self.string_fields,
|
| 34 |
+
"transform": {"name": "tableWithLeafColNames"},
|
| 35 |
+
"userQuery": {
|
| 36 |
+
"queryFields": [
|
| 37 |
+
{
|
| 38 |
+
"name": "runSets",
|
| 39 |
+
"args": [{"name": "runSets", "value": "${runSets}"}],
|
| 40 |
+
"fields": [
|
| 41 |
+
{"name": "id", "fields": []},
|
| 42 |
+
{"name": "name", "fields": []},
|
| 43 |
+
{"name": "_defaultColorIndex", "fields": []},
|
| 44 |
+
{
|
| 45 |
+
"name": "summaryTable",
|
| 46 |
+
"args": [
|
| 47 |
+
{
|
| 48 |
+
"name": "tableKey",
|
| 49 |
+
"value": self.table_key,
|
| 50 |
+
}
|
| 51 |
+
],
|
| 52 |
+
"fields": [],
|
| 53 |
+
},
|
| 54 |
+
],
|
| 55 |
+
}
|
| 56 |
+
],
|
| 57 |
+
},
|
| 58 |
+
},
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
@property
|
| 62 |
+
def config_key(self) -> tuple[str, str, str]:
|
| 63 |
+
return ("_wandb", "visualize", self.key)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
@dataclass
|
| 67 |
+
class CustomChart:
|
| 68 |
+
table: wandb.Table
|
| 69 |
+
spec: CustomChartSpec
|
| 70 |
+
|
| 71 |
+
def set_key(self, key: str):
|
| 72 |
+
"""Sets the key for the spec and updates dependent configurations."""
|
| 73 |
+
self.spec.key = key
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
def plot_table(
|
| 77 |
+
vega_spec_name: str,
|
| 78 |
+
data_table: wandb.Table,
|
| 79 |
+
fields: dict[str, Any],
|
| 80 |
+
string_fields: dict[str, Any] | None = None,
|
| 81 |
+
split_table: bool = False,
|
| 82 |
+
) -> CustomChart:
|
| 83 |
+
"""Creates a custom charts using a Vega-Lite specification and a `wandb.Table`.
|
| 84 |
+
|
| 85 |
+
This function creates a custom chart based on a Vega-Lite specification and
|
| 86 |
+
a data table represented by a `wandb.Table` object. The specification needs
|
| 87 |
+
to be predefined and stored in the W&B backend. The function returns a custom
|
| 88 |
+
chart object that can be logged to W&B using `wandb.log()`.
|
| 89 |
+
|
| 90 |
+
Args:
|
| 91 |
+
vega_spec_name (str): The name or identifier of the Vega-Lite spec
|
| 92 |
+
that defines the visualization structure.
|
| 93 |
+
data_table (wandb.Table): A `wandb.Table` object containing the data to be
|
| 94 |
+
visualized.
|
| 95 |
+
fields (dict[str, Any]): A mapping between the fields in the Vega-Lite spec and the
|
| 96 |
+
corresponding columns in the data table to be visualized.
|
| 97 |
+
string_fields (dict[str, Any] | None): A dictionary for providing values for any string constants
|
| 98 |
+
required by the custom visualization.
|
| 99 |
+
split_table (bool): Whether the table should be split into a separate section
|
| 100 |
+
in the W&B UI. If `True`, the table will be displayed in a section named
|
| 101 |
+
"Custom Chart Tables". Default is `False`.
|
| 102 |
+
|
| 103 |
+
Returns:
|
| 104 |
+
CustomChart: A custom chart object that can be logged to W&B. To log the
|
| 105 |
+
chart, pass it to `wandb.log()`.
|
| 106 |
+
|
| 107 |
+
Raises:
|
| 108 |
+
wandb.Error: If `data_table` is not a `wandb.Table` object.
|
| 109 |
+
"""
|
| 110 |
+
|
| 111 |
+
if not isinstance(data_table, wandb.Table):
|
| 112 |
+
raise wandb.Error(
|
| 113 |
+
f"Expected `data_table` to be `wandb.Table` type, instead got {type(data_table).__name__}"
|
| 114 |
+
)
|
| 115 |
+
|
| 116 |
+
return CustomChart(
|
| 117 |
+
table=data_table,
|
| 118 |
+
spec=CustomChartSpec(
|
| 119 |
+
spec_name=vega_spec_name,
|
| 120 |
+
fields=fields,
|
| 121 |
+
string_fields=string_fields or {},
|
| 122 |
+
split_table=split_table,
|
| 123 |
+
),
|
| 124 |
+
)
|
lib/python3.12/site-packages/wandb/plot/line.py
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
from typing import TYPE_CHECKING
|
| 4 |
+
|
| 5 |
+
from wandb.plot.custom_chart import plot_table
|
| 6 |
+
|
| 7 |
+
if TYPE_CHECKING:
|
| 8 |
+
import wandb
|
| 9 |
+
from wandb.plot.custom_chart import CustomChart
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def line(
|
| 13 |
+
table: wandb.Table,
|
| 14 |
+
x: str,
|
| 15 |
+
y: str,
|
| 16 |
+
stroke: str | None = None,
|
| 17 |
+
title: str = "",
|
| 18 |
+
split_table: bool = False,
|
| 19 |
+
) -> CustomChart:
|
| 20 |
+
"""Constructs a customizable line chart.
|
| 21 |
+
|
| 22 |
+
Args:
|
| 23 |
+
table: The table containing data for the chart.
|
| 24 |
+
x: Column name for the x-axis values.
|
| 25 |
+
y: Column name for the y-axis values.
|
| 26 |
+
stroke: Column name to differentiate line strokes (e.g., for
|
| 27 |
+
grouping lines).
|
| 28 |
+
title: Title of the chart.
|
| 29 |
+
split_table: Whether the table should be split into a separate section
|
| 30 |
+
in the W&B UI. If `True`, the table will be displayed in a section named
|
| 31 |
+
"Custom Chart Tables". Default is `False`.
|
| 32 |
+
|
| 33 |
+
Returns:
|
| 34 |
+
CustomChart: A custom chart object that can be logged to W&B. To log the
|
| 35 |
+
chart, pass it to `wandb.log()`.
|
| 36 |
+
|
| 37 |
+
Example:
|
| 38 |
+
|
| 39 |
+
```python
|
| 40 |
+
import math
|
| 41 |
+
import random
|
| 42 |
+
import wandb
|
| 43 |
+
|
| 44 |
+
# Create multiple series of data with different patterns
|
| 45 |
+
data = []
|
| 46 |
+
for i in range(100):
|
| 47 |
+
# Series 1: Sinusoidal pattern with random noise
|
| 48 |
+
data.append([i, math.sin(i / 10) + random.uniform(-0.1, 0.1), "series_1"])
|
| 49 |
+
# Series 2: Cosine pattern with random noise
|
| 50 |
+
data.append([i, math.cos(i / 10) + random.uniform(-0.1, 0.1), "series_2"])
|
| 51 |
+
# Series 3: Linear increase with random noise
|
| 52 |
+
data.append([i, i / 10 + random.uniform(-0.5, 0.5), "series_3"])
|
| 53 |
+
|
| 54 |
+
# Define the columns for the table
|
| 55 |
+
table = wandb.Table(data=data, columns=["step", "value", "series"])
|
| 56 |
+
|
| 57 |
+
# Initialize wandb run and log the line chart
|
| 58 |
+
with wandb.init(project="line_chart_example") as run:
|
| 59 |
+
line_chart = wandb.plot.line(
|
| 60 |
+
table=table,
|
| 61 |
+
x="step",
|
| 62 |
+
y="value",
|
| 63 |
+
stroke="series", # Group by the "series" column
|
| 64 |
+
title="Multi-Series Line Plot",
|
| 65 |
+
)
|
| 66 |
+
run.log({"line-chart": line_chart})
|
| 67 |
+
```
|
| 68 |
+
"""
|
| 69 |
+
return plot_table(
|
| 70 |
+
data_table=table,
|
| 71 |
+
vega_spec_name="wandb/line/v0",
|
| 72 |
+
fields={"x": x, "y": y, "stroke": stroke},
|
| 73 |
+
string_fields={"title": title},
|
| 74 |
+
split_table=split_table,
|
| 75 |
+
)
|
lib/python3.12/site-packages/wandb/plot/pr_curve.py
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
import numbers
|
| 4 |
+
from typing import TYPE_CHECKING, Iterable, TypeVar
|
| 5 |
+
|
| 6 |
+
import wandb
|
| 7 |
+
from wandb import util
|
| 8 |
+
from wandb.plot.custom_chart import plot_table
|
| 9 |
+
from wandb.plot.utils import test_missing, test_types
|
| 10 |
+
|
| 11 |
+
if TYPE_CHECKING:
|
| 12 |
+
from wandb.plot.custom_chart import CustomChart
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
T = TypeVar("T")
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
def pr_curve(
|
| 19 |
+
y_true: Iterable[T] | None = None,
|
| 20 |
+
y_probas: Iterable[numbers.Number] | None = None,
|
| 21 |
+
labels: list[str] | None = None,
|
| 22 |
+
classes_to_plot: list[T] | None = None,
|
| 23 |
+
interp_size: int = 21,
|
| 24 |
+
title: str = "Precision-Recall Curve",
|
| 25 |
+
split_table: bool = False,
|
| 26 |
+
) -> CustomChart:
|
| 27 |
+
"""Constructs a Precision-Recall (PR) curve.
|
| 28 |
+
|
| 29 |
+
The Precision-Recall curve is particularly useful for evaluating classifiers
|
| 30 |
+
on imbalanced datasets. A high area under the PR curve signifies both high
|
| 31 |
+
precision (a low false positive rate) and high recall (a low false negative
|
| 32 |
+
rate). The curve provides insights into the balance between false positives
|
| 33 |
+
and false negatives at various threshold levels, aiding in the assessment of
|
| 34 |
+
a model's performance.
|
| 35 |
+
|
| 36 |
+
Args:
|
| 37 |
+
y_true: True binary labels. The shape should be (`num_samples`,).
|
| 38 |
+
y_probas: Predicted scores or probabilities for each class.
|
| 39 |
+
These can be probability estimates, confidence scores, or non-thresholded
|
| 40 |
+
decision values. The shape should be (`num_samples`, `num_classes`).
|
| 41 |
+
labels: Optional list of class names to replace
|
| 42 |
+
numeric values in `y_true` for easier plot interpretation.
|
| 43 |
+
For example, `labels = ['dog', 'cat', 'owl']` will replace 0 with
|
| 44 |
+
'dog', 1 with 'cat', and 2 with 'owl' in the plot. If not provided,
|
| 45 |
+
numeric values from `y_true` will be used.
|
| 46 |
+
classes_to_plot: Optional list of unique class values from
|
| 47 |
+
y_true to be included in the plot. If not specified, all unique
|
| 48 |
+
classes in y_true will be plotted.
|
| 49 |
+
interp_size: Number of points to interpolate recall values. The
|
| 50 |
+
recall values will be fixed to `interp_size` uniformly distributed
|
| 51 |
+
points in the range [0, 1], and the precision will be interpolated
|
| 52 |
+
accordingly.
|
| 53 |
+
title: Title of the plot. Defaults to "Precision-Recall Curve".
|
| 54 |
+
split_table: Whether the table should be split into a separate section
|
| 55 |
+
in the W&B UI. If `True`, the table will be displayed in a section named
|
| 56 |
+
"Custom Chart Tables". Default is `False`.
|
| 57 |
+
|
| 58 |
+
Returns:
|
| 59 |
+
CustomChart: A custom chart object that can be logged to W&B. To log the
|
| 60 |
+
chart, pass it to `wandb.log()`.
|
| 61 |
+
|
| 62 |
+
Raises:
|
| 63 |
+
wandb.Error: If NumPy, pandas, or scikit-learn is not installed.
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
Example:
|
| 67 |
+
|
| 68 |
+
```python
|
| 69 |
+
import wandb
|
| 70 |
+
|
| 71 |
+
# Example for spam detection (binary classification)
|
| 72 |
+
y_true = [0, 1, 1, 0, 1] # 0 = not spam, 1 = spam
|
| 73 |
+
y_probas = [
|
| 74 |
+
[0.9, 0.1], # Predicted probabilities for the first sample (not spam)
|
| 75 |
+
[0.2, 0.8], # Second sample (spam), and so on
|
| 76 |
+
[0.1, 0.9],
|
| 77 |
+
[0.8, 0.2],
|
| 78 |
+
[0.3, 0.7],
|
| 79 |
+
]
|
| 80 |
+
|
| 81 |
+
labels = ["not spam", "spam"] # Optional class names for readability
|
| 82 |
+
|
| 83 |
+
with wandb.init(project="spam-detection") as run:
|
| 84 |
+
pr_curve = wandb.plot.pr_curve(
|
| 85 |
+
y_true=y_true,
|
| 86 |
+
y_probas=y_probas,
|
| 87 |
+
labels=labels,
|
| 88 |
+
title="Precision-Recall Curve for Spam Detection",
|
| 89 |
+
)
|
| 90 |
+
run.log({"pr-curve": pr_curve})
|
| 91 |
+
```
|
| 92 |
+
"""
|
| 93 |
+
np = util.get_module(
|
| 94 |
+
"numpy",
|
| 95 |
+
required="roc requires the numpy library, install with `pip install numpy`",
|
| 96 |
+
)
|
| 97 |
+
pd = util.get_module(
|
| 98 |
+
"pandas",
|
| 99 |
+
required="roc requires the pandas library, install with `pip install pandas`",
|
| 100 |
+
)
|
| 101 |
+
sklearn_metrics = util.get_module(
|
| 102 |
+
"sklearn.metrics",
|
| 103 |
+
"roc requires the scikit library, install with `pip install scikit-learn`",
|
| 104 |
+
)
|
| 105 |
+
sklearn_utils = util.get_module(
|
| 106 |
+
"sklearn.utils",
|
| 107 |
+
"roc requires the scikit library, install with `pip install scikit-learn`",
|
| 108 |
+
)
|
| 109 |
+
|
| 110 |
+
def _step(x):
|
| 111 |
+
y = np.array(x)
|
| 112 |
+
for i in range(1, len(y)):
|
| 113 |
+
y[i] = max(y[i], y[i - 1])
|
| 114 |
+
return y
|
| 115 |
+
|
| 116 |
+
y_true = np.array(y_true)
|
| 117 |
+
y_probas = np.array(y_probas)
|
| 118 |
+
|
| 119 |
+
if not test_missing(y_true=y_true, y_probas=y_probas):
|
| 120 |
+
return
|
| 121 |
+
if not test_types(y_true=y_true, y_probas=y_probas):
|
| 122 |
+
return
|
| 123 |
+
|
| 124 |
+
classes = np.unique(y_true)
|
| 125 |
+
if classes_to_plot is None:
|
| 126 |
+
classes_to_plot = classes
|
| 127 |
+
|
| 128 |
+
precision = {}
|
| 129 |
+
interp_recall = np.linspace(0, 1, interp_size)[::-1]
|
| 130 |
+
indices_to_plot = np.where(np.isin(classes, classes_to_plot))[0]
|
| 131 |
+
for i in indices_to_plot:
|
| 132 |
+
if labels is not None and (
|
| 133 |
+
isinstance(classes[i], int) or isinstance(classes[0], np.integer)
|
| 134 |
+
):
|
| 135 |
+
class_label = labels[classes[i]]
|
| 136 |
+
else:
|
| 137 |
+
class_label = classes[i]
|
| 138 |
+
|
| 139 |
+
cur_precision, cur_recall, _ = sklearn_metrics.precision_recall_curve(
|
| 140 |
+
y_true, y_probas[:, i], pos_label=classes[i]
|
| 141 |
+
)
|
| 142 |
+
# smooth the precision (monotonically increasing)
|
| 143 |
+
cur_precision = _step(cur_precision)
|
| 144 |
+
|
| 145 |
+
# reverse order so that recall in ascending
|
| 146 |
+
cur_precision = cur_precision[::-1]
|
| 147 |
+
cur_recall = cur_recall[::-1]
|
| 148 |
+
indices = np.searchsorted(cur_recall, interp_recall, side="left")
|
| 149 |
+
precision[class_label] = cur_precision[indices]
|
| 150 |
+
|
| 151 |
+
df = pd.DataFrame(
|
| 152 |
+
{
|
| 153 |
+
"class": np.hstack([[k] * len(v) for k, v in precision.items()]),
|
| 154 |
+
"precision": np.hstack(list(precision.values())),
|
| 155 |
+
"recall": np.tile(interp_recall, len(precision)),
|
| 156 |
+
}
|
| 157 |
+
).round(3)
|
| 158 |
+
|
| 159 |
+
if len(df) > wandb.Table.MAX_ROWS:
|
| 160 |
+
wandb.termwarn(
|
| 161 |
+
f"Table has a limit of {wandb.Table.MAX_ROWS} rows. Resampling to fit."
|
| 162 |
+
)
|
| 163 |
+
# different sampling could be applied, possibly to ensure endpoints are kept
|
| 164 |
+
df = sklearn_utils.resample(
|
| 165 |
+
df,
|
| 166 |
+
replace=False,
|
| 167 |
+
n_samples=wandb.Table.MAX_ROWS,
|
| 168 |
+
random_state=42,
|
| 169 |
+
stratify=df["class"],
|
| 170 |
+
).sort_values(["precision", "recall", "class"])
|
| 171 |
+
|
| 172 |
+
return plot_table(
|
| 173 |
+
data_table=wandb.Table(dataframe=df),
|
| 174 |
+
vega_spec_name="wandb/area-under-curve/v0",
|
| 175 |
+
fields={
|
| 176 |
+
"x": "recall",
|
| 177 |
+
"y": "precision",
|
| 178 |
+
"class": "class",
|
| 179 |
+
},
|
| 180 |
+
string_fields={
|
| 181 |
+
"title": title,
|
| 182 |
+
"x-axis-title": "Recall",
|
| 183 |
+
"y-axis-title": "Precision",
|
| 184 |
+
},
|
| 185 |
+
split_table=split_table,
|
| 186 |
+
)
|
lib/python3.12/site-packages/wandb/plot/scatter.py
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
from typing import TYPE_CHECKING
|
| 4 |
+
|
| 5 |
+
from wandb.plot.custom_chart import plot_table
|
| 6 |
+
|
| 7 |
+
if TYPE_CHECKING:
|
| 8 |
+
import wandb
|
| 9 |
+
from wandb.plot.custom_chart import CustomChart
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def scatter(
|
| 13 |
+
table: wandb.Table,
|
| 14 |
+
x: str,
|
| 15 |
+
y: str,
|
| 16 |
+
title: str = "",
|
| 17 |
+
split_table: bool = False,
|
| 18 |
+
) -> CustomChart:
|
| 19 |
+
"""Constructs a scatter plot from a wandb.Table of data.
|
| 20 |
+
|
| 21 |
+
Args:
|
| 22 |
+
table: The W&B Table containing the data to visualize.
|
| 23 |
+
x: The name of the column used for the x-axis.
|
| 24 |
+
y: The name of the column used for the y-axis.
|
| 25 |
+
title: The title of the scatter chart.
|
| 26 |
+
split_table: Whether the table should be split into a separate section
|
| 27 |
+
in the W&B UI. If `True`, the table will be displayed in a section named
|
| 28 |
+
"Custom Chart Tables". Default is `False`.
|
| 29 |
+
|
| 30 |
+
Returns:
|
| 31 |
+
CustomChart: A custom chart object that can be logged to W&B. To log the
|
| 32 |
+
chart, pass it to `wandb.log()`.
|
| 33 |
+
Example:
|
| 34 |
+
```python
|
| 35 |
+
import math
|
| 36 |
+
import random
|
| 37 |
+
import wandb
|
| 38 |
+
|
| 39 |
+
# Simulate temperature variations at different altitudes over time
|
| 40 |
+
data = [
|
| 41 |
+
[i, random.uniform(-10, 20) - 0.005 * i + 5 * math.sin(i / 50)]
|
| 42 |
+
for i in range(300)
|
| 43 |
+
]
|
| 44 |
+
|
| 45 |
+
# Create W&B table with altitude (m) and temperature (°C) columns
|
| 46 |
+
table = wandb.Table(data=data, columns=["altitude (m)", "temperature (°C)"])
|
| 47 |
+
|
| 48 |
+
# Initialize W&B run and log the scatter plot
|
| 49 |
+
with wandb.init(project="temperature-altitude-scatter") as run:
|
| 50 |
+
# Create and log the scatter plot
|
| 51 |
+
scatter_plot = wandb.plot.scatter(
|
| 52 |
+
table=table,
|
| 53 |
+
x="altitude (m)",
|
| 54 |
+
y="temperature (°C)",
|
| 55 |
+
title="Altitude vs Temperature",
|
| 56 |
+
)
|
| 57 |
+
run.log({"altitude-temperature-scatter": scatter_plot})
|
| 58 |
+
```
|
| 59 |
+
"""
|
| 60 |
+
return plot_table(
|
| 61 |
+
data_table=table,
|
| 62 |
+
vega_spec_name="wandb/scatter/v0",
|
| 63 |
+
fields={"x": x, "y": y},
|
| 64 |
+
string_fields={"title": title},
|
| 65 |
+
split_table=split_table,
|
| 66 |
+
)
|
lib/python3.12/site-packages/wandb/plot/utils.py
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Iterable, Sequence
|
| 2 |
+
|
| 3 |
+
import wandb
|
| 4 |
+
from wandb import util
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
def test_missing(**kwargs):
|
| 8 |
+
np = util.get_module("numpy", required="Logging plots requires numpy")
|
| 9 |
+
pd = util.get_module("pandas", required="Logging dataframes requires pandas")
|
| 10 |
+
scipy = util.get_module("scipy", required="Logging scipy matrices requires scipy")
|
| 11 |
+
|
| 12 |
+
test_passed = True
|
| 13 |
+
for k, v in kwargs.items():
|
| 14 |
+
# Missing/empty params/datapoint arrays
|
| 15 |
+
if v is None:
|
| 16 |
+
wandb.termerror(f"{k} is None. Please try again.")
|
| 17 |
+
test_passed = False
|
| 18 |
+
if (k == "X") or (k == "X_test"):
|
| 19 |
+
if isinstance(v, scipy.sparse.csr.csr_matrix):
|
| 20 |
+
v = v.toarray()
|
| 21 |
+
elif isinstance(v, (pd.DataFrame, pd.Series)):
|
| 22 |
+
v = v.to_numpy()
|
| 23 |
+
elif isinstance(v, list):
|
| 24 |
+
v = np.asarray(v)
|
| 25 |
+
|
| 26 |
+
# Warn the user about missing values
|
| 27 |
+
missing = 0
|
| 28 |
+
missing = np.count_nonzero(pd.isnull(v))
|
| 29 |
+
if missing > 0:
|
| 30 |
+
wandb.termwarn("%s contains %d missing values. " % (k, missing))
|
| 31 |
+
test_passed = False
|
| 32 |
+
# Ensure the dataset contains only integers
|
| 33 |
+
non_nums = 0
|
| 34 |
+
if v.ndim == 1:
|
| 35 |
+
non_nums = sum(
|
| 36 |
+
1
|
| 37 |
+
for val in v
|
| 38 |
+
if (
|
| 39 |
+
not isinstance(val, (int, float, complex))
|
| 40 |
+
and not isinstance(val, np.number)
|
| 41 |
+
)
|
| 42 |
+
)
|
| 43 |
+
else:
|
| 44 |
+
non_nums = sum(
|
| 45 |
+
1
|
| 46 |
+
for sl in v
|
| 47 |
+
for val in sl
|
| 48 |
+
if (
|
| 49 |
+
not isinstance(val, (int, float, complex))
|
| 50 |
+
and not isinstance(val, np.number)
|
| 51 |
+
)
|
| 52 |
+
)
|
| 53 |
+
if non_nums > 0:
|
| 54 |
+
wandb.termerror(
|
| 55 |
+
f"{k} contains values that are not numbers. Please vectorize, "
|
| 56 |
+
f"label encode or one hot encode {k} and call the plotting function again."
|
| 57 |
+
)
|
| 58 |
+
test_passed = False
|
| 59 |
+
return test_passed
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
def test_fitted(model):
|
| 63 |
+
np = util.get_module("numpy", required="Logging plots requires numpy")
|
| 64 |
+
_ = util.get_module("pandas", required="Logging dataframes requires pandas")
|
| 65 |
+
_ = util.get_module("scipy", required="Logging scipy matrices requires scipy")
|
| 66 |
+
scikit_utils = util.get_module(
|
| 67 |
+
"sklearn.utils",
|
| 68 |
+
required="roc requires the scikit utils submodule, install with `pip install scikit-learn`",
|
| 69 |
+
)
|
| 70 |
+
scikit_exceptions = util.get_module(
|
| 71 |
+
"sklearn.exceptions",
|
| 72 |
+
"roc requires the scikit preprocessing submodule, install with `pip install scikit-learn`",
|
| 73 |
+
)
|
| 74 |
+
|
| 75 |
+
try:
|
| 76 |
+
model.predict(np.zeros((7, 3)))
|
| 77 |
+
except scikit_exceptions.NotFittedError:
|
| 78 |
+
wandb.termerror("Please fit the model before passing it in.")
|
| 79 |
+
return False
|
| 80 |
+
except AttributeError:
|
| 81 |
+
# Some clustering models (LDA, PCA, Agglomerative) don't implement ``predict``
|
| 82 |
+
try:
|
| 83 |
+
scikit_utils.validation.check_is_fitted(
|
| 84 |
+
model,
|
| 85 |
+
[
|
| 86 |
+
"coef_",
|
| 87 |
+
"estimator_",
|
| 88 |
+
"labels_",
|
| 89 |
+
"n_clusters_",
|
| 90 |
+
"children_",
|
| 91 |
+
"components_",
|
| 92 |
+
"n_components_",
|
| 93 |
+
"n_iter_",
|
| 94 |
+
"n_batch_iter_",
|
| 95 |
+
"explained_variance_",
|
| 96 |
+
"singular_values_",
|
| 97 |
+
"mean_",
|
| 98 |
+
],
|
| 99 |
+
all_or_any=any,
|
| 100 |
+
)
|
| 101 |
+
except scikit_exceptions.NotFittedError:
|
| 102 |
+
wandb.termerror("Please fit the model before passing it in.")
|
| 103 |
+
return False
|
| 104 |
+
else:
|
| 105 |
+
return True
|
| 106 |
+
except Exception:
|
| 107 |
+
# Assume it's fitted, since ``NotFittedError`` wasn't raised
|
| 108 |
+
return True
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
def encode_labels(df):
|
| 112 |
+
_ = util.get_module("pandas", required="Logging dataframes requires pandas")
|
| 113 |
+
preprocessing = util.get_module(
|
| 114 |
+
"sklearn.preprocessing",
|
| 115 |
+
"roc requires the scikit preprocessing submodule, install with `pip install scikit-learn`",
|
| 116 |
+
)
|
| 117 |
+
|
| 118 |
+
le = preprocessing.LabelEncoder()
|
| 119 |
+
# apply le on categorical feature columns
|
| 120 |
+
categorical_cols = df.select_dtypes(
|
| 121 |
+
exclude=["int", "float", "float64", "float32", "int32", "int64"]
|
| 122 |
+
).columns
|
| 123 |
+
df[categorical_cols] = df[categorical_cols].apply(lambda col: le.fit_transform(col))
|
| 124 |
+
|
| 125 |
+
|
| 126 |
+
def test_types(**kwargs):
|
| 127 |
+
np = util.get_module("numpy", required="Logging plots requires numpy")
|
| 128 |
+
pd = util.get_module("pandas", required="Logging dataframes requires pandas")
|
| 129 |
+
_ = util.get_module("scipy", required="Logging scipy matrices requires scipy")
|
| 130 |
+
|
| 131 |
+
base = util.get_module(
|
| 132 |
+
"sklearn.base",
|
| 133 |
+
"roc requires the scikit base submodule, install with `pip install scikit-learn`",
|
| 134 |
+
)
|
| 135 |
+
|
| 136 |
+
test_passed = True
|
| 137 |
+
for k, v in kwargs.items():
|
| 138 |
+
# check for incorrect types
|
| 139 |
+
if (
|
| 140 |
+
(k == "X")
|
| 141 |
+
or (k == "X_test")
|
| 142 |
+
or (k == "y")
|
| 143 |
+
or (k == "y_test")
|
| 144 |
+
or (k == "y_true")
|
| 145 |
+
or (k == "y_probas")
|
| 146 |
+
or (k == "x_labels")
|
| 147 |
+
or (k == "y_labels")
|
| 148 |
+
or (k == "matrix_values")
|
| 149 |
+
):
|
| 150 |
+
# FIXME: do this individually
|
| 151 |
+
if not isinstance(
|
| 152 |
+
v,
|
| 153 |
+
(
|
| 154 |
+
Sequence,
|
| 155 |
+
Iterable,
|
| 156 |
+
np.ndarray,
|
| 157 |
+
np.generic,
|
| 158 |
+
pd.DataFrame,
|
| 159 |
+
pd.Series,
|
| 160 |
+
list,
|
| 161 |
+
),
|
| 162 |
+
):
|
| 163 |
+
wandb.termerror(f"{k} is not an array. Please try again.")
|
| 164 |
+
test_passed = False
|
| 165 |
+
# check for classifier types
|
| 166 |
+
if k == "model":
|
| 167 |
+
if (not base.is_classifier(v)) and (not base.is_regressor(v)):
|
| 168 |
+
wandb.termerror(
|
| 169 |
+
f"{k} is not a classifier or regressor. Please try again."
|
| 170 |
+
)
|
| 171 |
+
test_passed = False
|
| 172 |
+
elif k == "clf" or k == "binary_clf":
|
| 173 |
+
if not (base.is_classifier(v)):
|
| 174 |
+
wandb.termerror(f"{k} is not a classifier. Please try again.")
|
| 175 |
+
test_passed = False
|
| 176 |
+
elif k == "regressor":
|
| 177 |
+
if not base.is_regressor(v):
|
| 178 |
+
wandb.termerror(f"{k} is not a regressor. Please try again.")
|
| 179 |
+
test_passed = False
|
| 180 |
+
elif k == "clusterer":
|
| 181 |
+
if not (getattr(v, "_estimator_type", None) == "clusterer"):
|
| 182 |
+
wandb.termerror(f"{k} is not a clusterer. Please try again.")
|
| 183 |
+
test_passed = False
|
| 184 |
+
return test_passed
|
lib/python3.12/site-packages/wandb/sdk/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (1.04 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_alerts.cpython-312.pyc
ADDED
|
Binary file (472 Bytes). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_config.cpython-312.pyc
ADDED
|
Binary file (15.9 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_helper.cpython-312.pyc
ADDED
|
Binary file (2.37 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_init.cpython-312.pyc
ADDED
|
Binary file (73.8 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_login.cpython-312.pyc
ADDED
|
Binary file (13.9 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_metric.cpython-312.pyc
ADDED
|
Binary file (5.19 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_require.cpython-312.pyc
ADDED
|
Binary file (3.59 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_require_helpers.cpython-312.pyc
ADDED
|
Binary file (2.67 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_settings.cpython-312.pyc
ADDED
|
Binary file (61.9 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_setup.cpython-312.pyc
ADDED
|
Binary file (21.2 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_summary.cpython-312.pyc
ADDED
|
Binary file (7.49 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_sweep.cpython-312.pyc
ADDED
|
Binary file (4.9 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_sync.cpython-312.pyc
ADDED
|
Binary file (3.46 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_watch.cpython-312.pyc
ADDED
|
Binary file (5.56 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/__init__.py
ADDED
|
File without changes
|
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (198 Bytes). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/_graphql_fragments.cpython-312.pyc
ADDED
|
Binary file (3.13 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/_internal_artifact.cpython-312.pyc
ADDED
|
Binary file (2.22 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/_validators.cpython-312.pyc
ADDED
|
Binary file (13.6 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_download_logger.cpython-312.pyc
ADDED
|
Binary file (2.52 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_file_cache.cpython-312.pyc
ADDED
|
Binary file (12.3 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_instance_cache.cpython-312.pyc
ADDED
|
Binary file (730 Bytes). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_manifest.cpython-312.pyc
ADDED
|
Binary file (4.42 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_manifest_entry.cpython-312.pyc
ADDED
|
Binary file (11.7 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_saver.cpython-312.pyc
ADDED
|
Binary file (10.2 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_state.cpython-312.pyc
ADDED
|
Binary file (637 Bytes). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_ttl.cpython-312.pyc
ADDED
|
Binary file (516 Bytes). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/exceptions.cpython-312.pyc
ADDED
|
Binary file (3.7 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/staging.cpython-312.pyc
ADDED
|
Binary file (1.61 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/storage_handler.cpython-312.pyc
ADDED
|
Binary file (2.57 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/storage_layout.cpython-312.pyc
ADDED
|
Binary file (497 Bytes). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/storage_policy.cpython-312.pyc
ADDED
|
Binary file (3.61 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__init__.py
ADDED
|
@@ -0,0 +1,300 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated by ariadne-codegen
|
| 2 |
+
|
| 3 |
+
from .add_aliases import AddAliases, AddAliasesAddAliases
|
| 4 |
+
from .artifact_collection_membership_files import (
|
| 5 |
+
ArtifactCollectionMembershipFiles,
|
| 6 |
+
ArtifactCollectionMembershipFilesProject,
|
| 7 |
+
ArtifactCollectionMembershipFilesProjectArtifactCollection,
|
| 8 |
+
ArtifactCollectionMembershipFilesProjectArtifactCollectionArtifactMembership,
|
| 9 |
+
)
|
| 10 |
+
from .artifact_version_files import (
|
| 11 |
+
ArtifactVersionFiles,
|
| 12 |
+
ArtifactVersionFilesProject,
|
| 13 |
+
ArtifactVersionFilesProjectArtifactType,
|
| 14 |
+
ArtifactVersionFilesProjectArtifactTypeArtifact,
|
| 15 |
+
)
|
| 16 |
+
from .create_artifact_collection_tag_assignments import (
|
| 17 |
+
CreateArtifactCollectionTagAssignments,
|
| 18 |
+
CreateArtifactCollectionTagAssignmentsCreateArtifactCollectionTagAssignments,
|
| 19 |
+
CreateArtifactCollectionTagAssignmentsCreateArtifactCollectionTagAssignmentsTags,
|
| 20 |
+
)
|
| 21 |
+
from .delete_aliases import DeleteAliases, DeleteAliasesDeleteAliases
|
| 22 |
+
from .delete_artifact_collection_tag_assignments import (
|
| 23 |
+
DeleteArtifactCollectionTagAssignments,
|
| 24 |
+
DeleteArtifactCollectionTagAssignmentsDeleteArtifactCollectionTagAssignments,
|
| 25 |
+
)
|
| 26 |
+
from .delete_artifact_portfolio import (
|
| 27 |
+
DeleteArtifactPortfolio,
|
| 28 |
+
DeleteArtifactPortfolioDeleteArtifactPortfolio,
|
| 29 |
+
DeleteArtifactPortfolioDeleteArtifactPortfolioArtifactCollection,
|
| 30 |
+
)
|
| 31 |
+
from .delete_artifact_sequence import (
|
| 32 |
+
DeleteArtifactSequence,
|
| 33 |
+
DeleteArtifactSequenceDeleteArtifactSequence,
|
| 34 |
+
DeleteArtifactSequenceDeleteArtifactSequenceArtifactCollection,
|
| 35 |
+
)
|
| 36 |
+
from .enums import ArtifactCollectionState, ArtifactState
|
| 37 |
+
from .fetch_linked_artifacts import (
|
| 38 |
+
FetchLinkedArtifacts,
|
| 39 |
+
FetchLinkedArtifactsArtifact,
|
| 40 |
+
FetchLinkedArtifactsArtifactArtifactMemberships,
|
| 41 |
+
FetchLinkedArtifactsArtifactArtifactMembershipsEdges,
|
| 42 |
+
FetchLinkedArtifactsArtifactArtifactMembershipsEdgesNode,
|
| 43 |
+
FetchLinkedArtifactsArtifactArtifactMembershipsEdgesNodeAliases,
|
| 44 |
+
FetchLinkedArtifactsArtifactArtifactMembershipsEdgesNodeArtifactCollection,
|
| 45 |
+
FetchLinkedArtifactsArtifactArtifactMembershipsEdgesNodeArtifactCollectionProject,
|
| 46 |
+
)
|
| 47 |
+
from .fragments import (
|
| 48 |
+
ArtifactCollectionsFragment,
|
| 49 |
+
ArtifactCollectionsFragmentEdges,
|
| 50 |
+
ArtifactCollectionsFragmentEdgesNode,
|
| 51 |
+
ArtifactCollectionsFragmentPageInfo,
|
| 52 |
+
ArtifactFragment,
|
| 53 |
+
ArtifactFragmentAliases,
|
| 54 |
+
ArtifactFragmentAliasesArtifactCollection,
|
| 55 |
+
ArtifactFragmentAliasesArtifactCollectionProject,
|
| 56 |
+
ArtifactFragmentArtifactSequence,
|
| 57 |
+
ArtifactFragmentArtifactSequenceProject,
|
| 58 |
+
ArtifactFragmentArtifactType,
|
| 59 |
+
ArtifactFragmentCurrentManifest,
|
| 60 |
+
ArtifactFragmentCurrentManifestFile,
|
| 61 |
+
ArtifactFragmentTags,
|
| 62 |
+
ArtifactPortfolioTypeFields,
|
| 63 |
+
ArtifactSequenceTypeFields,
|
| 64 |
+
ArtifactsFragment,
|
| 65 |
+
ArtifactsFragmentEdges,
|
| 66 |
+
ArtifactsFragmentPageInfo,
|
| 67 |
+
ArtifactTypeFragment,
|
| 68 |
+
ArtifactTypesFragment,
|
| 69 |
+
ArtifactTypesFragmentEdges,
|
| 70 |
+
ArtifactTypesFragmentPageInfo,
|
| 71 |
+
FilesFragment,
|
| 72 |
+
FilesFragmentEdges,
|
| 73 |
+
FilesFragmentEdgesNode,
|
| 74 |
+
FilesFragmentPageInfo,
|
| 75 |
+
)
|
| 76 |
+
from .input_types import (
|
| 77 |
+
ArtifactAliasInput,
|
| 78 |
+
ArtifactCollectionAliasInput,
|
| 79 |
+
LinkArtifactInput,
|
| 80 |
+
TagInput,
|
| 81 |
+
)
|
| 82 |
+
from .link_artifact import LinkArtifact, LinkArtifactLinkArtifact
|
| 83 |
+
from .move_artifact_collection import (
|
| 84 |
+
MoveArtifactCollection,
|
| 85 |
+
MoveArtifactCollectionMoveArtifactSequence,
|
| 86 |
+
MoveArtifactCollectionMoveArtifactSequenceArtifactCollection,
|
| 87 |
+
)
|
| 88 |
+
from .operations import (
|
| 89 |
+
ADD_ALIASES_GQL,
|
| 90 |
+
ARTIFACT_COLLECTION_MEMBERSHIP_FILES_GQL,
|
| 91 |
+
ARTIFACT_VERSION_FILES_GQL,
|
| 92 |
+
CREATE_ARTIFACT_COLLECTION_TAG_ASSIGNMENTS_GQL,
|
| 93 |
+
DELETE_ALIASES_GQL,
|
| 94 |
+
DELETE_ARTIFACT_COLLECTION_TAG_ASSIGNMENTS_GQL,
|
| 95 |
+
DELETE_ARTIFACT_PORTFOLIO_GQL,
|
| 96 |
+
DELETE_ARTIFACT_SEQUENCE_GQL,
|
| 97 |
+
FETCH_LINKED_ARTIFACTS_GQL,
|
| 98 |
+
LINK_ARTIFACT_GQL,
|
| 99 |
+
MOVE_ARTIFACT_COLLECTION_GQL,
|
| 100 |
+
PROJECT_ARTIFACT_COLLECTION_GQL,
|
| 101 |
+
PROJECT_ARTIFACT_COLLECTIONS_GQL,
|
| 102 |
+
PROJECT_ARTIFACT_TYPE_GQL,
|
| 103 |
+
PROJECT_ARTIFACT_TYPES_GQL,
|
| 104 |
+
PROJECT_ARTIFACTS_GQL,
|
| 105 |
+
RUN_INPUT_ARTIFACTS_GQL,
|
| 106 |
+
RUN_OUTPUT_ARTIFACTS_GQL,
|
| 107 |
+
UPDATE_ARTIFACT_GQL,
|
| 108 |
+
UPDATE_ARTIFACT_PORTFOLIO_GQL,
|
| 109 |
+
UPDATE_ARTIFACT_SEQUENCE_GQL,
|
| 110 |
+
)
|
| 111 |
+
from .project_artifact_collection import (
|
| 112 |
+
ProjectArtifactCollection,
|
| 113 |
+
ProjectArtifactCollectionProject,
|
| 114 |
+
ProjectArtifactCollectionProjectArtifactType,
|
| 115 |
+
ProjectArtifactCollectionProjectArtifactTypeArtifactCollection,
|
| 116 |
+
ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionAliases,
|
| 117 |
+
ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionAliasesEdges,
|
| 118 |
+
ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionAliasesEdgesNode,
|
| 119 |
+
ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionAliasesPageInfo,
|
| 120 |
+
ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionTags,
|
| 121 |
+
ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionTagsEdges,
|
| 122 |
+
ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionTagsEdgesNode,
|
| 123 |
+
ProjectArtifactCollectionProjectArtifactTypeArtifactSequence,
|
| 124 |
+
)
|
| 125 |
+
from .project_artifact_collections import (
|
| 126 |
+
ProjectArtifactCollections,
|
| 127 |
+
ProjectArtifactCollectionsProject,
|
| 128 |
+
ProjectArtifactCollectionsProjectArtifactType,
|
| 129 |
+
)
|
| 130 |
+
from .project_artifact_type import ProjectArtifactType, ProjectArtifactTypeProject
|
| 131 |
+
from .project_artifact_types import ProjectArtifactTypes, ProjectArtifactTypesProject
|
| 132 |
+
from .project_artifacts import (
|
| 133 |
+
ProjectArtifacts,
|
| 134 |
+
ProjectArtifactsProject,
|
| 135 |
+
ProjectArtifactsProjectArtifactType,
|
| 136 |
+
ProjectArtifactsProjectArtifactTypeArtifactCollection,
|
| 137 |
+
)
|
| 138 |
+
from .run_input_artifacts import (
|
| 139 |
+
RunInputArtifacts,
|
| 140 |
+
RunInputArtifactsProject,
|
| 141 |
+
RunInputArtifactsProjectRun,
|
| 142 |
+
RunInputArtifactsProjectRunInputArtifacts,
|
| 143 |
+
RunInputArtifactsProjectRunInputArtifactsEdges,
|
| 144 |
+
RunInputArtifactsProjectRunInputArtifactsPageInfo,
|
| 145 |
+
)
|
| 146 |
+
from .run_output_artifacts import (
|
| 147 |
+
RunOutputArtifacts,
|
| 148 |
+
RunOutputArtifactsProject,
|
| 149 |
+
RunOutputArtifactsProjectRun,
|
| 150 |
+
RunOutputArtifactsProjectRunOutputArtifacts,
|
| 151 |
+
RunOutputArtifactsProjectRunOutputArtifactsEdges,
|
| 152 |
+
RunOutputArtifactsProjectRunOutputArtifactsPageInfo,
|
| 153 |
+
)
|
| 154 |
+
from .update_artifact import UpdateArtifact, UpdateArtifactUpdateArtifact
|
| 155 |
+
from .update_artifact_portfolio import (
|
| 156 |
+
UpdateArtifactPortfolio,
|
| 157 |
+
UpdateArtifactPortfolioUpdateArtifactPortfolio,
|
| 158 |
+
UpdateArtifactPortfolioUpdateArtifactPortfolioArtifactCollection,
|
| 159 |
+
)
|
| 160 |
+
from .update_artifact_sequence import (
|
| 161 |
+
UpdateArtifactSequence,
|
| 162 |
+
UpdateArtifactSequenceUpdateArtifactSequence,
|
| 163 |
+
UpdateArtifactSequenceUpdateArtifactSequenceArtifactCollection,
|
| 164 |
+
)
|
| 165 |
+
|
| 166 |
+
__all__ = [
|
| 167 |
+
"ADD_ALIASES_GQL",
|
| 168 |
+
"ARTIFACT_COLLECTION_MEMBERSHIP_FILES_GQL",
|
| 169 |
+
"ARTIFACT_VERSION_FILES_GQL",
|
| 170 |
+
"CREATE_ARTIFACT_COLLECTION_TAG_ASSIGNMENTS_GQL",
|
| 171 |
+
"DELETE_ALIASES_GQL",
|
| 172 |
+
"DELETE_ARTIFACT_COLLECTION_TAG_ASSIGNMENTS_GQL",
|
| 173 |
+
"DELETE_ARTIFACT_PORTFOLIO_GQL",
|
| 174 |
+
"DELETE_ARTIFACT_SEQUENCE_GQL",
|
| 175 |
+
"FETCH_LINKED_ARTIFACTS_GQL",
|
| 176 |
+
"LINK_ARTIFACT_GQL",
|
| 177 |
+
"MOVE_ARTIFACT_COLLECTION_GQL",
|
| 178 |
+
"PROJECT_ARTIFACTS_GQL",
|
| 179 |
+
"PROJECT_ARTIFACT_COLLECTIONS_GQL",
|
| 180 |
+
"PROJECT_ARTIFACT_COLLECTION_GQL",
|
| 181 |
+
"PROJECT_ARTIFACT_TYPES_GQL",
|
| 182 |
+
"PROJECT_ARTIFACT_TYPE_GQL",
|
| 183 |
+
"RUN_INPUT_ARTIFACTS_GQL",
|
| 184 |
+
"RUN_OUTPUT_ARTIFACTS_GQL",
|
| 185 |
+
"UPDATE_ARTIFACT_GQL",
|
| 186 |
+
"UPDATE_ARTIFACT_PORTFOLIO_GQL",
|
| 187 |
+
"UPDATE_ARTIFACT_SEQUENCE_GQL",
|
| 188 |
+
"DeleteArtifactSequence",
|
| 189 |
+
"DeleteArtifactSequenceDeleteArtifactSequence",
|
| 190 |
+
"DeleteArtifactSequenceDeleteArtifactSequenceArtifactCollection",
|
| 191 |
+
"DeleteArtifactPortfolio",
|
| 192 |
+
"DeleteArtifactPortfolioDeleteArtifactPortfolio",
|
| 193 |
+
"DeleteArtifactPortfolioDeleteArtifactPortfolioArtifactCollection",
|
| 194 |
+
"UpdateArtifactSequence",
|
| 195 |
+
"UpdateArtifactSequenceUpdateArtifactSequence",
|
| 196 |
+
"UpdateArtifactSequenceUpdateArtifactSequenceArtifactCollection",
|
| 197 |
+
"UpdateArtifactPortfolio",
|
| 198 |
+
"UpdateArtifactPortfolioUpdateArtifactPortfolio",
|
| 199 |
+
"UpdateArtifactPortfolioUpdateArtifactPortfolioArtifactCollection",
|
| 200 |
+
"MoveArtifactCollection",
|
| 201 |
+
"MoveArtifactCollectionMoveArtifactSequence",
|
| 202 |
+
"MoveArtifactCollectionMoveArtifactSequenceArtifactCollection",
|
| 203 |
+
"CreateArtifactCollectionTagAssignments",
|
| 204 |
+
"CreateArtifactCollectionTagAssignmentsCreateArtifactCollectionTagAssignments",
|
| 205 |
+
"CreateArtifactCollectionTagAssignmentsCreateArtifactCollectionTagAssignmentsTags",
|
| 206 |
+
"DeleteArtifactCollectionTagAssignments",
|
| 207 |
+
"DeleteArtifactCollectionTagAssignmentsDeleteArtifactCollectionTagAssignments",
|
| 208 |
+
"ProjectArtifactCollections",
|
| 209 |
+
"ProjectArtifactCollectionsProject",
|
| 210 |
+
"ProjectArtifactCollectionsProjectArtifactType",
|
| 211 |
+
"ProjectArtifactCollection",
|
| 212 |
+
"ProjectArtifactCollectionProject",
|
| 213 |
+
"ProjectArtifactCollectionProjectArtifactType",
|
| 214 |
+
"ProjectArtifactCollectionProjectArtifactTypeArtifactCollection",
|
| 215 |
+
"ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionAliases",
|
| 216 |
+
"ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionAliasesEdges",
|
| 217 |
+
"ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionAliasesEdgesNode",
|
| 218 |
+
"ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionAliasesPageInfo",
|
| 219 |
+
"ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionTags",
|
| 220 |
+
"ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionTagsEdges",
|
| 221 |
+
"ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionTagsEdgesNode",
|
| 222 |
+
"ProjectArtifactCollectionProjectArtifactTypeArtifactSequence",
|
| 223 |
+
"ArtifactVersionFiles",
|
| 224 |
+
"ArtifactVersionFilesProject",
|
| 225 |
+
"ArtifactVersionFilesProjectArtifactType",
|
| 226 |
+
"ArtifactVersionFilesProjectArtifactTypeArtifact",
|
| 227 |
+
"ArtifactCollectionMembershipFiles",
|
| 228 |
+
"ArtifactCollectionMembershipFilesProject",
|
| 229 |
+
"ArtifactCollectionMembershipFilesProjectArtifactCollection",
|
| 230 |
+
"ArtifactCollectionMembershipFilesProjectArtifactCollectionArtifactMembership",
|
| 231 |
+
"ProjectArtifactTypes",
|
| 232 |
+
"ProjectArtifactTypesProject",
|
| 233 |
+
"ProjectArtifactType",
|
| 234 |
+
"ProjectArtifactTypeProject",
|
| 235 |
+
"ProjectArtifacts",
|
| 236 |
+
"ProjectArtifactsProject",
|
| 237 |
+
"ProjectArtifactsProjectArtifactType",
|
| 238 |
+
"ProjectArtifactsProjectArtifactTypeArtifactCollection",
|
| 239 |
+
"RunOutputArtifacts",
|
| 240 |
+
"RunOutputArtifactsProject",
|
| 241 |
+
"RunOutputArtifactsProjectRun",
|
| 242 |
+
"RunOutputArtifactsProjectRunOutputArtifacts",
|
| 243 |
+
"RunOutputArtifactsProjectRunOutputArtifactsEdges",
|
| 244 |
+
"RunOutputArtifactsProjectRunOutputArtifactsPageInfo",
|
| 245 |
+
"RunInputArtifacts",
|
| 246 |
+
"RunInputArtifactsProject",
|
| 247 |
+
"RunInputArtifactsProjectRun",
|
| 248 |
+
"RunInputArtifactsProjectRunInputArtifacts",
|
| 249 |
+
"RunInputArtifactsProjectRunInputArtifactsEdges",
|
| 250 |
+
"RunInputArtifactsProjectRunInputArtifactsPageInfo",
|
| 251 |
+
"FetchLinkedArtifacts",
|
| 252 |
+
"FetchLinkedArtifactsArtifact",
|
| 253 |
+
"FetchLinkedArtifactsArtifactArtifactMemberships",
|
| 254 |
+
"FetchLinkedArtifactsArtifactArtifactMembershipsEdges",
|
| 255 |
+
"FetchLinkedArtifactsArtifactArtifactMembershipsEdgesNode",
|
| 256 |
+
"FetchLinkedArtifactsArtifactArtifactMembershipsEdgesNodeAliases",
|
| 257 |
+
"FetchLinkedArtifactsArtifactArtifactMembershipsEdgesNodeArtifactCollection",
|
| 258 |
+
"FetchLinkedArtifactsArtifactArtifactMembershipsEdgesNodeArtifactCollectionProject",
|
| 259 |
+
"AddAliases",
|
| 260 |
+
"AddAliasesAddAliases",
|
| 261 |
+
"DeleteAliases",
|
| 262 |
+
"DeleteAliasesDeleteAliases",
|
| 263 |
+
"UpdateArtifact",
|
| 264 |
+
"UpdateArtifactUpdateArtifact",
|
| 265 |
+
"LinkArtifact",
|
| 266 |
+
"LinkArtifactLinkArtifact",
|
| 267 |
+
"ArtifactAliasInput",
|
| 268 |
+
"ArtifactCollectionAliasInput",
|
| 269 |
+
"LinkArtifactInput",
|
| 270 |
+
"TagInput",
|
| 271 |
+
"ArtifactCollectionsFragment",
|
| 272 |
+
"ArtifactCollectionsFragmentEdges",
|
| 273 |
+
"ArtifactCollectionsFragmentEdgesNode",
|
| 274 |
+
"ArtifactCollectionsFragmentPageInfo",
|
| 275 |
+
"ArtifactFragment",
|
| 276 |
+
"ArtifactFragmentAliases",
|
| 277 |
+
"ArtifactFragmentAliasesArtifactCollection",
|
| 278 |
+
"ArtifactFragmentAliasesArtifactCollectionProject",
|
| 279 |
+
"ArtifactFragmentArtifactSequence",
|
| 280 |
+
"ArtifactFragmentArtifactSequenceProject",
|
| 281 |
+
"ArtifactFragmentArtifactType",
|
| 282 |
+
"ArtifactFragmentCurrentManifest",
|
| 283 |
+
"ArtifactFragmentCurrentManifestFile",
|
| 284 |
+
"ArtifactFragmentTags",
|
| 285 |
+
"ArtifactPortfolioTypeFields",
|
| 286 |
+
"ArtifactSequenceTypeFields",
|
| 287 |
+
"ArtifactTypeFragment",
|
| 288 |
+
"ArtifactTypesFragment",
|
| 289 |
+
"ArtifactTypesFragmentEdges",
|
| 290 |
+
"ArtifactTypesFragmentPageInfo",
|
| 291 |
+
"ArtifactsFragment",
|
| 292 |
+
"ArtifactsFragmentEdges",
|
| 293 |
+
"ArtifactsFragmentPageInfo",
|
| 294 |
+
"FilesFragment",
|
| 295 |
+
"FilesFragmentEdges",
|
| 296 |
+
"FilesFragmentEdgesNode",
|
| 297 |
+
"FilesFragmentPageInfo",
|
| 298 |
+
"ArtifactCollectionState",
|
| 299 |
+
"ArtifactState",
|
| 300 |
+
]
|
lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (8.22 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/add_aliases.cpython-312.pyc
ADDED
|
Binary file (970 Bytes). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/artifact_collection_membership_files.cpython-312.pyc
ADDED
|
Binary file (2.16 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/artifact_version_files.cpython-312.pyc
ADDED
|
Binary file (1.74 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/create_artifact_collection_tag_assignments.cpython-312.pyc
ADDED
|
Binary file (1.75 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/delete_aliases.cpython-312.pyc
ADDED
|
Binary file (994 Bytes). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/delete_artifact_collection_tag_assignments.cpython-312.pyc
ADDED
|
Binary file (1.21 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/delete_artifact_portfolio.cpython-312.pyc
ADDED
|
Binary file (1.67 kB). View file
|
|
|
lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/delete_artifact_sequence.cpython-312.pyc
ADDED
|
Binary file (1.65 kB). View file
|
|
|