StatsBase.jl icon indicating copy to clipboard operation
StatsBase.jl copied to clipboard

Move `predict` to StatsAPI.jl

Open rafaqz opened this issue 4 years ago • 6 comments

I would like to support predict in GeoData.jl for e.g. predicting SDM models over stacks of raster layers, without the round trip to DataFrame and back.

But StatsBase is pretty heavy for a base package, withe nearly a second load time, and GeoData.jl is only loosely related to stats models.

Would it be acceptable to move predict to StatsAPI.jl with StatsBase keeping the fallback definition?

rafaqz avatar Oct 15 '21 23:10 rafaqz

Yes, actually we should move all empty definitions in statsmodel.jl to StatsAPI. Feel free to make a PR.

nalimilan avatar Nov 05 '21 19:11 nalimilan

By "all empty definitions" do you mean that e.g.

coef(model::StatisticalModel) = error("coef is not defined for $(typeof(model)).")

Would also move to StatsAPI as:

coef(model) = error("coef is not defined for $(typeof(model)).")

rafaqz avatar Nov 05 '21 20:11 rafaqz

I'd move coef(model::StatisticalModel) without changing its signature. Any reason to change it?

nalimilan avatar Nov 06 '21 18:11 nalimilan

Because the types are defined here ;)

We can move the them too, of course. I just have no idea about the design of these packages.

rafaqz avatar Nov 06 '21 18:11 rafaqz

Yes we should move them too. There's no reason to force a package that wants to use these types to depend on StatsBase.

nalimilan avatar Nov 06 '21 18:11 nalimilan

This is done, would it be possible to review the changes over at StatsAPI?

When that is approved/merged I'll make the PR to remove the stubs here and import them from StatsAPI.

rafaqz avatar Nov 09 '21 16:11 rafaqz