felix-clark / ndarray-glm

Rust library for linear, logistic, and generalized linear model regression
MIT License
22 stars 0 forks source link

Caching intermediate results in `Fit` interface #25

Open felix-clark opened 3 years ago

felix-clark commented 3 years ago

Some operations are performed repeatedly in the implementation of the Fit result. The covariance matrix is already cached manually, which is most important because this is probably an O(n^3) calculation. Some other functions and operations may be of only linear complexity but be called repeatedly and potentially involve relatively slow function calls like logarithms.

Some potential caching targets:

felix-clark commented 3 years ago

If possible I think it would be best to use an external crate for caching in general, in order to keep the code in this package from getting more complicated than it needs to be.

felix-clark commented 3 years ago

The cached crate could be useful here, although caching of member functions is not yet implemented.