ceif)ceif is a high-performance command-line utility for anomaly detection and categorization based on the Extended Isolation Forest (EIF) algorithm by Hariri et al..
It is designed for automated production environments, cron jobs, and Unix shell pipelines where diverse datasets must be monitored efficiently without the overhead or dependency footprint of large machine learning frameworks.
-C): Input data fields can serve as category keys. ceif partitions categories automatically, training and evaluating independent forests per category within a single process.-L): Designate non-numeric identifiers (e.g., timestamps, UUIDs, hostnames) as labels to identify anomalous records easily in output streams.-w, -r, -z): Models are saved in standard JSON format by default (with CSV fallback when compiled without JSON-C), preserving calibration parameters, expressions, and sample reservoirs.-z) with Automatic Reservoir Ceiling: Models continuously ingest new batches of samples using reservoir sampling. An automatic ceiling (EXTRA_ROWS_FACTOR 3) caps historical extra rows, guaranteeing a minimum 25% acceptance probability for incoming data to prevent long-running models from freezing.-Q): Transform input dimensions on the fly using arithmetic and mathematical expressions (via tinyexpr).0 = clean, 2 = anomalies detected) for native integration with shell scripts, cron, tail -F, and logger.Comprehensive documentation is available in the docs/ directory:
~/.ceifrc, -g), rc-file parameters, and usage examples.json-c), package manager installation across distributions, and compilation.-O 0.5s), percentile thresholds, novelty detection (-O 100%), handling complex topologies (NEAREST 1), and attribute contribution analysis (%e).-z), multi-tenant tracking (-C), stream piping, and population drift detection (-O 80% -v).ceif incorporates key enhancements over the canonical Extended Isolation Forest algorithm:
The canonical EIF selects intercept points $p$ uniformly from a rectangular bounding box. When data is uniformly distributed or non-convex, subspaces extending to infinity frequently contain sample points, driving anomaly scores toward ~0.5 across the entire space and causing artifact inliers.
To resolve this, ceif uses Pairwise Split Point Selection:
At leaf nodes, ceif evaluates the relative distance between the analyzed point and the nearest training data point in the node (NEAREST 1, default). The distance is normalized against the average sample distance within the tree. If the distance is larger than average, the anomaly score is incremented; if smaller, it is reduced. This allows ceif to cleanly isolate interior voids, rings, and complex manifold shapes.
70 commits
33 commits
C
97.9%
Python
1.2%
ceif)ceif is a high-performance command-line utility for anomaly detection and categorization based on the Extended Isolation Forest (EIF) algorithm by Hariri et al..
It is designed for automated production environments, cron jobs, and Unix shell pipelines where diverse datasets must be monitored efficiently without the overhead or dependency footprint of large machine learning frameworks.
-C): Input data fields can serve as category keys. ceif partitions categories automatically, training and evaluating independent forests per category within a single process.-L): Designate non-numeric identifiers (e.g., timestamps, UUIDs, hostnames) as labels to identify anomalous records easily in output streams.-w, -r, -z): Models are saved in standard JSON format by default (with CSV fallback when compiled without JSON-C), preserving calibration parameters, expressions, and sample reservoirs.-z) with Automatic Reservoir Ceiling: Models continuously ingest new batches of samples using reservoir sampling. An automatic ceiling (EXTRA_ROWS_FACTOR 3) caps historical extra rows, guaranteeing a minimum 25% acceptance probability for incoming data to prevent long-running models from freezing.-Q): Transform input dimensions on the fly using arithmetic and mathematical expressions (via tinyexpr).0 = clean, 2 = anomalies detected) for native integration with shell scripts, cron, tail -F, and logger.Comprehensive documentation is available in the docs/ directory:
~/.ceifrc, -g), rc-file parameters, and usage examples.json-c), package manager installation across distributions, and compilation.-O 0.5s), percentile thresholds, novelty detection (-O 100%), handling complex topologies (NEAREST 1), and attribute contribution analysis (%e).-z), multi-tenant tracking (-C), stream piping, and population drift detection (-O 80% -v).ceif incorporates key enhancements over the canonical Extended Isolation Forest algorithm:
The canonical EIF selects intercept points $p$ uniformly from a rectangular bounding box. When data is uniformly distributed or non-convex, subspaces extending to infinity frequently contain sample points, driving anomaly scores toward ~0.5 across the entire space and causing artifact inliers.
To resolve this, ceif uses Pairwise Split Point Selection:
At leaf nodes, ceif evaluates the relative distance between the analyzed point and the nearest training data point in the node (NEAREST 1, default). The distance is normalized against the average sample distance within the tree. If the distance is larger than average, the anomaly score is incremented; if smaller, it is reduced. This allows ceif to cleanly isolate interior voids, rings, and complex manifold shapes.
70 commits
33 commits
C
97.9%
Python
1.2%