NAME

Algorithm::Classifier::IsolationForest::App::Command::streamc - Client for iforest streamd: stream rows through it or send it commands

DESCRIPTION

The client half of iforest streamd, so neither hand-rolled JSON nor a socket tool is needed to talk to a daemon.

In stream mode it reads rows from -i and sends them in batches of --batch, printing $score,$label lines as replies arrive. Input is positional CSV by default -- numeric-looking fields travel as JSON numbers, everything else as strings for the daemon's munger plan -- or one JSON row per line under --jsonl, which is what unlocks tagged rows and the full munger plan from a shell pipeline.

In command mode -- --ping, --stats, --save or --relearn-threshold -- it sends the one command and prints the answer. --ping is driven by its exit code, so it works as a health check.

Errors from either side name the input line that caused them.

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

validate

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

Checks that --set is a usable instance name, that -i is not combined with a command switch, that -i and -o are usable, that --mode names a valid mode, that -d and --json are only used where they apply, and that --batch and --timeout are positive.

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

Connects to the daemon's socket and runs either the command or the stream, depending on which switches were given.

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