Skip to content

Releases: emdgroup/baybe

0.15.0

11 Jun 13:54
3d22aed

Choose a tag to compare

What's Changed

Breaking Changes

  • GaussianProcessSurrogate no longer automatically adds a task kernel in multi-task
    scenarios. Custom kernel architectures must now explicitly include the task kernel,
    e.g. via ICMKernelFactory.
  • parameter_cartesian_prod_pandas and parameter_cartesian_prod_polars moved
    from baybe.searchspace.discrete to baybe.searchspace.utils
  • ContinuousLinearConstraint.to_botorch now returns a collection of constraint tuples
    instead of a single tuple (needed for interpoint constraints)
  • Kernel.to_gpytorch now takes a SearchSpace instead of explicit ard_num_dims,
    batch_shape and active_dims arguments, as kernels now automatically adjust this
    configuration to the given search space
  • KernelFactory now obeys the more general GPComponentFactoryProtocol

Added

  • Support for Python 3.14
  • Support for pandas 3
  • Settings class for unified and streamlined settings management
  • Settings options to (de-)activate recommendation caching / dataframe preprocessing
  • Settings option for random seed control
  • Gaussian process component factories
  • Support for GPyTorch objects (kernels, means, likelihood) as Gaussian process
    components, enabling full low-level customization
  • Configurable fitting criterion for Gaussian process hyperparameter optimization
  • Factories for all Gaussian process components
  • BOTORCH, CHEN, EDBO, EDBO_SMOOTHED and HVARFNER presets for
    GaussianProcessSurrogate
  • DiscreteBatchConstraint for ensuring all recommendations in a batch share
    the same value for a specified discrete parameter
  • Interpoint constraints for continuous search spaces
  • identify_non_dominated_configurations method to Campaign and Objective
    for determining the Pareto front
  • TypeSelector and NameSelector classes for parameter selection in kernel factories
  • parameter_names attribute to basic kernels for controlling the considered parameters
  • ParameterKind flag enum for classifying parameters by their role and automatic
    parameter kind validation in kernel factories
  • IndexKernel and PositiveIndexKernel classes
  • Addition and multiplication operators for kernel objects, enabling kernel
    composition via + (sum) and * (product), as well as constant * kernel
    for creating a ScaleKernel with a fixed output scale
  • Transfer learning benchmarks for shifted and inverted Hartmann functions
  • Coding convention instructions for agentic developers (AGENTS.md, CLAUDE.md)
  • has_polars_implementation property on DiscreteConstraint
  • allow_missing flag on DiscreteConstraint.get_invalid and get_valid
  • zizmor pre-commit hook for static analysis of GitHub Actions workflows

Changed

  • The BAYBE GP preset now dispatches between the CHEN preset (when a
    SubstanceParameter is present) and custom dimension-scaled Gamma priors (otherwise)
  • Default transfer learning kernel changed from IndexKernel to PositiveIndexKernel,
    enforcing positive task correlations
  • Discrete search space construction now applies constraints incrementally during
    Cartesian product building, significantly reducing memory usage and construction
    time for constrained spaces
  • "User Guide" section has been split into "Components" and "Concepts"
  • The Campaign.allow_* flag mechanism is now based on AutoBool logic, providing
    well-defined Boolean values at query time while exposing the AUTO option to the user
  • Polars path in discrete search space construction now builds the Cartesian product
    only for parameters involved in Polars-capable constraints, merging the rest
    incrementally via pandas
  • Minimum required pandas version increased to 2.1.0

Fixed

  • Broken cache validation for certain Campaign.recommend cases
  • ContinuousCardinalityConstraint now works in hybrid search spaces
  • SHAPInsight breaking with numpy>=2.4 due to no longer accepted implicit array to
    scalar conversion
  • Using np.isclose for assessing equality of Interval bounds instead of hard
    equality check
  • Typo in _FixedNumericalContinuousParameter where is_numeric was used
    instead of is_numerical

Removed

  • parallel_runs argument from simulate_scenarios, since parallelization
    can now be conveniently controlled via the new Settings mechanism
  • make_gp_from_preset utility function, since the same functionality is offered by
    GaussianProcessSurrogate.from_preset

