Create a basic project¶
To create your first project, instantiate the lazyscribe.Project
class.
from lazyscribe import Project
project = Project(fpath="project.json", mode="w")
Then, use the context manager to create an experiment and log it back to the project.
with project.log(name="My experiment") as exp:
exp.log_metric("metric", 0.3)
exp.log_parameter("param", "value")
When the context manager exits, the experiment will be appended to the Project.experiments
list.
Using a list allows us to preserve the order and reference a copy when associating it with the project.
If you want to avoid using the context manager, simply instantiate your own experiment and append it
to the Project.experiments
list.
from lazyscribe import Experiment
exp = Experiment(name="My experiment", project=project.fpath, author=project.author)
exp.log_metric("metric", 0.3)
exp.log_parameter("param", "value")
project.append(exp)
Once you’ve finished, save the project to the filesystem using lazyscribe.Project.save()
method:
project.save()