kixi.stats icon indicating copy to clipboard operation
kixi.stats copied to clipboard

Organize namespaces in such a way to minimize dependencies

Open sbelak opened this issue 7 years ago • 6 comments

This might be a very fringe concern, but for big apps any additional dependencies are a pain. It would be very nice if namespaces were organised in such a way that you could control what dependencies you have to pull in (via lein's :exclude). Or at least (since what's proposed would be a breaking change) if this is something that the project is mindful of going forward.

Happy do to a PR for this, but it's something I feel should be discussed first.

sbelak avatar Sep 14 '18 09:09 sbelak

I'm going to go out on a limb: is this request driven by the recent addition of Apache Commons Math3 in kixi.core? If so, I support moving LOESS to a separate namespace. It's one of only a few functions in core which return a model rather than scalar statistics (the others being simple regression models), and perhaps all could be moved together since they're semantically related.

Let me know if this is what you had in mind, or if not then concretely what you'd prefer instead. No need to provide a PR yet.

henrygarner avatar Sep 15 '18 14:09 henrygarner

Mostly, yes; and also as something to keep in mind for the future. Doubtless there will be other algorithms we'll be wanting to add in the future, but it would be a shame to sacrifice the super-lightweight nature of kixi for it.

sbelak avatar Sep 15 '18 15:09 sbelak

As a new user I suspect I am hitting this issue when attempting to use LOESS. I have project.clj dependencies

[kixi/stats "0.4.3"]
[org.apache.commons/commons-math3 "3.5"]

but I get

(require '[kixi.stats.core :refer [locally-weighted-regression]])
IllegalAccessError locally-weighted-regression does not exist  clojure.core/refer (core.clj:4119)

gmp26 avatar Nov 12 '18 22:11 gmp26

@gmp26 Hi Mike, apologies LOESS has been added since the latest official release. If you update the kixi/stats dependency to "0.4.4-SNAPSHOT" you'll be able to use the locally-weighted-regression function in its current location.

henrygarner avatar Nov 13 '18 07:11 henrygarner

@henrygarner Many thanks Henry. I'd tried 0.4.4 but hadn't noticed it was a snapshot release.

gmp26 avatar Nov 13 '18 10:11 gmp26

I suspect this can be closed now, as there is no longer a commons-math dep?

sritchie avatar Aug 14 '23 21:08 sritchie