We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14564ca commit 7388076Copy full SHA for 7388076
comet/comet_callback.py
@@ -28,10 +28,16 @@
28
from sklearn.model_selection import train_test_split
29
30
31
-experiment = comet_ml.Experiment(api_key=os.getenv("COMET_API_KEY"))
32
-comet_ml.login(project_name="comet-optuna-example")
+# Ensure the API key is available
+if not os.getenv("COMET_API_KEY"):
33
+ raise ValueError("COMET_API_KEY is missing! Please set it as an environment variable.")
34
+
35
+# Start the experiment using comet_ml.start()
36
experiment = comet_ml.start()
37
38
+# Log the project name
39
+experiment.set_name("comet-optuna-example")
40
41
# Load dataset
42
random_state = 42
43
cancer = load_breast_cancer()
0 commit comments