MLJModelInterface.jl
MLJModelInterface.jl copied to clipboard
implement statsapi
It could be neat if MLJ implemented StatsAPI as to avoid duplicate function names
julia> using MLJBase, GLM
julia> predict
WARNING: both GLM and MLJBase export "predict"; uses of it in module Main must be qualified
ERROR: UndefVarError: `predict` not defined
This could be avoided if MLJBase used StatsAPI.predict
I agree it would be neat but I'm not sure it makes sense at the present time. Here are few reasons:
-
I presume StatsAPI
predicthas a different contract forpredictthan MLJModelInterface. -
StatsAPI does not have a
transformmethod at all, and it might be confusing to source one method from StatsAPI and not the other. StatsAPI also has noinverse_transform- they call itreconstruct. This is not a criticism of StatsAPI - I'm pointing out that the needs and emphasis are different. Frustratingly,DataFrameshas it's owntransform, which also conflicts with MLJ'stransform, butDataFramesis too big a dependency to add to MLJModelInterface.jl. -
Changing method ownership is technically breaking. This has got me into trouble before, although I don't recall the reason.
I'm pretty sure MLJModelInterface predates StatsAPI. At the time we considered taking predict from StatsModels, which I think used to own the method, but didn't want the heavy dependency.
I've personally come around to believing the goal of reducing all method names to a single source is very ambitious, given the number of packages, different approaches, etc.
Perhaps we can revisit this question when there is little more stability.
Related project: LearnAPI.jl.
Oh, and reversing our decision about ownership is definitely breaking.
Makes sense, thanks for taking the time to provide the reasons for this!
Closed as not planned