NAME
Algorithm::Classifier::IsolationForest::App::Command::proto - Extract a prototype from a saved model, or validate a prototype file
DESCRIPTION
Works with model prototypes: small JSON documents holding the variable schema -- feature names, per-feature descriptions, munger specs, missing policy -- a user-owned schema_version and schema_description, and optionally the tuning knobs. iforest fit --prototype and iforest stream --prototype create models from one.
--from-model extracts a prototype from a saved model, which closes the loop: pull the schema and knobs out of a model that works, edit the metadata, and mint fresh models from it. A model with no recorded schema version or description gets placeholders to fill in.
--check validates a prototype and summarises what it describes, exiting non-zero when the file is not a valid prototype.
See PROTOTYPES in Algorithm::Classifier::IsolationForest for the file format.
Run it as iforest proto; iforest help proto lists every option.
METHODS
App::Cmd calls these while dispatching the subcommand. Nothing else should.
opt_spec
Returns this command's option specifications, as the list of arrayrefs Getopt::Long::Descriptive expects.
abstract
Returns the one-line summary iforest commands prints beside the command name.
description
Returns the long help text iforest help proto prints under the option list.
validate
Checks the parsed options before anything is read or written, so a mistake costs nothing.
Requires exactly one of --from-model or --check, checks that the named file is readable, and allows -o only with --from-model (and only over an existing file when -w is given).
Takes the parsed options hashref and the arrayref of remaining arguments. Calls usage_error, which prints the usage and exits, on the first problem it finds, and returns 1 when everything checks out.
execute
Extracts or validates as asked, writing the prototype to -o or the summary to STDOUT.
Takes the parsed options hashref and the arrayref of remaining arguments, and returns 1.