Life Cycle Actions¶
Development Life Cycle¶
Change the directory to the root of the
forml-tutorial-titanicproject working copy.
Let’s first run all the defined operator unit tests to confirm the project is in a good shape:
$ forml project test running test TestNaNImputer Test of Invalid Params ... ok TestNaNImputer Test of Not Trained ... ok TestNaNImputer Test of Valid Imputation ... ok TestTitleParser Test of Invalid Params ... ok TestTitleParser Test of Invalid Source ... ok TestTitleParser Test of Valid Parsing ... ok ---------------------------------------------------------------------- Ran 6 tests in 0.591s OK
$ forml project train --runner visual
$ forml project eval 0.8379888268156425
…great, we have managed to improve from our baseline workflow!
Create the project package artifact and upload it to the (default as per our config) file system registry (assuming the same release does not already exist - otherwise increment the project version in the setup.py):
$ forml project release
This should publish the project into your local file system model registry making it available for the production life cycle. It becomes the first published release of this project versioned as
0.1.dev1(according to the version from setup.py).
Production Life Cycle¶
The production life cycle does not need the project working copy, so feel free to change the directory to another location before executing the commands.
List the local registry confirming the project has been published as its first release:
$ forml model list forml-tutorial-titanic $ forml model list forml-tutorial-titanic 0.1.dev1 $ forml model list forml-tutorial-titanic 0.1.dev1
The output shows the project artifact is available in the registry as a release
0.1.dev1not having any generation yet (the last command not producing any output).
$ forml model train forml-tutorial-titanic $ forml model list forml-tutorial-titanic 0.1.dev1 1
Now we have our first generation of Titanic models available in the registry.
Apply the trained generation to the test dataset to get the predictions:
$ forml model apply forml-tutorial-titanic [0.10563631 0.32648719 0.11243692 0.17620626 0.58286405 0.17833955 0.81009676 0.10064623 0.84965811 0.08915972 0.13542787 0.2049216 ... 0.89760968 0.7289824 0.79378986 0.91791833 0.55937149 0.09801463 0.93010752 0.09111896 0.21376298 0.84650916]
applymode alternatively on the
Graphvizrunner to explore its task graph:
$ forml model -R visual apply forml-tutorial-titanic
Now, after exploring two of the execution mechanisms (namely the interactive mode demonstrated during the exploratory analysis and the command-line-driven batch processing shown in this chapter), we can proceed to the final deployment and serving.