Tpcp

Latest version: v2.0.0

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

Scan your dependencies

Page 6 of 9

0.18.0

Fixed
- When `super().__init__()` is called before all parameters of the child class are initialized, we don't get an error
anymore.
Now all classes remember their parameters when they are defined and don't try to access parameters that are not
defined in their own init.
(https://github.com/mad-lab-fau/tpcp/pull/69)

Changed
- Validation is now performed recursively on all subclasses. Note like before validation is still only performed once
per class.
But with this change, we can also validate base classes that are not used directly.
(https://github.com/mad-lab-fau/tpcp/pull/70)

Added
- We validate now, if a child class implements all the parameters of its parent class.
While not strictly necessary, this is a sign of bad design, if not done.
It could also lead to issues with tpcps validation logic.
(https://github.com/mad-lab-fau/tpcp/pull/70)
- It is now possible to hook into the validation and perform custom validation of classes.
(https://github.com/mad-lab-fau/tpcp/pull/70)
- The dataset class now activly triggers validation and checks if the dataset subclass implements `groupby_cols` and
`subset_index`.

0.17.0

Added
- We now have a workaround for global configuration that should be passed to worker processes when using
multiprocessing.
This is a workaround to a [joblib issue](https://github.com/joblib/joblib/issues/1071) and is quite hacky.
If you want to use this feature with your own configs you can use `tpcp.parallel.register_global_parallel_callback`.
If you need to write your own parallel loop using joblib, you need to use `tpcp.parallel.delayed` instead of
`joblib.delayed`.
(https://github.com/mad-lab-fau/tpcp/pull/65)

0.16.0

Changed
- We are now raising an explicit ValidationError, if any of the parameters of a class have a trailing underscore, as
this syntax is reserved for result objects.
(https://github.com/mad-lab-fau/tpcp/pull/63)

Added
- The Optuna search methods have new parameter called `eval_str_paras` that allows to automatically turn categorical
string parameters into python objects.
This can be usefull, if you want to select between complex objects and not just strings in your parameter search.
To use this in your subclasses, you need to wrap the use of `trial.params` with `self.sanitize_params(trial.params)`.
(https://github.com/mad-lab-fau/tpcp/pull/64)

0.15.0

Added
- GridSearch and GridSearchCV now have the option to pick the parameters with the lowest score if desired.
This is useful, if your metric represents an error and you want to pick the parameters that minimize the error.
To do that, you can set the `return_optimized` parameter of these classes to the name of metric prefixed with a `-`.
(e.g. `return_optimized="-rmse"`).
(https://github.com/mad-lab-fau/tpcp/pull/61)
- A new Optimization Algorithm called `OptunaSearch`. This is a (nearly) drop-in replacement for `GridSearch` using
Optuna under the hood.
It can be used to quickly implement parameter searches with different samplers for non-optimizable algorithms.
(https://github.com/mad-lab-fau/tpcp/pull/57)

Changed
- In this release we added multiple safe guards against edge cases related to non-deterministic dataset indices.
Most of these changes are internal and should not require any changes to your code.
Still, they don't solve all edge cases. Make sure your index is deterministic ;)
(https://github.com/mad-lab-fau/tpcp/pull/62)
- The index of datasets objects are now cached
The first time `create_index` is called, the index is stored in `subset_index` and used for subsequent calls.
This should avoid the overhead of creating the index every time (in particular if the index creation requires IO).
It should also help to avoid edge cases, where `create_index` is called multiple times and returns different results.
- When `create_index` of a dataset is called, we actually call it twice now, to check if the index is deterministic.
Having a non-deterministic index can lead to hard to debug issues, so we want to make sure that this is not the case.
It could still be that the index changes when using a different machine/OS (which is not ideal for reproducibility),
but this should prevent most cases leading to strange issues.
- Internally, the `_optimize_and_score` method now directly gets the subset of the dataset, instead of the indices of
the train and test set.
This should again help to avoid issues, where the index of the dataset changes between calculating the splits and
actually retrieving the data.

0.14.0

Added
- Custom Aggregators can now use the `RETURN_RAW_SCORES` class variable to specify, if their raw input scores should be
returned.
(https://github.com/mad-lab-fau/tpcp/pull/58)

Fixed
- GridSearch and GridSearchCV now correctly handle custom aggregators that return scores with new names.
(https://github.com/mad-lab-fau/tpcp/pull/58)
- When using the `create_group_labels` method on dataset with multiple groupby columns, the method returned a list of
tuples.
This caused issues with `GroupKFold`, as the method internally flattens the list of tuples.
To avoid this, the method now return a list of strings.
The respective string is simply the string representation of the tuple that was returned before.
(https://github.com/mad-lab-fau/tpcp/pull/59)
- The fix provided in 0.12.1 to fix hashing of objects defined in the `__main__` module was only partially working.
When the object in question was nested in another object, the hashing would still fail.
This is hopefully now fixed for good.
(https://github.com/mad-lab-fau/tpcp/pull/60)

0.13.0

Changed
- Some improvements to the documentation

Added
- Added an option to the optuna search to use multiprocessing using the suggestions made in
https://github.com/optuna/optuna/issues/2862 .
This has not been extensively tested in real projects.
Therefore, use with care and please report any issues you encounter.

Deprecated
- Fully deprecated the `_skip_validation` parameter for base classes, which was briefly used for some old versions.

Page 6 of 9

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.