Skip to content

Commit

Permalink
feat: Multivariate Anomaly Detection (#343)
Browse files Browse the repository at this point in the history
Additions:
- Beta VAE to balance the KLD and Log likelihood loss
- RobustMahalanobis Distance for multivariate thresholding
- Percentile based thresholding with aggregation
- Allow a tag suffix in docker workflow when using the github UI
- Exponential moving average in postprocess output
- Introduce pytests instead of unittests for newer test cases
- Improve synthetic anomaly generator module
- Per feature anomaly score when using certain thresholding models
- Score config for different feature and window aggreation methods

Removal:
- backtesting cli tool (since this will be added in a separate
backtesting tool UI)

---------

Signed-off-by: Avik Basu <[email protected]>
Co-authored-by: Kushal Batra <[email protected]>
  • Loading branch information
ab93 and s0nicboOm committed Feb 8, 2024
1 parent 4dbde41 commit d8bda0e
Show file tree
Hide file tree
Showing 43 changed files with 1,921 additions and 1,720 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
tags:
- v*
workflow_dispatch:
inputs:
extra_tag:
description: 'Tag suffix'
required: false
type: string

jobs:
build:
Expand All @@ -28,14 +33,23 @@ jobs:
QUAYIO_ORG: quay.io/numaio
PLATFORM: linux/x86_64
TARGET: numalogic/udf
TAG_SUFFIX: ${{ inputs.extra_tag }}
run: |
type=$(basename $(dirname $GITHUB_REF))
tag=$(basename $GITHUB_REF)
if [[ $type == "heads" ]]; then
tag="$(basename $GITHUB_REF)v${{ env.version }}"
fi
echo "Tag: $tag"
echo "Type: $type"
echo "Tag suffix: $TAG_SUFFIX"
if [[ -n $TAG_SUFFIX ]]; then
tag="$(basename $GITHUB_REF)-${TAG_SUFFIX}"
fi
image_name="${QUAYIO_ORG}/numalogic/udf:${tag}"
docker buildx build --platform ${PLATFORM} --build-arg INSTALL_EXTRAS='redis druid' --output "type=image,push=true" . -t $image_name
docker buildx build --platform ${PLATFORM} --build-arg INSTALL_EXTRAS='redis druid' --output "type=image,push=true" . -t $image_name
6 changes: 4 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ repos:
- id: black
language_version: python3.9
args: [--config=pyproject.toml, --diff, --color ]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.264'
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.14
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
- repo: https://github.com/adamchainz/blacken-docs
rev: "1.13.0"
hooks:
Expand Down
4 changes: 2 additions & 2 deletions numalogic/backtest/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from importlib.util import find_spec
from numalogic.backtest._prom import PromUnivarBacktester
from numalogic.backtest._prom import PromBacktester


def _validate_req_pkgs():
Expand All @@ -12,4 +12,4 @@ def _validate_req_pkgs():
_validate_req_pkgs()


__all__ = ["PromUnivarBacktester"]
__all__ = ["PromBacktester"]
106 changes: 0 additions & 106 deletions numalogic/backtest/__main__.py

This file was deleted.

50 changes: 0 additions & 50 deletions numalogic/backtest/_bt.py

This file was deleted.

90 changes: 0 additions & 90 deletions numalogic/backtest/_clifunc.py

This file was deleted.

Loading

0 comments on commit d8bda0e

Please sign in to comment.