-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
restructure examples directory and README for better readability and …
…sorting by function followed by language implementation
- Loading branch information
Showing
11 changed files
with
105 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import datmo | ||
|
||
""" | ||
WHAT IT DOES: | ||
Instantiates a new task object, and runs the task inside of local container. | ||
As this is run within a datmo project with python dependencies, the | ||
environment will automatically be generated from the file dependencies. | ||
INSTRUCTIONS | ||
1. Instantiate your current folder as a Datmo project with: | ||
$ datmo init --name="basic iris model" --description="run an iris sklearn training script as a task" | ||
2. Run this script to create a snapshot | ||
$ python task_compare.py | ||
3. Run this datmo command to view the snapshot: | ||
$ datmo snapshot ls | ||
""" | ||
|
||
task = datmo.task.run(command="python train_model_1.py") | ||
|
||
print(task.files()) | ||
print(task.results) | ||
|
||
# create a snapshot from the task id directly | ||
snapshot = datmo.snapshot.create_from_task(message="my great snapshot", task_id=task.id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import datmo | ||
|
||
""" | ||
WHAT IT DOES: | ||
Instantiates new task objects, and runs tasks inside of local container. | ||
As this is run within a datmo project with python dependencies, the | ||
environment will automatically be generated from the file dependencies. | ||
INSTRUCTIONS | ||
1. Instantiate your current folder as a Datmo project with: | ||
$ datmo init --name="Iris sklearn model comparison" --description="create sklearn models for iris data using tasks, and compare their results with snapshots" | ||
2. Run this script to create a snapshot | ||
$ python task_compare.py | ||
3. Run this datmo command to list all snapshots in this Datmo project: | ||
$ datmo snapshot ls | ||
""" | ||
|
||
task_1 = datmo.task.run(command="python train_model_1.py") | ||
task_2 = datmo.task.run(command="python train_model_2.py") | ||
|
||
# create a single snapshot from the task id directly, depending on which model was more accurate | ||
if task_1.results['test accuracy'] > task_2.results['test accuracy']: | ||
print("creating a snapshot with model 1") | ||
snapshot = datmo.snapshot.create_from_task( | ||
message="my great snapshot", task_id=task_1.id) | ||
else: | ||
print("creating a snapshot with model 2") | ||
snapshot = datmo.snapshot.create_from_task( | ||
message="my great snapshot", task_id=task_2.id) |
File renamed without changes.
File renamed without changes.