Deprecations

  • BotorchRecommender.max_n_subspaces has been renamed to max_n_subsets
  • set_random_seed and temporary_seed utility functions
  • Using a custom kernel with GaussianProcessSurrogate in a multi-task context now
    raises a DeprecationError to alert users about the changed kernel logic. This can
    be suppressed by setting the BAYBE_DISABLE_CUSTOM_KERNEL_WARNING environment
    variable to a truthy value
  • The environment variables
    BAYBE_NUMPY_USE_SINGLE_PRECISION/BAYBE_TORCH_USE_SINGLE_PRECISION have been
    replaced with the variables
    BAYBE_USE_SINGLE_PRECISION_NUMPY/BAYBE_USE_SINGLE_PRECISION_TORCH linked to the
    corresponding use_single_precision_numpy/use_single_precision_torch attributes of
    the new Settings class
  • The environment variable BAYBE_DEACTIVATE_POLARS has been replaced with
    BAYBE_USE_POLARS linked to the use_polars attribute of the new Settings class
  • The environment variable BAYBE_PARALLEL_SIMULATION_RUNS has been replaced with
    BAYBE_PARALLELIZE_SIMULATION_RUNS linked to the parallelize_simulation_runs
    attribute of the new Settings class

Expired Deprecations (from 0.11.*)

  • register_custom_architecture decorator
  • BayesianRecommender.surrogate_model attribute
  • ContinuousLinearEqualityConstraint/ContinuousLinearInequalityConstraint classes

Merged Pull Requests

Read more

0.14.3

10 Feb 15:56
c9d528c

Choose a tag to compare

What's Changed

Fixed

  • Deserialization of NumericalTarget objects using the optional constructor field
  • Broken cache validation for certain Campaign.recommend cases

Merged Pull Requests

Full Changelog: 0.14.2...0.14.3

0.14.2

14 Jan 12:25
05dcec0

Choose a tag to compare

What's Changed

Added

  • NumericalTarget.match_* constructors now accept a mismatch_instead argument. If
    set to True, targets seek to avoid the given match_value instead of matching it
  • NumericalTarget.match_* constructors now accept a match_mode argument. While "="
    corresponds to traditional set point matching, values ">=" and "<=" indicate that
    the entire associated interval is a valid match, resulting in identical transformed
    target values as for the match_value itself
  • NumericalTarget.normalized_ramp and NumericalTarget.normalized_sigmoid
    constructors now accept a minimize argument for controlling the optimization
    direction of the target
  • NumericalTarget.constructor_info property, which returns what constructor and
    arguments were used to create the object
  • NumericalTarget.from_constructor_info convenience constructor for creating a
    target from existing constructor details
  • Transfer learning regression benchmarks infrastructure for evaluating TL model
    performance on regression tasks (direct arylation and aryl halide)
  • Scalar addition and subtraction for Interval objects
  • Methods hshift and vshift to Transformation for conveniently performing
    horizontal / vertical shifts
  • Objective.to_botorch_posterior_transform for use of affine transformations with
    analytical acquisition functions
  • DesirabilityObjective.normalized_weights property
  • Possibility to set n_mc_iterations to None in simulate_scenarios, which
    increments the simulation random seed per initial data set without having to execute
    the full Cartesian product of all (seed, data)-configurations
  • Campaign.posterior and Surrogate.posterior now accept a joint argument

Changed

  • Creating one-element composite transformations now returns the contained
    transformation directly
  • Dataframe-to-tensor conversion now yields contiguous tensors, improving
    reproducibility of downstream operations

Fixed

  • Random seed not entering simulation when explicitly passed to simulate_scenarios
  • DesirabilityObjective now properly interplays with analytical acquisition functions
  • farthest_point_sampling now correctly handles predefined initialization indices
  • SearchSpace.from_dataframe now validates that dataframes contain only
    active_values, raising IncompatibilityError otherwise
  • False-negative surrogate cache hits when using multi-model surrogates
  • IndependentGaussianSurrogate models now properly refuse batch recommendation
    regardless of their context (e.g. when used within a CompositeSurrogate)
  • CompositeSurrogate models are now fit on the correct input when using
    pre-transformations in the objective
  • IndependentGaussianSurrogate models now correctly reject batch posterior evaluations
    by throwing an IncompatibleSurrogateError. This means that .posterior calls that
    worked previously may now require an explicit joint=False argument.

