NAME

Algorithm::Classifier::IsolationForest::App::Command::gblob - Generates a gaussian blob of points.

DESCRIPTION

Generates a synthetic dataset: a Gaussian cluster of normal points plus a handful of outliers placed away from it, as CSV. Useful for exercising the other commands without needing real data, and for the examples in the documentation.

Seeding with -s makes a blob reproducible.

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

validate

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

Checks that -s, -n and -D are sane numbers.

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

Writes the generated CSV to -o, or to STDOUT.

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

gaussian

One draw from a normal distribution, via Box-Muller.

Takes the distribution's mean and standard deviation, and returns a single value -- typically within four standard deviations of the mean. It consumes two rand() draws, so seeding once with -s makes a whole blob reproducible.

my $v = gaussian( 0, 1 );