Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- lib/python3.12/site-packages/wandb/plot/__init__.pyAdded+30
- lib/python3.12/site-packages/wandb/plot/bar.pyAdded+71
- lib/python3.12/site-packages/wandb/plot/custom_chart.pyAdded+124
- lib/python3.12/site-packages/wandb/plot/line.pyAdded+75
- lib/python3.12/site-packages/wandb/plot/pr_curve.pyAdded+186
- lib/python3.12/site-packages/wandb/plot/scatter.pyAdded+66
- lib/python3.12/site-packages/wandb/plot/utils.pyAdded+184
- lib/python3.12/site-packages/wandb/sdk/__pycache__/__init__.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_alerts.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_config.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_helper.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_init.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_login.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_metric.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_require.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_require_helpers.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_settings.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_setup.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_summary.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_sweep.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_sync.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_watch.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/__init__.pyAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/__init__.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/_graphql_fragments.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/_internal_artifact.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/_validators.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_download_logger.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_file_cache.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_instance_cache.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_manifest.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_manifest_entry.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_saver.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_state.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_ttl.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/exceptions.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/staging.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/storage_handler.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/storage_layout.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/storage_policy.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__init__.pyAdded+300
- lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/__init__.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/add_aliases.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/artifact_collection_membership_files.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/artifact_version_files.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/create_artifact_collection_tag_assignments.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/delete_aliases.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/delete_artifact_collection_tag_assignments.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/delete_artifact_portfolio.cpython-312.pycAdded
- lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/delete_artifact_sequence.cpython-312.pycAdded
123456789101112131415161718192021222324252627282930"""Chart Visualization Utilities
This module offers a collection of predefined chart types, along with functionalityfor creating custom charts, enabling flexible visualization of your data beyond thebuilt-in options."""
__all__ = [ "line", "histogram", "scatter", "bar", "roc_curve", "pr_curve", "confusion_matrix", "line_series", "plot_table", "visualize", # doc:exclude]
from wandb.plot.bar import barfrom wandb.plot.confusion_matrix import confusion_matrixfrom wandb.plot.custom_chart import CustomChart, plot_tablefrom wandb.plot.histogram import histogramfrom wandb.plot.line import linefrom wandb.plot.line_series import line_seriesfrom wandb.plot.pr_curve import pr_curvefrom wandb.plot.roc_curve import roc_curvefrom wandb.plot.scatter import scatterfrom wandb.plot.viz import Visualize, visualize1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071from __future__ import annotations
from typing import TYPE_CHECKING
from wandb.plot.custom_chart import plot_table
if TYPE_CHECKING: import wandb from wandb.plot.custom_chart import CustomChart
def bar( table: wandb.Table, label: str, value: str, title: str = "", split_table: bool = False,) -> CustomChart: """Constructs a bar chart from a wandb.Table of data.
Args: table: A table containing the data for the bar chart. label: The name of the column to use for the labels of each bar. value: The name of the column to use for the values of each bar. title: The title of the bar chart. split_table: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`.
Returns: CustomChart: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`.
Example:
```python import random import wandb
# Generate random data for the table data = [ ["car", random.uniform(0, 1)], ["bus", random.uniform(0, 1)], ["road", random.uniform(0, 1)], ["person", random.uniform(0, 1)], ]
# Create a table with the data table = wandb.Table(data=data, columns=["class", "accuracy"])
# Initialize a W&B run and log the bar plot with wandb.init(project="bar_chart") as run: # Create a bar plot from the table bar_plot = wandb.plot.bar( table=table, label="class", value="accuracy", title="Object Classification Accuracy", )
# Log the bar chart to W&B run.log({"bar_plot": bar_plot}) ``` """ return plot_table( data_table=table, vega_spec_name="wandb/bar/v0", fields={"label": label, "value": value}, string_fields={"title": title}, split_table=split_table, )123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124from __future__ import annotations
from dataclasses import dataclassfrom typing import Any
import wandb
@dataclassclass CustomChartSpec: spec_name: str fields: dict[str, Any] string_fields: dict[str, Any] key: str = "" panel_type: str = "Vega2" split_table: bool = False
@property def table_key(self) -> str: if not self.key: raise wandb.Error("Key for the custom chart spec is not set.") if self.split_table: return f"Custom Chart Tables/{self.key}_table" return f"{self.key}_table"
@property def config_value(self) -> dict[str, Any]: return { "panel_type": self.panel_type, "panel_config": { "panelDefId": self.spec_name, "fieldSettings": self.fields, "stringSettings": self.string_fields, "transform": {"name": "tableWithLeafColNames"}, "userQuery": { "queryFields": [ { "name": "runSets", "args": [{"name": "runSets", "value": "${runSets}"}], "fields": [ {"name": "id", "fields": []}, {"name": "name", "fields": []}, {"name": "_defaultColorIndex", "fields": []}, { "name": "summaryTable", "args": [ { "name": "tableKey", "value": self.table_key, } ], "fields": [], }, ], } ], }, }, }
@property def config_key(self) -> tuple[str, str, str]: return ("_wandb", "visualize", self.key)
@dataclassclass CustomChart: table: wandb.Table spec: CustomChartSpec
def set_key(self, key: str): """Sets the key for the spec and updates dependent configurations.""" self.spec.key = key
def plot_table( vega_spec_name: str, data_table: wandb.Table, fields: dict[str, Any], string_fields: dict[str, Any] | None = None, split_table: bool = False,) -> CustomChart: """Creates a custom charts using a Vega-Lite specification and a `wandb.Table`.
This function creates a custom chart based on a Vega-Lite specification and a data table represented by a `wandb.Table` object. The specification needs to be predefined and stored in the W&B backend. The function returns a custom chart object that can be logged to W&B using `wandb.log()`.
Args: vega_spec_name (str): The name or identifier of the Vega-Lite spec that defines the visualization structure. data_table (wandb.Table): A `wandb.Table` object containing the data to be visualized. fields (dict[str, Any]): A mapping between the fields in the Vega-Lite spec and the corresponding columns in the data table to be visualized. string_fields (dict[str, Any] | None): A dictionary for providing values for any string constants required by the custom visualization. split_table (bool): Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`.
Returns: CustomChart: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`.
Raises: wandb.Error: If `data_table` is not a `wandb.Table` object. """
if not isinstance(data_table, wandb.Table): raise wandb.Error( f"Expected `data_table` to be `wandb.Table` type, instead got {type(data_table).__name__}" )
return CustomChart( table=data_table, spec=CustomChartSpec( spec_name=vega_spec_name, fields=fields, string_fields=string_fields or {}, split_table=split_table, ), )123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475from __future__ import annotations
from typing import TYPE_CHECKING
from wandb.plot.custom_chart import plot_table
if TYPE_CHECKING: import wandb from wandb.plot.custom_chart import CustomChart
def line( table: wandb.Table, x: str, y: str, stroke: str | None = None, title: str = "", split_table: bool = False,) -> CustomChart: """Constructs a customizable line chart.
Args: table: The table containing data for the chart. x: Column name for the x-axis values. y: Column name for the y-axis values. stroke: Column name to differentiate line strokes (e.g., for grouping lines). title: Title of the chart. split_table: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`.
Returns: CustomChart: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`.
Example:
```python import math import random import wandb
# Create multiple series of data with different patterns data = [] for i in range(100): # Series 1: Sinusoidal pattern with random noise data.append([i, math.sin(i / 10) + random.uniform(-0.1, 0.1), "series_1"]) # Series 2: Cosine pattern with random noise data.append([i, math.cos(i / 10) + random.uniform(-0.1, 0.1), "series_2"]) # Series 3: Linear increase with random noise data.append([i, i / 10 + random.uniform(-0.5, 0.5), "series_3"])
# Define the columns for the table table = wandb.Table(data=data, columns=["step", "value", "series"])
# Initialize wandb run and log the line chart with wandb.init(project="line_chart_example") as run: line_chart = wandb.plot.line( table=table, x="step", y="value", stroke="series", # Group by the "series" column title="Multi-Series Line Plot", ) run.log({"line-chart": line_chart}) ``` """ return plot_table( data_table=table, vega_spec_name="wandb/line/v0", fields={"x": x, "y": y, "stroke": stroke}, string_fields={"title": title}, split_table=split_table, )123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186from __future__ import annotations
import numbersfrom typing import TYPE_CHECKING, Iterable, TypeVar
import wandbfrom wandb import utilfrom wandb.plot.custom_chart import plot_tablefrom wandb.plot.utils import test_missing, test_types
if TYPE_CHECKING: from wandb.plot.custom_chart import CustomChart
T = TypeVar("T")
def pr_curve( y_true: Iterable[T] | None = None, y_probas: Iterable[numbers.Number] | None = None, labels: list[str] | None = None, classes_to_plot: list[T] | None = None, interp_size: int = 21, title: str = "Precision-Recall Curve", split_table: bool = False,) -> CustomChart: """Constructs a Precision-Recall (PR) curve.
The Precision-Recall curve is particularly useful for evaluating classifiers on imbalanced datasets. A high area under the PR curve signifies both high precision (a low false positive rate) and high recall (a low false negative rate). The curve provides insights into the balance between false positives and false negatives at various threshold levels, aiding in the assessment of a model's performance.
Args: y_true: True binary labels. The shape should be (`num_samples`,). y_probas: Predicted scores or probabilities for each class. These can be probability estimates, confidence scores, or non-thresholded decision values. The shape should be (`num_samples`, `num_classes`). labels: Optional list of class names to replace numeric values in `y_true` for easier plot interpretation. For example, `labels = ['dog', 'cat', 'owl']` will replace 0 with 'dog', 1 with 'cat', and 2 with 'owl' in the plot. If not provided, numeric values from `y_true` will be used. classes_to_plot: Optional list of unique class values from y_true to be included in the plot. If not specified, all unique classes in y_true will be plotted. interp_size: Number of points to interpolate recall values. The recall values will be fixed to `interp_size` uniformly distributed points in the range [0, 1], and the precision will be interpolated accordingly. title: Title of the plot. Defaults to "Precision-Recall Curve". split_table: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`.
Returns: CustomChart: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`.
Raises: wandb.Error: If NumPy, pandas, or scikit-learn is not installed.
Example:
```python import wandb
# Example for spam detection (binary classification) y_true = [0, 1, 1, 0, 1] # 0 = not spam, 1 = spam y_probas = [ [0.9, 0.1], # Predicted probabilities for the first sample (not spam) [0.2, 0.8], # Second sample (spam), and so on [0.1, 0.9], [0.8, 0.2], [0.3, 0.7], ]
labels = ["not spam", "spam"] # Optional class names for readability
with wandb.init(project="spam-detection") as run: pr_curve = wandb.plot.pr_curve( y_true=y_true, y_probas=y_probas, labels=labels, title="Precision-Recall Curve for Spam Detection", ) run.log({"pr-curve": pr_curve}) ``` """ np = util.get_module( "numpy", required="roc requires the numpy library, install with `pip install numpy`", ) pd = util.get_module( "pandas", required="roc requires the pandas library, install with `pip install pandas`", ) sklearn_metrics = util.get_module( "sklearn.metrics", "roc requires the scikit library, install with `pip install scikit-learn`", ) sklearn_utils = util.get_module( "sklearn.utils", "roc requires the scikit library, install with `pip install scikit-learn`", )
def _step(x): y = np.array(x) for i in range(1, len(y)): y[i] = max(y[i], y[i - 1]) return y
y_true = np.array(y_true) y_probas = np.array(y_probas)
if not test_missing(y_true=y_true, y_probas=y_probas): return if not test_types(y_true=y_true, y_probas=y_probas): return
classes = np.unique(y_true) if classes_to_plot is None: classes_to_plot = classes
precision = {} interp_recall = np.linspace(0, 1, interp_size)[::-1] indices_to_plot = np.where(np.isin(classes, classes_to_plot))[0] for i in indices_to_plot: if labels is not None and ( isinstance(classes[i], int) or isinstance(classes[0], np.integer) ): class_label = labels[classes[i]] else: class_label = classes[i]
cur_precision, cur_recall, _ = sklearn_metrics.precision_recall_curve( y_true, y_probas[:, i], pos_label=classes[i] ) # smooth the precision (monotonically increasing) cur_precision = _step(cur_precision)
# reverse order so that recall in ascending cur_precision = cur_precision[::-1] cur_recall = cur_recall[::-1] indices = np.searchsorted(cur_recall, interp_recall, side="left") precision[class_label] = cur_precision[indices]
df = pd.DataFrame( { "class": np.hstack([[k] * len(v) for k, v in precision.items()]), "precision": np.hstack(list(precision.values())), "recall": np.tile(interp_recall, len(precision)), } ).round(3)
if len(df) > wandb.Table.MAX_ROWS: wandb.termwarn( f"Table has a limit of {wandb.Table.MAX_ROWS} rows. Resampling to fit." ) # different sampling could be applied, possibly to ensure endpoints are kept df = sklearn_utils.resample( df, replace=False, n_samples=wandb.Table.MAX_ROWS, random_state=42, stratify=df["class"], ).sort_values(["precision", "recall", "class"])
return plot_table( data_table=wandb.Table(dataframe=df), vega_spec_name="wandb/area-under-curve/v0", fields={ "x": "recall", "y": "precision", "class": "class", }, string_fields={ "title": title, "x-axis-title": "Recall", "y-axis-title": "Precision", }, split_table=split_table, )123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566from __future__ import annotations
from typing import TYPE_CHECKING
from wandb.plot.custom_chart import plot_table
if TYPE_CHECKING: import wandb from wandb.plot.custom_chart import CustomChart
def scatter( table: wandb.Table, x: str, y: str, title: str = "", split_table: bool = False,) -> CustomChart: """Constructs a scatter plot from a wandb.Table of data.
Args: table: The W&B Table containing the data to visualize. x: The name of the column used for the x-axis. y: The name of the column used for the y-axis. title: The title of the scatter chart. split_table: Whether the table should be split into a separate section in the W&B UI. If `True`, the table will be displayed in a section named "Custom Chart Tables". Default is `False`.
Returns: CustomChart: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`. Example: ```python import math import random import wandb
# Simulate temperature variations at different altitudes over time data = [ [i, random.uniform(-10, 20) - 0.005 * i + 5 * math.sin(i / 50)] for i in range(300) ]
# Create W&B table with altitude (m) and temperature (°C) columns table = wandb.Table(data=data, columns=["altitude (m)", "temperature (°C)"])
# Initialize W&B run and log the scatter plot with wandb.init(project="temperature-altitude-scatter") as run: # Create and log the scatter plot scatter_plot = wandb.plot.scatter( table=table, x="altitude (m)", y="temperature (°C)", title="Altitude vs Temperature", ) run.log({"altitude-temperature-scatter": scatter_plot}) ``` """ return plot_table( data_table=table, vega_spec_name="wandb/scatter/v0", fields={"x": x, "y": y}, string_fields={"title": title}, split_table=split_table, )123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184from typing import Iterable, Sequence
import wandbfrom wandb import util
def test_missing(**kwargs): np = util.get_module("numpy", required="Logging plots requires numpy") pd = util.get_module("pandas", required="Logging dataframes requires pandas") scipy = util.get_module("scipy", required="Logging scipy matrices requires scipy")
test_passed = True for k, v in kwargs.items(): # Missing/empty params/datapoint arrays if v is None: wandb.termerror(f"{k} is None. Please try again.") test_passed = False if (k == "X") or (k == "X_test"): if isinstance(v, scipy.sparse.csr.csr_matrix): v = v.toarray() elif isinstance(v, (pd.DataFrame, pd.Series)): v = v.to_numpy() elif isinstance(v, list): v = np.asarray(v)
# Warn the user about missing values missing = 0 missing = np.count_nonzero(pd.isnull(v)) if missing > 0: wandb.termwarn("%s contains %d missing values. " % (k, missing)) test_passed = False # Ensure the dataset contains only integers non_nums = 0 if v.ndim == 1: non_nums = sum( 1 for val in v if ( not isinstance(val, (int, float, complex)) and not isinstance(val, np.number) ) ) else: non_nums = sum( 1 for sl in v for val in sl if ( not isinstance(val, (int, float, complex)) and not isinstance(val, np.number) ) ) if non_nums > 0: wandb.termerror( f"{k} contains values that are not numbers. Please vectorize, " f"label encode or one hot encode {k} and call the plotting function again." ) test_passed = False return test_passed
def test_fitted(model): np = util.get_module("numpy", required="Logging plots requires numpy") _ = util.get_module("pandas", required="Logging dataframes requires pandas") _ = util.get_module("scipy", required="Logging scipy matrices requires scipy") scikit_utils = util.get_module( "sklearn.utils", required="roc requires the scikit utils submodule, install with `pip install scikit-learn`", ) scikit_exceptions = util.get_module( "sklearn.exceptions", "roc requires the scikit preprocessing submodule, install with `pip install scikit-learn`", )
try: model.predict(np.zeros((7, 3))) except scikit_exceptions.NotFittedError: wandb.termerror("Please fit the model before passing it in.") return False except AttributeError: # Some clustering models (LDA, PCA, Agglomerative) don't implement ``predict`` try: scikit_utils.validation.check_is_fitted( model, [ "coef_", "estimator_", "labels_", "n_clusters_", "children_", "components_", "n_components_", "n_iter_", "n_batch_iter_", "explained_variance_", "singular_values_", "mean_", ], all_or_any=any, ) except scikit_exceptions.NotFittedError: wandb.termerror("Please fit the model before passing it in.") return False else: return True except Exception: # Assume it's fitted, since ``NotFittedError`` wasn't raised return True
def encode_labels(df): _ = util.get_module("pandas", required="Logging dataframes requires pandas") preprocessing = util.get_module( "sklearn.preprocessing", "roc requires the scikit preprocessing submodule, install with `pip install scikit-learn`", )
le = preprocessing.LabelEncoder() # apply le on categorical feature columns categorical_cols = df.select_dtypes( exclude=["int", "float", "float64", "float32", "int32", "int64"] ).columns df[categorical_cols] = df[categorical_cols].apply(lambda col: le.fit_transform(col))
def test_types(**kwargs): np = util.get_module("numpy", required="Logging plots requires numpy") pd = util.get_module("pandas", required="Logging dataframes requires pandas") _ = util.get_module("scipy", required="Logging scipy matrices requires scipy")
base = util.get_module( "sklearn.base", "roc requires the scikit base submodule, install with `pip install scikit-learn`", )
test_passed = True for k, v in kwargs.items(): # check for incorrect types if ( (k == "X") or (k == "X_test") or (k == "y") or (k == "y_test") or (k == "y_true") or (k == "y_probas") or (k == "x_labels") or (k == "y_labels") or (k == "matrix_values") ): # FIXME: do this individually if not isinstance( v, ( Sequence, Iterable, np.ndarray, np.generic, pd.DataFrame, pd.Series, list, ), ): wandb.termerror(f"{k} is not an array. Please try again.") test_passed = False # check for classifier types if k == "model": if (not base.is_classifier(v)) and (not base.is_regressor(v)): wandb.termerror( f"{k} is not a classifier or regressor. Please try again." ) test_passed = False elif k == "clf" or k == "binary_clf": if not (base.is_classifier(v)): wandb.termerror(f"{k} is not a classifier. Please try again.") test_passed = False elif k == "regressor": if not base.is_regressor(v): wandb.termerror(f"{k} is not a regressor. Please try again.") test_passed = False elif k == "clusterer": if not (getattr(v, "_estimator_type", None) == "clusterer"): wandb.termerror(f"{k} is not a clusterer. Please try again.") test_passed = False return test_passed123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300# Generated by ariadne-codegen
from .add_aliases import AddAliases, AddAliasesAddAliasesfrom .artifact_collection_membership_files import ( ArtifactCollectionMembershipFiles, ArtifactCollectionMembershipFilesProject, ArtifactCollectionMembershipFilesProjectArtifactCollection, ArtifactCollectionMembershipFilesProjectArtifactCollectionArtifactMembership,)from .artifact_version_files import ( ArtifactVersionFiles, ArtifactVersionFilesProject, ArtifactVersionFilesProjectArtifactType, ArtifactVersionFilesProjectArtifactTypeArtifact,)from .create_artifact_collection_tag_assignments import ( CreateArtifactCollectionTagAssignments, CreateArtifactCollectionTagAssignmentsCreateArtifactCollectionTagAssignments, CreateArtifactCollectionTagAssignmentsCreateArtifactCollectionTagAssignmentsTags,)from .delete_aliases import DeleteAliases, DeleteAliasesDeleteAliasesfrom .delete_artifact_collection_tag_assignments import ( DeleteArtifactCollectionTagAssignments, DeleteArtifactCollectionTagAssignmentsDeleteArtifactCollectionTagAssignments,)from .delete_artifact_portfolio import ( DeleteArtifactPortfolio, DeleteArtifactPortfolioDeleteArtifactPortfolio, DeleteArtifactPortfolioDeleteArtifactPortfolioArtifactCollection,)from .delete_artifact_sequence import ( DeleteArtifactSequence, DeleteArtifactSequenceDeleteArtifactSequence, DeleteArtifactSequenceDeleteArtifactSequenceArtifactCollection,)from .enums import ArtifactCollectionState, ArtifactStatefrom .fetch_linked_artifacts import ( FetchLinkedArtifacts, FetchLinkedArtifactsArtifact, FetchLinkedArtifactsArtifactArtifactMemberships, FetchLinkedArtifactsArtifactArtifactMembershipsEdges, FetchLinkedArtifactsArtifactArtifactMembershipsEdgesNode, FetchLinkedArtifactsArtifactArtifactMembershipsEdgesNodeAliases, FetchLinkedArtifactsArtifactArtifactMembershipsEdgesNodeArtifactCollection, FetchLinkedArtifactsArtifactArtifactMembershipsEdgesNodeArtifactCollectionProject,)from .fragments import ( ArtifactCollectionsFragment, ArtifactCollectionsFragmentEdges, ArtifactCollectionsFragmentEdgesNode, ArtifactCollectionsFragmentPageInfo, ArtifactFragment, ArtifactFragmentAliases, ArtifactFragmentAliasesArtifactCollection, ArtifactFragmentAliasesArtifactCollectionProject, ArtifactFragmentArtifactSequence, ArtifactFragmentArtifactSequenceProject, ArtifactFragmentArtifactType, ArtifactFragmentCurrentManifest, ArtifactFragmentCurrentManifestFile, ArtifactFragmentTags, ArtifactPortfolioTypeFields, ArtifactSequenceTypeFields, ArtifactsFragment, ArtifactsFragmentEdges, ArtifactsFragmentPageInfo, ArtifactTypeFragment, ArtifactTypesFragment, ArtifactTypesFragmentEdges, ArtifactTypesFragmentPageInfo, FilesFragment, FilesFragmentEdges, FilesFragmentEdgesNode, FilesFragmentPageInfo,)from .input_types import ( ArtifactAliasInput, ArtifactCollectionAliasInput, LinkArtifactInput, TagInput,)from .link_artifact import LinkArtifact, LinkArtifactLinkArtifactfrom .move_artifact_collection import ( MoveArtifactCollection, MoveArtifactCollectionMoveArtifactSequence, MoveArtifactCollectionMoveArtifactSequenceArtifactCollection,)from .operations import ( ADD_ALIASES_GQL, ARTIFACT_COLLECTION_MEMBERSHIP_FILES_GQL, ARTIFACT_VERSION_FILES_GQL, CREATE_ARTIFACT_COLLECTION_TAG_ASSIGNMENTS_GQL, DELETE_ALIASES_GQL, DELETE_ARTIFACT_COLLECTION_TAG_ASSIGNMENTS_GQL, DELETE_ARTIFACT_PORTFOLIO_GQL, DELETE_ARTIFACT_SEQUENCE_GQL, FETCH_LINKED_ARTIFACTS_GQL, LINK_ARTIFACT_GQL, MOVE_ARTIFACT_COLLECTION_GQL, PROJECT_ARTIFACT_COLLECTION_GQL, PROJECT_ARTIFACT_COLLECTIONS_GQL, PROJECT_ARTIFACT_TYPE_GQL, PROJECT_ARTIFACT_TYPES_GQL, PROJECT_ARTIFACTS_GQL, RUN_INPUT_ARTIFACTS_GQL, RUN_OUTPUT_ARTIFACTS_GQL, UPDATE_ARTIFACT_GQL, UPDATE_ARTIFACT_PORTFOLIO_GQL, UPDATE_ARTIFACT_SEQUENCE_GQL,)from .project_artifact_collection import ( ProjectArtifactCollection, ProjectArtifactCollectionProject, ProjectArtifactCollectionProjectArtifactType, ProjectArtifactCollectionProjectArtifactTypeArtifactCollection, ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionAliases, ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionAliasesEdges, ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionAliasesEdgesNode, ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionAliasesPageInfo, ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionTags, ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionTagsEdges, ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionTagsEdgesNode, ProjectArtifactCollectionProjectArtifactTypeArtifactSequence,)from .project_artifact_collections import ( ProjectArtifactCollections, ProjectArtifactCollectionsProject, ProjectArtifactCollectionsProjectArtifactType,)from .project_artifact_type import ProjectArtifactType, ProjectArtifactTypeProjectfrom .project_artifact_types import ProjectArtifactTypes, ProjectArtifactTypesProjectfrom .project_artifacts import ( ProjectArtifacts, ProjectArtifactsProject, ProjectArtifactsProjectArtifactType, ProjectArtifactsProjectArtifactTypeArtifactCollection,)from .run_input_artifacts import ( RunInputArtifacts, RunInputArtifactsProject, RunInputArtifactsProjectRun, RunInputArtifactsProjectRunInputArtifacts, RunInputArtifactsProjectRunInputArtifactsEdges, RunInputArtifactsProjectRunInputArtifactsPageInfo,)from .run_output_artifacts import ( RunOutputArtifacts, RunOutputArtifactsProject, RunOutputArtifactsProjectRun, RunOutputArtifactsProjectRunOutputArtifacts, RunOutputArtifactsProjectRunOutputArtifactsEdges, RunOutputArtifactsProjectRunOutputArtifactsPageInfo,)from .update_artifact import UpdateArtifact, UpdateArtifactUpdateArtifactfrom .update_artifact_portfolio import ( UpdateArtifactPortfolio, UpdateArtifactPortfolioUpdateArtifactPortfolio, UpdateArtifactPortfolioUpdateArtifactPortfolioArtifactCollection,)from .update_artifact_sequence import ( UpdateArtifactSequence, UpdateArtifactSequenceUpdateArtifactSequence, UpdateArtifactSequenceUpdateArtifactSequenceArtifactCollection,)
__all__ = [ "ADD_ALIASES_GQL", "ARTIFACT_COLLECTION_MEMBERSHIP_FILES_GQL", "ARTIFACT_VERSION_FILES_GQL", "CREATE_ARTIFACT_COLLECTION_TAG_ASSIGNMENTS_GQL", "DELETE_ALIASES_GQL", "DELETE_ARTIFACT_COLLECTION_TAG_ASSIGNMENTS_GQL", "DELETE_ARTIFACT_PORTFOLIO_GQL", "DELETE_ARTIFACT_SEQUENCE_GQL", "FETCH_LINKED_ARTIFACTS_GQL", "LINK_ARTIFACT_GQL", "MOVE_ARTIFACT_COLLECTION_GQL", "PROJECT_ARTIFACTS_GQL", "PROJECT_ARTIFACT_COLLECTIONS_GQL", "PROJECT_ARTIFACT_COLLECTION_GQL", "PROJECT_ARTIFACT_TYPES_GQL", "PROJECT_ARTIFACT_TYPE_GQL", "RUN_INPUT_ARTIFACTS_GQL", "RUN_OUTPUT_ARTIFACTS_GQL", "UPDATE_ARTIFACT_GQL", "UPDATE_ARTIFACT_PORTFOLIO_GQL", "UPDATE_ARTIFACT_SEQUENCE_GQL", "DeleteArtifactSequence", "DeleteArtifactSequenceDeleteArtifactSequence", "DeleteArtifactSequenceDeleteArtifactSequenceArtifactCollection", "DeleteArtifactPortfolio", "DeleteArtifactPortfolioDeleteArtifactPortfolio", "DeleteArtifactPortfolioDeleteArtifactPortfolioArtifactCollection", "UpdateArtifactSequence", "UpdateArtifactSequenceUpdateArtifactSequence", "UpdateArtifactSequenceUpdateArtifactSequenceArtifactCollection", "UpdateArtifactPortfolio", "UpdateArtifactPortfolioUpdateArtifactPortfolio", "UpdateArtifactPortfolioUpdateArtifactPortfolioArtifactCollection", "MoveArtifactCollection", "MoveArtifactCollectionMoveArtifactSequence", "MoveArtifactCollectionMoveArtifactSequenceArtifactCollection", "CreateArtifactCollectionTagAssignments", "CreateArtifactCollectionTagAssignmentsCreateArtifactCollectionTagAssignments", "CreateArtifactCollectionTagAssignmentsCreateArtifactCollectionTagAssignmentsTags", "DeleteArtifactCollectionTagAssignments", "DeleteArtifactCollectionTagAssignmentsDeleteArtifactCollectionTagAssignments", "ProjectArtifactCollections", "ProjectArtifactCollectionsProject", "ProjectArtifactCollectionsProjectArtifactType", "ProjectArtifactCollection", "ProjectArtifactCollectionProject", "ProjectArtifactCollectionProjectArtifactType", "ProjectArtifactCollectionProjectArtifactTypeArtifactCollection", "ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionAliases", "ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionAliasesEdges", "ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionAliasesEdgesNode", "ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionAliasesPageInfo", "ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionTags", "ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionTagsEdges", "ProjectArtifactCollectionProjectArtifactTypeArtifactCollectionTagsEdgesNode", "ProjectArtifactCollectionProjectArtifactTypeArtifactSequence", "ArtifactVersionFiles", "ArtifactVersionFilesProject", "ArtifactVersionFilesProjectArtifactType", "ArtifactVersionFilesProjectArtifactTypeArtifact", "ArtifactCollectionMembershipFiles", "ArtifactCollectionMembershipFilesProject", "ArtifactCollectionMembershipFilesProjectArtifactCollection", "ArtifactCollectionMembershipFilesProjectArtifactCollectionArtifactMembership", "ProjectArtifactTypes", "ProjectArtifactTypesProject", "ProjectArtifactType", "ProjectArtifactTypeProject", "ProjectArtifacts", "ProjectArtifactsProject", "ProjectArtifactsProjectArtifactType", "ProjectArtifactsProjectArtifactTypeArtifactCollection", "RunOutputArtifacts", "RunOutputArtifactsProject", "RunOutputArtifactsProjectRun", "RunOutputArtifactsProjectRunOutputArtifacts", "RunOutputArtifactsProjectRunOutputArtifactsEdges", "RunOutputArtifactsProjectRunOutputArtifactsPageInfo", "RunInputArtifacts", "RunInputArtifactsProject", "RunInputArtifactsProjectRun", "RunInputArtifactsProjectRunInputArtifacts", "RunInputArtifactsProjectRunInputArtifactsEdges", "RunInputArtifactsProjectRunInputArtifactsPageInfo", "FetchLinkedArtifacts", "FetchLinkedArtifactsArtifact", "FetchLinkedArtifactsArtifactArtifactMemberships", "FetchLinkedArtifactsArtifactArtifactMembershipsEdges", "FetchLinkedArtifactsArtifactArtifactMembershipsEdgesNode", "FetchLinkedArtifactsArtifactArtifactMembershipsEdgesNodeAliases", "FetchLinkedArtifactsArtifactArtifactMembershipsEdgesNodeArtifactCollection", "FetchLinkedArtifactsArtifactArtifactMembershipsEdgesNodeArtifactCollectionProject", "AddAliases", "AddAliasesAddAliases", "DeleteAliases", "DeleteAliasesDeleteAliases", "UpdateArtifact", "UpdateArtifactUpdateArtifact", "LinkArtifact", "LinkArtifactLinkArtifact", "ArtifactAliasInput", "ArtifactCollectionAliasInput", "LinkArtifactInput", "TagInput", "ArtifactCollectionsFragment", "ArtifactCollectionsFragmentEdges", "ArtifactCollectionsFragmentEdgesNode", "ArtifactCollectionsFragmentPageInfo", "ArtifactFragment", "ArtifactFragmentAliases", "ArtifactFragmentAliasesArtifactCollection", "ArtifactFragmentAliasesArtifactCollectionProject", "ArtifactFragmentArtifactSequence", "ArtifactFragmentArtifactSequenceProject", "ArtifactFragmentArtifactType", "ArtifactFragmentCurrentManifest", "ArtifactFragmentCurrentManifestFile", "ArtifactFragmentTags", "ArtifactPortfolioTypeFields", "ArtifactSequenceTypeFields", "ArtifactTypeFragment", "ArtifactTypesFragment", "ArtifactTypesFragmentEdges", "ArtifactTypesFragmentPageInfo", "ArtifactsFragment", "ArtifactsFragmentEdges", "ArtifactsFragmentPageInfo", "FilesFragment", "FilesFragmentEdges", "FilesFragmentEdgesNode", "FilesFragmentPageInfo", "ArtifactCollectionState", "ArtifactState",]lib/python3.12/site-packages/wandb/plot/__init__.pyAdded+30
lib/python3.12/site-packages/wandb/plot/bar.pyAdded+71
lib/python3.12/site-packages/wandb/plot/custom_chart.pyAdded+124
lib/python3.12/site-packages/wandb/plot/line.pyAdded+75
lib/python3.12/site-packages/wandb/plot/pr_curve.pyAdded+186
lib/python3.12/site-packages/wandb/plot/scatter.pyAdded+66
lib/python3.12/site-packages/wandb/plot/utils.pyAdded+184
lib/python3.12/site-packages/wandb/sdk/__pycache__/__init__.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_alerts.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_config.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_helper.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_init.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_login.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_metric.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_require.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_require_helpers.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_settings.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_setup.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_summary.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_sweep.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_sync.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/__pycache__/wandb_watch.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/__init__.pyAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/__init__.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/_graphql_fragments.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/_internal_artifact.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/_validators.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_download_logger.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_file_cache.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_instance_cache.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_manifest.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_manifest_entry.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_saver.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_state.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/artifact_ttl.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/exceptions.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/staging.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/storage_handler.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/storage_layout.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/__pycache__/storage_policy.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__init__.pyAdded+300
lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/__init__.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/add_aliases.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/artifact_collection_membership_files.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/artifact_version_files.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/create_artifact_collection_tag_assignments.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/delete_aliases.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/delete_artifact_collection_tag_assignments.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/delete_artifact_portfolio.cpython-312.pycAdded
lib/python3.12/site-packages/wandb/sdk/artifacts/_generated/__pycache__/delete_artifact_sequence.cpython-312.pycAdded