aeon
aeon copied to clipboard
[ENH] Add BORF transformer
What does this implement/fix? Explain your changes.
I am trying to add a Bag-Of-Receptive-Fields transformer as seen in Spinnato, Francesco, et al. "A Bag of Receptive Fields for Time Series Extrinsic Predictions." arXiv preprint arXiv:2311.18029 (2023)
. It is basically a Bag-Of-Pattern transform, where a time series is transformed in a sparse matrix of counts of discretized subsequences.
Does your contribution introduce a new dependency? If yes, which one?
This contribution introduces a dependency to the pydata sparse library (https://sparse.pydata.org/en/stable/).
Any other comments?
I have a couple of issues/doubts:
- the transformer fails 2 tests:
'test_persistence_via_pickle(estimator=BORF(),datatype=EqualLengthUnivariate-Classification-numpy3D)': "FAILED: 'csr_matrix' object has no attribute 'ravel'",
'check_fit_deterministic(estimator=BORF(),datatype=EqualLengthUnivariate-Classification-numpy3D)': "FAILED: 'csr_matrix' object has no attribute 'ravel'"
This is because the output of the transformer is a sparse scipy matrix (https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.csr_matrix.html#scipy.sparse.csr_matrix). I don't know if this is a problem. In practice, the sparse matrix is compatible with downstream sklearn estimators/transformers.
- the sparse package is used as a soft dependency, which is imported in the transform of
IndividualBORF
, which inherits from sklearn's BaseEstimator, TransformerMixin, and not BaseCollectionTransformer. Is this a problem?
PR checklist
For all contributions
- [x] I've added myself to the list of contributors. Alternatively, you can use the @all-contributors bot to do this for you.
- [x] The PR title starts with either [ENH], [MNT], [DOC], [BUG], [REF], [DEP] or [GOV] indicating whether the PR topic is related to enhancement, maintenance, documentation, bugs, refactoring, deprecation or governance.
For new estimators and functions
- [x] I've added the estimator to the online API documentation.
- [x] (OPTIONAL) I've added myself as a
__maintainer__
at the top of relevant files and want to be contacted regarding its maintenance. Unmaintained files may be removed. This is for the full file, and you should not add yourself if you are just making minor changes or do not want to help maintain its contents.