Tpcp

Latest version: v2.0.0

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

Scan your dependencies

Page 8 of 9

0.9.0

This release drops Python 3.7 support!

Added
- Bunch new high-level documentation
- Added submission version of JOSS paper

Changed
- The `aggregate` methods of custom aggregators now gets the list of datapoints in additions to the scores.
Both parameters are now passed as keyword only arguments.

0.8.0

Added
- An example on how to use the `dataclass` decorator with tpcp classes. (https://github.com/mad-lab-fau/tpcp/pull/41)
- In case you need complex aggregations of scores across data points, you can now wrap the return values of score
functions in custom `Aggregators`.
The best plac eto learn about this feature is the new "Custom Scorer" example.
(https://github.com/mad-lab-fau/tpcp/pull/42)
- All cross_validation based methods now have a new parameter called `mock_labels`.
This can be used to provide a "y" value to the split method of a sklearn-cv splitter.
This is required e.g. for Stratified KFold splitters.
(https://github.com/mad-lab-fau/tpcp/pull/43)

Changed
- Most of the class proccesing and sanity checks now happens in the init (or rather a post init hook) instead of during
class initialisation.
This increases the chance for some edge cases, but allows to post-process classes, before tpcp checks are run.
Most importantly, it allows the use of the `dataclass` decorator in combination with tpcp classes.
For the "enduser", this change will have minimal impact.
Only, if you relied on accessing special tpcp class parameters before the class (e.g. `__field_annotations__`) was
initialised, you will get an error now.
Other than that, you will only notice a very slight overhead on class initialisation, as we know need to run some
basic checks when you call the init or `get_params`.
(https://github.com/mad-lab-fau/tpcp/pull/41)
- The API of the Scorer class was modified.
In case you used custom Scorer before, they will likely not work anymore.
Further, we removed the `error_score` parameter from the Scorer and all related methods, that forwarded this parameter
(e.g. `GridSearch`).
Error that occur in the score function will now always be raised!
If you need special handling of error cases, handle them in your error function yourself (i.e. using try-except).
This gives more granular control and makes the implementation of the expected score function returns much easier on
the `tpcp` side.
(https://github.com/mad-lab-fau/tpcp/pull/42)

0.7.0

Added

- The `Dataset` class now has a new parameter `group`, which will return the group/row information, if there is only a
single group/row left in the dataset.
This parameter returns either a string or a namedtuple to make it easy to access the group/row information.
- The `Dataset.groups` parameter now returns a list of namedtuples when it previously returned a list of normal tuples.
- New `is_single_group` and `assert_is_single_group` methods for the `Dataset` class are added.
They are shortcuts for calling `self.is_single(groupby_cols=self.groupby_cols)` and
`self.assert_is_single(groupby_cols=self.groupby_cols)`.

Removed

- We removed the `OptimizableAlgorithm` base class, as it is not really useful.
We recommend implementing your own base class or mixin if you are implementing a set of algorithms that need a normal
and an optimizable version.

0.6.3

- It is now possible to use namedtuples as parameters and they are correctly cloned
(https://github.com/mad-lab-fau/tpcp/issues/39)

0.6.2

- The poetry lockfiles are now committed to the repository.
- Some dependencies are updated

0.6.1

Changed

- Fixed bug with tensor hashing (https://github.com/mad-lab-fau/tpcp/pull/37)
- Fixed an issue with memoization during hashing (https://github.com/mad-lab-fau/tpcp/pull/37)
- Fixed an issue that the `safe_optimize_wrapper` could not correctly detect changes to mutable objects.
This is now fixed by pre-calculating all the hashes. (https://github.com/mad-lab-fau/tpcp/pull/38)

Page 8 of 9

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.