Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
583 changes: 547 additions & 36 deletions models/ref/python/automations/automation.mdx

Large diffs are not rendered by default.

542 changes: 526 additions & 16 deletions models/ref/python/automations/donothing.mdx

Large diffs are not rendered by default.

566 changes: 538 additions & 28 deletions models/ref/python/automations/metricchangefilter.mdx

Large diffs are not rendered by default.

553 changes: 532 additions & 21 deletions models/ref/python/automations/metricthresholdfilter.mdx

Large diffs are not rendered by default.

549 changes: 530 additions & 19 deletions models/ref/python/automations/metriczscorefilter.mdx

Large diffs are not rendered by default.

560 changes: 535 additions & 25 deletions models/ref/python/automations/newautomation.mdx

Large diffs are not rendered by default.

562 changes: 544 additions & 18 deletions models/ref/python/automations/onaddartifactalias.mdx

Large diffs are not rendered by default.

562 changes: 544 additions & 18 deletions models/ref/python/automations/oncreateartifact.mdx

Large diffs are not rendered by default.

562 changes: 544 additions & 18 deletions models/ref/python/automations/onlinkartifact.mdx

Large diffs are not rendered by default.

562 changes: 544 additions & 18 deletions models/ref/python/automations/onrunmetric.mdx

Large diffs are not rendered by default.

562 changes: 544 additions & 18 deletions models/ref/python/automations/onrunstate.mdx

Large diffs are not rendered by default.

541 changes: 526 additions & 15 deletions models/ref/python/automations/runstatefilter.mdx

Large diffs are not rendered by default.

575 changes: 547 additions & 28 deletions models/ref/python/automations/sendnotification.mdx

Large diffs are not rendered by default.

561 changes: 539 additions & 22 deletions models/ref/python/automations/sendwebhook.mdx

Large diffs are not rendered by default.

61 changes: 30 additions & 31 deletions models/ref/python/custom-charts/bar.mdx
Original file line number Diff line number Diff line change
@@ -1,49 +1,47 @@
---
title: bar()
namespace: python_sdk_custom_charts
python_object_type: function
title: bar
kind: function
namespace: wandb.plot.bar
---
import { GitHubLink } from '/snippets/_includes/github-source-link.mdx';

<GitHubLink url="https://github.com/wandb/wandb/blob/main/wandb/plot/bar.py" />
import { GitHubLink } from '/snippets/_includes/github-source-link.mdx';


<GitHubLink url="https://github.com/wandb/wandb/blob/main/wandb/plot/bar.py#L12" />


### <kbd>function</kbd> `bar`

```python
bar(
table: 'wandb.Table',
label: 'str',
value: 'str',
title: 'str' = '',
split_table: 'bool' = False
) → CustomChart
table: 'wandb.Table',
label: 'str',
value: 'str',
title: 'str' = '',
split_table: 'bool' = False
```

Constructs a bar chart from a wandb.Table of data.
## Description

Constructs a bar chart from a wandb.Table of data.



## Args

**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`.
- **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

**Returns:**

- `CustomChart`: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`.
- **CustomChart**: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`.



**Example:**

## Examples

```python
import random
Expand All @@ -64,12 +62,13 @@ table = wandb.Table(data=data, columns=["class", "accuracy"])
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",
table=table,
label="class",
value="accuracy",
title="Object Classification Accuracy",
)

# Log the bar chart to W&B
run.log({"bar_plot": bar_plot})
```
```

92 changes: 47 additions & 45 deletions models/ref/python/custom-charts/confusion_matrix.mdx
Original file line number Diff line number Diff line change
@@ -1,58 +1,56 @@
---
title: confusion_matrix()
namespace: python_sdk_custom_charts
python_object_type: function
title: confusion_matrix
kind: function
namespace: wandb.plot.confusion_matrix
---
import { GitHubLink } from '/snippets/_includes/github-source-link.mdx';

<GitHubLink url="https://github.com/wandb/wandb/blob/main/wandb/plot/confusion_matrix.py" />
import { GitHubLink } from '/snippets/_includes/github-source-link.mdx';


<GitHubLink url="https://github.com/wandb/wandb/blob/main/wandb/plot/confusion_matrix.py#L16" />


### <kbd>function</kbd> `confusion_matrix`

```python
confusion_matrix(
probs: 'Sequence[Sequence[float]] | None' = None,
y_true: 'Sequence[T] | None' = None,
preds: 'Sequence[T] | None' = None,
class_names: 'Sequence[str] | None' = None,
title: 'str' = 'Confusion Matrix Curve',
split_table: 'bool' = False
) → CustomChart
probs: 'Sequence[Sequence[float]] | None' = None,
y_true: 'Sequence[T] | None' = None,
preds: 'Sequence[T] | None' = None,
class_names: 'Sequence[str] | None' = None,
title: 'str' = 'Confusion Matrix Curve',
split_table: 'bool' = False
```

Constructs a confusion matrix from a sequence of probabilities or predictions.
## Description

Constructs a confusion matrix from a sequence of probabilities or predictions.



## Args

**Args:**

