Quickstart¶
This project is implemented and managed using UV environment, which is an extremely fast Python package and project manager, written in Rust.
Step-1: Install uv
Follow the official Astral installation documentation to install uv.
Step-2: Install osbad from PyPi
Creates a new project folder named
osbadwith a basicpyproject.tomlandREADME.mdand switch into the project directory on your terminal.Create a uv virtual environment within the project directory.
Add the
osbaddependency by runninguv add osbad. This step updates yourpyproject.tomlunder[project].dependencies.Generate a lockfile which pins exact versions of all dependencies for reproducibility.
Sync dependencies by installing all dependencies listed in
uv.lockand ensures your virtual environment matches the locked versions.
# Initialize a new project
uv init osbad
# Switch into the project directory
cd osbad
# Create a uv virtual environment within the project directory
uv venv
# Add the osbad dependency
uv add osbad
# Generate a Lockfile
uv lock
# Sync Dependencies
uv sync
# Clone the osbad repository to access the example notebooks and scripts
git clone git@github.com:meichinpang/osbad.git
To test osbad installation, replace the script in main.py with
# Test osbad installation:
# osbad for open-source benchmark of anomaly detection
from importlib.metadata import version
import osbad
def main():
print("Hello from osbad!")
osbad_current_version = version("osbad")
print(f"osbad current version: {osbad_current_version}")
print(f"OSBAD package installation is successful!")
if __name__ == "__main__":
main()
On your terminal where main.py is located, run
# Execute the python script with uv run
uv run main.py
Typical Workflow¶
Load the benchmarking dataset and features database
For unsupervised ML models, run hyperparameter tuning using Bayesian optimization.
Train models with best trial hyperparameters
Evaluate with model performance with confusion matrix and model performance KPI such as accuracy, precision, recall, F1-score and Matthew correlation coefficient.
Next Steps¶
See Datasets Guide
Explore Models Guide