Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ALF alf-core

PyPI Python Version License Coverage Docs

The lightweight, dependency-minimal foundation of ALF (Active Learning Framework).

alf-core provides the base classes, core data structures, and the active-learning loop for iterative optimisation in computational science — optimising high-dimensional, combinatorially vast search spaces where each label is expensive (wet-lab assays, simulations, measurements). It ships with no ML-framework dependencies (only numpy, pandas, scipy), so it is standalone and domain-agnostic. For ready-to-use models, datasets, and acquisition functions, install alf-tools.

ALF Components

Installation

pip install alf-core

Quick start

alf-core is the framework layer: you supply your own BaseDataset and BaseModel subclasses (or install alf-tools for ready-made ones), then wire them into the active-learning loop.

from alf_core import (
    DatasetSearch,
    DesignTask,
    Optimizer,
    Oracle,
    Surrogate,
    TerminalStateLogger,
)

# Bring your own BaseDataset, BaseModel, and AcquisitionFunction subclasses
dataset = MyDataset(...)
surrogate = Surrogate(model=MyModel())
optimizer = Optimizer(acquisition_fn=MyAcquisition(), search_fn=DatasetSearch())
oracle = Oracle(scorer=dataset)

# Run the active-learning loop for 5 rounds, acquiring 100 candidates per round
task = DesignTask(num_acq_rounds=5, acq_batch_size=100)
state = task.setup(dataset=dataset, surrogate=surrogate)
task.run(
    state=state,
    state_loggers=[TerminalStateLogger()],
    optimizer=optimizer,
    oracle=oracle,
)

For a complete, runnable alf-core-only example (a bootstrap-ensemble surrogate and a Probability of Improvement acquisition function built from scratch with numpy/scipy), see the ALF Core Quickstart notebook.

Key concepts

ALF runs the active-learning loop over a small set of swappable components:

  • Dataset (BaseDataset) — loads, splits, and queries candidate data
  • Model (BaseModel) — the surrogate/oracle/generator backbone you implement
  • Surrogate (Surrogate) — wraps a model to predict fitness and uncertainty
  • Oracle (Oracle) — returns ground-truth labels (offline pool or live scorer)
  • Optimizer (Optimizer) — proposes the next batch via acquisition + search
  • Acquisition function (AcquisitionFunction) — scores candidates to acquire
  • Search strategy (BaseSearch) — defines the candidate pool to score
  • State (State) — tracks rounds, history, and metrics across the loop
  • Tasks (DesignTask, SupervisedTask, ZeroShotTask) — drive the multi-round loop, fixed-data training, or no-train evaluation

Documentation

License

Apache License 2.0 — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alf_core-0.1.0b0.tar.gz (47.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alf_core-0.1.0b0-py3-none-any.whl (67.2 kB view details)

Uploaded Python 3

File details

Details for the file alf_core-0.1.0b0.tar.gz.

File metadata

  • Download URL: alf_core-0.1.0b0.tar.gz
  • Upload date:
  • Size: 47.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for alf_core-0.1.0b0.tar.gz
Algorithm Hash digest
SHA256 c492dadcda8a7e0c2900af1a69309bebdf619ca91b57a5e335234d810dd5293f
MD5 b11780c1875eb18c8319ae15d884adf9
BLAKE2b-256 6a54a49d0651c84589c9d4ff85e143772e23d3280ce235809a25a5584b471980

See more details on using hashes here.

File details

Details for the file alf_core-0.1.0b0-py3-none-any.whl.

File metadata

  • Download URL: alf_core-0.1.0b0-py3-none-any.whl
  • Upload date:
  • Size: 67.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for alf_core-0.1.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 94e9a96accd55645e892b920c862ad4290b1639789616bafaea62f8b9eb4e767
MD5 cd9ee91d21128022c658c90cd87e52c0
BLAKE2b-256 8fe1607ea20cf1f9701519e63f7f27709bb20ce8ea0222090c9574d610b2e512

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0b0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page