Removed

  • AffinePosteriorTransformation class (since BoTorch provides equivalent functionality)
  • InvalidSurrogateModelError exception because there already exists a more appropriate
    IncompatibleSurrogateError exception

Merged Pull Requests

Full Changelog: 0.14.1...0.14.2

0.14.1

30 Sep 23:34
abe80d3

Choose a tag to compare

What's Changed

Added

  • to_json and from_json methods now also natively support (de)serialization to/from
    files and file-like objects

Changed

  • Instead of requiring already read string representations of json files, .from_json
    now also supports file paths as argument and will read the file itself
  • from_json now strictly expects the source as a positional argument
  • to_json now accepts kwargs and passes them to json.dumps

Fixed

  • Crash in simulate_experiment when calculating cumulative best values for
    batch_size>1
  • Campaign.allow_* flags now properly take into account recommendation caching
  • The campaign recommendation cache is now properly invalidated during context changes

Merged Pull Requests

Full Changelog: 0.14.0...0.14.1

0.14.0

10 Sep 15:28
65d3986

Choose a tag to compare

What's Changed

Added

  • transformations subpackage
  • New NumericalTarget interface, including advanced machinery for defining and
    manipulating target transformations based on the new Transformation class hierarchy
  • match_bell and match_triangular convenience constructors to NumericalTarget
    for reproducing the legacy MATCH modes
  • normalized_ramp convenience constructor to NumericalTarget for reproducing the
    legacy behavior when imposing bounds on MIN/MAX targets
  • normalized_sigmoid, match_absolute, match_quadratic and match_power
    convenience constructors to NumericalTarget enabling additional matching/normalizing
    behaviors
  • Full support for accessing posterior information of NumericalTarget, i.e. now
    including settings considered MATCH mode in the legacy interface, as well as targets
    used in DesirabilityObjective
  • as_pre_transformation flag to DesirabilityObjective for controlling whether the
    desirability transformation is applied before or after model fitting
  • supports_partial_measurements property to Objective
  • is_normalized property to NumericalTarget
  • negate, normalize, abs, clamp, log, exp and power methods to
    NumericalTarget for easy creation of transformed targets from existing ones
  • Addition and multiplication dunder methods (for scalar values) to NumericalTarget
  • get_image method to NumericalTarget for computing the images of transformed
    target value ranges
  • Support for non-normalized targets in DesirabilityObjective
  • Objective.to_botorch method for converting objectives to BoTorch
  • qEHVI and qLogEHVI acquisition functions (in addition to their noisy variants)
  • Tests for migrating to new NumericalTarget interface
  • API diagram in user guide
  • Metadata and MeasurableMetadata classes providing optional information for BayBE
    objects
  • Objective now has a metadata attribute as well as a description property
  • Target and Parameter now have a metadata attribute as well as description and
    unit properties
  • FPSRecommender now optionally uses the fpsample library (if installed) with fallback
    to internal implementation. The use of fpsample can be deactivated by setting the
    environment variable BAYBE_USE_FPSAMPLE
  • farthest_point_sampling now also supports a collection of integers for
    initialization, using them for pre-selecting points
  • Benchmarks can now run in different modes, store detailed machine information, and
    local usage got new file naming and execution options

Changed

  • The behavior of NumericalTarget is no longer defined via a mode (i.e. MIN,
    MAX, MATCH in legacy interface) but controlled using a minimization flag and
    corresponding target transformations. This allows for more flexible target
    definitions, makes invalid target configurations unrepresentable, and is in line with
    the definition of mathematical optimization problems. Also, it avoids the need to
    explicitly specify an irrelevant optimization direction in the context of active
    learning.
  • By default, DesirabilityObjective now fits separate models for each target, rather
    than modeling only the scalarized desirability value (see new
    DesirabilityObjective.as_pre_transformation flag). As a result, posterior
    evaluations now return information for each target individually, instead of just for
    the desirability value.
  • Objective transformations (both tensor and dataframe based) now always use the Torch
    computation route, avoiding the need for duplicated transformation logic
  • Specifying bounds for Interval is now optional
  • unstructure_base and get_base_structure_hook (de-)serialization utilities
    have been replaced with unstructure_with_type and make_base_structure_hook

