Skip to content

Commit 14564ca

Browse files
committed
Update example.
1 parent 8403704 commit 14564ca

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.github/workflows/comet.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
python -c 'import optuna_integration'
3333
3434
pip install -r comet/requirements.txt
35+
- name: Set API Key
36+
run: echo "COMET_API_KEY=${{ secrets.COMET_API_KEY }}" >> $GITHUB_ENV
3537
- name: Run examples
3638
run: |
3739
python comet/comet_callback.py

comet/comet_callback.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import comet_ml
1919
import optuna
20+
import os
2021
from optuna_integration.comet import CometCallback
2122

2223
from sklearn.datasets import load_breast_cancer
@@ -27,8 +28,8 @@
2728
from sklearn.model_selection import train_test_split
2829

2930

30-
# Initialize Comet ML
31-
comet_ml.login(project_name="comet-optuna-sklearn-example")
31+
experiment = comet_ml.Experiment(api_key=os.getenv("COMET_API_KEY"))
32+
comet_ml.login(project_name="comet-optuna-example")
3233
experiment = comet_ml.start()
3334

3435
# Load dataset

0 commit comments

Comments
 (0)