Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify difference between params and fitted #18

Open
rofinn opened this issue Jun 27, 2022 · 2 comments
Open

Clarify difference between params and fitted #18

rofinn opened this issue Jun 27, 2022 · 2 comments

Comments

@rofinn
Copy link
Member

rofinn commented Jun 27, 2022

I'm just wondering if someone could clarify what each of these function should return. For example,

  1. Should params return trainable and non-trainable parameters? Is params! a multi-argument function which mutates the model parameters, and should it return the set parameters or the updated model?
  2. Could fitted be applicable to non-regression problems (e.g., classification, clustering)?
@nalimilan
Copy link
Member

Are you really asking for the difference between these functions, or just for their definitions? It seems to me that the difference between params and coef is what needs documenting. See JuliaStats/StatsBase.jl#274 for a discussion when it was introduced in StatsBase. I had proposed the following docstring back then but the PR was merged without it:

Return all parameters of a model. Contrary to coef, this includes parameters other than those corresponding to the effect of independent variables (e.g. in a linear model, those which determine the linear predictor).

Feel free to propose something. I'm not sure what defines trainable parameters though.

Regarding params!, I think the idea is that it stores the parameters in the passed array(s), not that it mutates the model. At least that's how Distributions (which is the only definition currently AFAICT) uses it. This should be documented too. The docstring for it in the original PR was "Write the parameters of a model into preallocated storage.", which we dropped because we don't provide any fallback definition, but we should provide one now I think.

Regarding fitted, I'd say it's fine to define it for classification and clustering. predict could also be used, see JuliaStats/MultivariateStats.jl#190 (comment).

Cc: @joshday, @ararslan, @andreasnoack

@nalimilan
Copy link
Member

See also discussion at #19 regarding linearpredictor!.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants