Closed grovduck closed 1 year ago
I know there are still repeated property calls in the underlying transformer implementations (e.g. the
ConstrainedOrdination.env_center
property gets recalculated multiple times) that could be simplified with the same strategy as this and probably improve performance further. I'd say those could be included in this PR, but getting this merged quick to keep things moving sounds reasonable to me.
I absolutely agree that there is more work to be done on CCA
and CCorA
. I'd like to defer that for now, but have created #49 to track this. Merging now to keep things moving seems like a good tack to me.
For
CCATransformer
andCCorATransformer
, store matrices from ordination as estimator attributes withinfit
method. Previously, we were calling properties fromCCA
andCCorA
(respectively) that were recomputing expensive operations. Because the matrix projectors don't change once fit, it's more efficient to store as estimator attributes.Also, remove redundant call to
_validate_data
inTransformedKNeighborsMixin._apply_transform
as the transformers are now responsible for that call.