Fixed

  • It is no longer possible to use identical names between parameters and targets
  • Random seed context is correctly set within benchmarks
  • Measurement input validation now respects typical tolerances associated with floating
    point representation inaccuracy
  • Exotic serialization issues with constraints and conditions arising from missing
    converters for floats
  • MetaRecommender's no longer expose their private attributes via the constructor

Removed

  • Telemetry
  • Option to specify reference values for add_fake_measurements
  • convert_bounds utility (since now equivalent to Interval.create)
  • geom_mean utility

Deprecations

  • Creating NumericalTargets using a mode argument
  • TargetMode and TargetTransformation enums
  • linear_transform, triangular_transform and bell_transform functions

Expired Deprecations (from 0.10.*)

  • SequentialGreedyRecommender class
  • SubspaceContinuous.samples_random method
  • SubspaceContinuous.samples_full_factorial method
  • data argument to transform method of search space classes
  • Automatically setting allow_extra=True in transform methods of search space
    classes when left unspecified

Merged Pull Requests

New Contributors

Full Changelog: 0.13.2...0.14.0

0.13.2

09 Jul 12:25
5e9e3dc

Choose a tag to compare

What's Changed

Changed

  • Lockfiles are now generated using uv lock and consumed using uv sync

Fixed

  • The Python version specifier now also allows patch versions of Python 3.13

Merged Pull Requests

New Contributors

Full Changelog: 0.13.1...0.13.2

0.13.1

06 Jun 12:24
a56d418

Choose a tag to compare

What's Changed

Added

  • Support for Python 3.13
  • random_tie_break flag to farthest_point_sampling to toggle between
    random or deterministic sampling for equidistant cases
  • random_tie_break and initialization attributes to FPSRecommender to
    control sampling in farthest_point_sampling
  • Flag for toggling parallel computation in simulate_scenarios
  • Additional transfer learning and synthetic benchmarks
  • Utility normalize_input_dtypes for ensuring all input dataframe columns have the
    expected dtypes
  • CompositeSurrogate now has a _posterior_comp method similar to Surrogate
  • SHAPInsight.explain_target method for computing explanations for only a specific
    target

Changed

  • CategoricalParameter and TaskParameter now also allow Boolean entries as
    values and active_values
  • SubspaceDiscrete.from_dataframe now handles purely Boolean columns differently,
    inferring a CategoricalParameter with INT encoding for them
  • SHAPInsight.explain now returns a tuple of explanations that contains one
    explanation for each surrogate model used by the (possibly multi-output) objective
  • SHAPInsight.plot now has the optional target_index argument, enabling users to
    select for which target they want to plot the shap assessment (default is the first
    target)
  • add_measurements, update_measurements, fuzzy_row_match and some .recommend
    calls now operate on dtype-normalized copies of the input if it contained unexpected
    dtypes for a parameter or target
  • scikit-learn and scipy are now lazy-loaded
  • Validity of optional model_params attribute of RandomForestSurrogate,
    NGBoostSurrogate and BayesianLinearSurrogate is now checked via a hardcoded
    TypedDict instead of dynamically retrieved specifications, required for
    lazy-loading related packages
  • CustomONNXSurrogate.onnx_str is no longer validated before being used

Fixed

  • Using PosteriorStandardDeviation with MIN targets no longer results in
    minimization of the acquisition function
  • Added missing garbage collection call to pareto.py, potentially solving
    serialization issues in certain cases
  • catch_constant_targets decorator is now properly typed
  • Incorrect normalization of explanation shapes for SHAPInsight

Removed

  • SHAPInsight.uses_shap_explainer

Merged Pull Requests

New Contributors

Full Changelog: 0.13.0...0.13.1

0.13.0

16 Apr 10:22
b1ac334

Choose a tag to compare

What's Changed

