NAME

Algorithm::Classifier::IsolationForest::App::Command::set_voting - Switch a saved model between mean and majority voting

DESCRIPTION

Switches a saved model's scoring-time aggregation between mean and majority and writes it back -- in place over -m by default, or to -o.

The forest itself is aggregation-independent, so no tree is rebuilt. The one thing that does not carry over is a contamination-learned decision threshold: it is a quantile of whichever per-point quantity the mode thresholds against -- the averaged anomaly score under mean, the per-tree majority pivot under majority -- so switching relearns it for the target mode. That recalibration needs the original training data, supplied as a CSV via -i. A model fit without contamination carries no threshold and switches without -i.

Run it as iforest set_voting; iforest help set_voting 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 set_voting prints under the option list.

validate

Checks the parsed options before anything is read or written, so a mistake costs nothing.

Checks that -m names a readable model, that --voting is mean or majority, that -i (when given) is readable, and that -o does not already exist unless -w was 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

Loads the model, switches its aggregation, recalibrating the threshold from -i when the model needs it, and writes the model back.

Takes the parsed options hashref and the arrayref of remaining arguments, and returns 1.