Tpcp

Latest version: v2.0.0

Safety actively analyzes 693883 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 9

0.22.1

Fixed
- The `safe_optimize` parameter of `GridSearchCV` is now correctly used during reoptimization.
Before, it was only forwarded to the `Optimize` wrapper during the actual Grid-Search, but not during the final
reoptimization.

0.22.0

Added

- Official support for tensorflow/keras. The custom hash function now manages tensorflow models explicitly.
This makes it possible again to use the `make_action_safe` and `make_optimize_safe` decorators with algorithms and
pipelines that have tensorflow/keras models as parameters.
(https://github.com/mad-lab-fau/tpcp/pull/87)
- Added a new example for tensorflow/keras models.
(https://github.com/mad-lab-fau/tpcp/pull/87)

0.21.0

YANKED RELEASE

0.20.1

Fixed

- Fixed regression introduced in 0.19.0, which resulted in optimizers not beeing correctly cloned per fold.
In result, each CV fold would overwrite the optimizer object of the previous fold.
This did not affect the reported results, but the returned optimizer object was not the one that was used to calculate
the results.

0.20.0

Changed

- **BREAKING CHANGE**: The way how all Optuna based optimizer work has been changed.
Instead of passing a function, that returns a study, you now need to pass a function that returns the parameters of a
study.
Creating the study is now handled by tpcp internally to avoid issues with multiprocessing.
This results in two changes.
The parameter name for all optuna pipelines has changed from `create_study` to `get_study_params`.
Further, the expected call signature changed, as `get_study_params` now gets a seed as argument.
This seed should be used to initialize the random number generator of the sampler and pruner of a study to ensure
that each process gets a different seed and sampling process.
(https://github.com/mad-lab-fau/tpcp/pull/80)

To migrate your code, you need to change the following:

OLD:

python
def create_study():
return optuna.create_study(sampler=RandomSampler(seed=42))

OptunaSearch(..., create_study=create_study, ...)


NEW:

python
def get_study_params(seed: int):
return dict(sampler=RandomSampler(seed=seed))

OptunaSearch(..., get_study_params=get_study_params, random_seed=42, ...)

0.19.0

Added

- All optimization methods that do complicated loops (over parameters or CV-Folds) now raise new custom error messages
(OptimizationError and TestError) if they encounter an error.
These new errors have further information in which iteration of the loop the error occurred and should make it easier
to debug issues.
- When a scorer fails, we now print the name (i.e. the group) of the datapoint that caused the error.
This should make it easier to debug issues with the scorer.

Changed

- We dropped support for joblib<0.13.0. due to some changes in the API. We only support the new API now, which allowed
us to simplify some of the multiprocessing code.

Page 5 of 9

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.