Added

  • extras group for installing all dependencies required for optional features
  • Support for NumPy 2.0+
  • ParetoObjective class for Pareto optimization of multiple targets and corresponding
    qNoisyExpectedHypervolumeImprovement / qLogNoisyExpectedHypervolumeImprovement /
    qLogNParEGO acquisition functions
  • Composite surrogates now drop rows containing NaNs (separately for each target),
    effectively enabling partial measurements
  • SubstanceParameter, CustomDiscreteParameter and CategoricalParameter now also
    support restricting the search space via active_values, while values continue to
    identify allowed measurement inputs
  • Campaign.posterior_stats and Surrogate.posterior_stats as convenience methods for
    providing statistical measures about the target predictions of a given set of
    candidates
  • acquisition_values and joint_acquisition_value convenience methods to
    Campaign and BayesianRecommender for computing acquisition values
  • Campaign.get_acquisition_function and BayesianRecommender.get_acquisition_function
    convenience methods for retrieving the underlying acquisition function
  • AcquisitionFunction.evaluate convenience method for computing acquisition values
    from candidates in experimental representation
  • qPSTD acquisition function
  • BCUT2D encoding for SubstanceParameter
  • SHAPInsight now supports the waterfall plot type
  • Cardinality constraints sections to the user guide
  • ContinuousCardinalityConstraint is now compatible with BotorchRecommender
  • Attribute max_n_subspaces to BotorchRecommender, allowing to control
    optimization behavior in the presence of cardinality constraints
  • Surrogate.replicate method for making single-target surrogate models multi-target
    compatible
  • CompositeSurrogate class for composing multi-target surrogates from single-target
    surrogates
  • is_multi_output attribute to Objective
  • supports_multi_output attribute/property to Surrogate/AcquisitionFunction
  • n_outputs property to Objective
  • Attribute relative_threshold and method get_absolute_thresholds to
    ContinuousCardinalityConstraint for handling inactivity ranges
  • Utilities inactive_parameter_combinations andn_inactive_parameter_combinations
    to both ContinuousCardinalityConstraintand SubspaceContinuous for iterating
    over cardinality-constrained parameter sets
  • Utilities activate_parameter and is_cardinality_fulfilled for enforcing and
    validating cardinality constraints
  • Utility is_inactive for determining if parameters are inactive
  • A MinimumCardinalityViolatedWarning is triggered when minimum cardinality
    constraints are violated
  • Stored benchmarking results now include the Python environment and version

Changed

  • Targets are now allowed to contain NaN, deferring potential failure to attempted
    recommendation instead of data ingestion
  • For label-like parameters, SubspaceDiscrete now only includes parameter values
    that are in active_values
  • The default value for sequential_continuous in BotorchRecommender has been
    changed to True
  • SHAPInsight now allows explanation input that has additional columns compared to
    the background data (will be ignored)
  • Acquisition function indicator is_mc has been removed in favor of new indicators
    supports_batching and supports_pending_experiments
  • fuzzy_row_match now uses vectorized operations, resulting in a speedup of matching
    measurements to the search space between 4x and 40x
  • Model scaling now uses the parameter bounds instead of the search space bounds
  • benchmarks module now accepts a list of domains to be executed
  • Construction of BoTorch acquisition functions has been redesigned from ground up
  • ngboost is now an optional dependency
  • setuptools-scm is now an optional dependency, used for improved version inference
  • create_example_plots, to_string and indent have been relocated within utils

Fixed

  • Incorrect optimization direction with PSTD with a single minimization target
  • Provide version fallback in case scm fails to infer version during installation

Removed

  • fuzzy_row_match will no longer warn about entries not matching to the search space
  • funcy dependency
  • scikit-learn-extra dependency by integrating relevant code parts into baybe

Expired Deprecations (from 0.9.*)

  • baybe.objective namespace
  • acquisition_function_cls constructor parameter for BayesianRecommender
  • VarUCB and qVarUCB acquisition functions

Merged Pull Requests

New Contributors

Full Changelog: 0.12.2...0.13.0

0.12.2

31 Jan 12:20
daaf4d1

Choose a tag to compare

What's Changed

Changed

  • More robust settings for the GP fitting

Merged Pull Requests

Full Changelog: 0.12.1...0.12.2

0.12.1

29 Jan 14:55
fb6e7d8

Choose a tag to compare

Hotfix Release

Full Changelog: 0.12.0...0.12.1