File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,22 @@ class Experiment(_base_types.Record):
2424 add a new trial to an Experiment by calling :meth:`~smexperiments.experiment.Experiment.create_trial`.
2525 To remove a Trial from an experiment, delete the trial.
2626
27+ Examples:
28+ .. code-block:: python
29+
30+ from smexperiments import experiment
31+
32+ my_experiment = experiment.Experiment.create(experiment_name='AutoML')
33+ my_trial = my_experiment.create_trial(trial_name='random-forest')
34+
35+ for exp in experiment.Experiment.list():
36+ print(exp)
37+ for trial in my_experiment.list_trials():
38+ print(trial)
39+
40+ my_trial.delete()
41+ my_experiment.delete()
42+
2743 Attributes:
2844 experiment_name (str): The name of the experiment. The name must be unique within an account.
2945 description (str): A description of the experiment.
Original file line number Diff line number Diff line change @@ -21,6 +21,25 @@ class Trial(_base_types.Record):
2121
2222 Consists of a list of trial component objects, which document individual activities within the workflow.
2323
24+ Examples:
25+ .. code-block:: python
26+
27+ from smexperiments import trial, experiment, tracker
28+
29+ my_experiment = experiment.Experiment.create(experiment_name='AutoML')
30+ my_trial = trial.Trial.create('AutoML')
31+
32+ my_tracker = tracker.Tracker.create()
33+ # log hyper parameter of learning rate
34+ my_tracker.log_parameter('learning_rate', 0.01)
35+ my_trial.add_trial_component(my_tracker)
36+
37+ for trial_component in my_trial.list_trial_components():
38+ print(trial_component)
39+
40+ my_trial.remove_trial_component(my_tracker)
41+ my_trial.delete()
42+
2443 Attributes:
2544 trial_name (str): The name of the trial.
2645 experiment_name (str): The name of the trial's experiment.
You can’t perform that action at this time.
0 commit comments