Scripts¶
Palladium includes a number of command-line scripts, many of which you may have already encountered in the Tutorial.
- pld-fit: train models
- pld-test: test models
- pld-devserver: serve the web API
- pld-stream: make predictions through stdin and stdout
- pld-grid-search: find optimal hyperparameters
- pld-list: list available models
- pld-admin: administer available models
- pld-version: display version number
- pld-upgrade: upgrade database
pld-fit: train models¶
Fit a model and save to database.
Will use 'dataset_loader_train', 'model', and 'model_perister' from
the configuration file, to load a dataset to train a model with, and
persist it.
Usage:
pld-fit [options]
Options:
-n --no-save Don't persist the fitted model to disk.
--no-activate Don't activate the fitted model.
--save-if-better-than=<k> Persist only if test score better than given
value.
-e --evaluate Evaluate fitted model on train and test set and
print out results.
-h --help Show this screen.
See also
pld-test: test models¶
Test a model.
Uses 'dataset_loader_test' and 'model_persister' from the
configuration to load a test dataset to test the accuracy of a trained
model with.
Usage:
pld-test [options]
Options:
-h --help Show this screen.
--model-version=<version> The version of the model to be tested. If
not specified, the newest model will be used.
See also
pld-devserver: serve the web API¶
Serve the web API for development.
Usage:
pld-devserver [options]
Options:
-h --help Show this screen.
--host=<host> The host to use [default: 0.0.0.0].
--port=<port> The port to use [default: 5000].
--debug=<debug> Whether or not to use debug mode [default: 0].
See also
pld-stream: make predictions through stdin and stdout¶
Start the streaming server, which listens to stdin, processes line
by line, and returns predictions.
The input should consist of a list of json objects, where each object
will result in a prediction. Each line is processed in a batch.
Example input (must be on a single line):
[{"sepal length": 1.0, "sepal width": 1.1, "petal length": 0.7,
"petal width": 5}, {"sepal length": 1.0, "sepal width": 8.0,
"petal length": 1.4, "petal width": 5}]
Example output:
["Iris-virginica","Iris-setosa"]
An input line with the word 'exit' will quit the streaming server.
Usage:
pld-stream [options]
Options:
-h --help Show this screen.
pld-grid-search: find optimal hyperparameters¶
Grid search parameters for the model.
Uses 'dataset_loader_train', 'model', and 'grid_search' from the
configuration to load a training dataset, and run a grid search on the
model using the grid of hyperparameters.
Usage:
pld-grid-search [options]
Options:
-h --help Show this screen.
See also
pld-list: list available models¶
List information about available models.
Uses the 'model_persister' from the configuration to display a list of
models and their metadata.
Usage:
pld-list [options]
Options:
-h --help Show this screen.
pld-admin: administer available models¶
Activate or delete models.
Models are usually made active right after fitting (see command
pld-fit). The 'activate' command allows you to explicitly set the
currently active model. Use 'pld-list' to get an overview of all
available models along with their version identifiers.
Deleting a model will simply remove it from the database.
Usage:
pld-admin activate <version> [options]
pld-admin delete <version> [options]
Options:
-h --help Show this screen.
pld-version: display version number¶
Print the version number of Palladium.
Usage:
pld-version [options]
Options:
-h --help Show this screen.
pld-upgrade: upgrade database¶
Upgrade the database to the latest version.
Usage:
pld-ugprade [options]
Options:
--from=<v> Upgrade from a specific version, overriding
the version stored in the database.
--to=<v> Upgrade to a specific version instead of the
latest version.
-h --help Show this screen.
See also