Skip to content
Open
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
14 changes: 7 additions & 7 deletions website/docs/Use-Cases/Task-Oriented-AutoML.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ The optimization metric is specified via the `metric` argument. It can be either

```python
def custom_metric(
X_val,
y_val,
X_test,
y_test,
estimator,
labels,
X_train,
Expand All @@ -94,8 +94,8 @@ For example,

```python
def custom_metric(
X_val,
y_val,
X_test,
y_test,
estimator,
labels,
X_train,
Expand All @@ -108,9 +108,9 @@ def custom_metric(
import time

start = time.time()
y_pred = estimator.predict_proba(X_val)
pred_time = (time.time() - start) / len(X_val)
val_loss = log_loss(y_val, y_pred, labels=labels, sample_weight=weight_val)
y_pred = estimator.predict_proba(X_test)
pred_time = (time.time() - start) / len(X_test)
val_loss = log_loss(y_test, y_pred, labels=labels, sample_weight=weight_val)
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable weight_val should be renamed to weight_test to maintain consistency with the renaming of X_val to X_test and y_val to y_test. The current code is using a parameter that should have been renamed along with the other validation-related variables.

Copilot uses AI. Check for mistakes.
y_pred = estimator.predict_proba(X_train)
train_loss = log_loss(y_train, y_pred, labels=labels, sample_weight=weight_train)
alpha = 0.5
Expand Down