- `probs`: A sequence of predicted probabilities for each class. The sequence shape should be (N, K) where N is the number of samples and K is the number of classes. If provided, `preds` should not be provided.
- `y_true`: A sequence of true labels.
- `preds`: A sequence of predicted class labels. If provided, `probs` should not be provided.
- `class_names`: Sequence of class names. If not provided, class names will be defined as "Class_1", "Class_2", etc.
- `title`: Title of the confusion matrix 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`.
- **probs**: A sequence of predicted probabilities for each class. The sequence shape should be (N, K) where N is the number of samples and K is the number of classes. If provided, `preds` should not be provided.
- **y_true**: A sequence of true labels.
- **preds**: A sequence of predicted class labels. If provided, `probs` should not be provided.
- **class_names**: Sequence of class names. If not provided, class names will be defined as "Class_1", "Class_2", etc.
- **title**: Title of the confusion matrix 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

**Returns:**

- `CustomChart`: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`.
- **CustomChart**: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`.


## Raises

**Raises:**

- `ValueError`: If both `probs` and `preds` are provided or if the number of predictions and true labels are not equal. If the number of unique predicted classes exceeds the number of class names or if the number of unique true labels exceeds the number of class names.
- `wandb.Error`: If numpy is not installed.
- **ValueError**: If both `probs` and `preds` are provided or if the number of predictions and true labels are not equal. If the number of unique predicted classes exceeds the number of class names or if the number of unique true labels exceeds the number of class names.
- **wandb.Error**: If numpy is not installed.


## Examples

**Examples:**
Logging a confusion matrix with random probabilities for wildlife classification:
Logging a confusion matrix with random probabilities for wildlife
classification:

```python
import numpy as np
Expand All @@ -75,17 +73,19 @@ wildlife_probs = np.exp(wildlife_probs) / np.sum(
# Initialize W&B run and log confusion matrix
with wandb.init(project="wildlife_classification") as run:
confusion_matrix = wandb.plot.confusion_matrix(
probs=wildlife_probs,
y_true=wildlife_y_true,
class_names=wildlife_class_names,
title="Wildlife Classification Confusion Matrix",
probs=wildlife_probs,
y_true=wildlife_y_true,
class_names=wildlife_class_names,
title="Wildlife Classification Confusion Matrix",
)
run.log({"wildlife_confusion_matrix": confusion_matrix})
```
```

In this example, random probabilities are used to generate a confusion matrix.
In this example, random probabilities are used to generate a confusion
matrix.

Logging a confusion matrix with simulated model predictions and 85% accuracy:
Logging a confusion matrix with simulated model predictions and 85%
accuracy:

```python
import numpy as np
Expand All @@ -112,12 +112,14 @@ wildlife_preds = [
# Initialize W&B run and log confusion matrix
with wandb.init(project="wildlife_classification") as run:
confusion_matrix = wandb.plot.confusion_matrix(
preds=wildlife_preds,
y_true=wildlife_y_true,
class_names=wildlife_class_names,
title="Simulated Wildlife Classification Confusion Matrix",
preds=wildlife_preds,
y_true=wildlife_y_true,
class_names=wildlife_class_names,
title="Simulated Wildlife Classification Confusion Matrix",
)
run.log({"wildlife_confusion_matrix": confusion_matrix})
```
```

In this example, predictions are simulated with 85% accuracy to generate a
confusion matrix.

In this example, predictions are simulated with 85% accuracy to generate a confusion matrix.
47 changes: 23 additions & 24 deletions models/ref/python/custom-charts/histogram.mdx
Original file line number Diff line number Diff line change
@@ -1,47 +1,45 @@
---
title: histogram
namespace: python_sdk_custom_charts
python_object_type: function
kind: function
namespace: wandb.plot.histogram
---
import { GitHubLink } from '/snippets/_includes/github-source-link.mdx';

<GitHubLink url="https://github.com/wandb/wandb/blob/main/wandb/plot/histogram.py" />
import { GitHubLink } from '/snippets/_includes/github-source-link.mdx';


<GitHubLink url="https://github.com/wandb/wandb/blob/main/wandb/plot/histogram.py#L12" />


### <kbd>function</kbd> `histogram`

```python
histogram(
table: 'wandb.Table',
value: 'str',
title: 'str' = '',
split_table: 'bool' = False
) → CustomChart
table: 'wandb.Table',
value: 'str',
title: 'str' = '',
split_table: 'bool' = False
```

Constructs a histogram chart from a W&B Table.
## Description

Constructs a histogram chart from a W&B Table.



## Args

**Args:**

- `table`: The W&B Table containing the data for the histogram.
- `value`: The label for the bin axis (x-axis).
- `title`: The title of the histogram plot.
- `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`.
- **table**: The W&B Table containing the data for the histogram.
- **value**: The label for the bin axis (x-axis).
- **title**: The title of the histogram plot.
- **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

**Returns:**

- `CustomChart`: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`.
- **CustomChart**: A custom chart object that can be logged to W&B. To log the chart, pass it to `wandb.log()`.



**Example:**

## Examples

```python
import math
Expand All @@ -67,4 +65,5 @@ histogram = wandb.plot.histogram(
# Log the histogram plot to W&B
with wandb.init(...) as run:
run.log({"histogram-plot1": histogram})
```
```

Loading
Loading