-
Notifications
You must be signed in to change notification settings - Fork 47
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
Fix/linear shapes #288
Fix/linear shapes #288
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks great :). Additionally, I would indicate somewhere information that the different input and target shapes may be different in specific case.
Co-authored-by: José Valim <[email protected]>
Co-authored-by: José Valim <[email protected]>
Great, I'll update the docs |
@@ -428,6 +428,8 @@ defmodule Scholar.Linear.BayesianRidgeRegression do | |||
|
|||
@doc """ | |||
Makes predictions with the given `model` on input `x`. | |||
Output predictions have shape {n_samples} when train target is shaped either {n_samples} or {n_samples, 1}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should start a new paragraph, because the first paragraph should always be a short summary. And use backticks around code, can you please apply similar changes below? :)
Output predictions have shape {n_samples} when train target is shaped either {n_samples} or {n_samples, 1}. | |
Output predictions have shape `{n_samples}` when train target | |
is shaped either `{n_samples}` or `{n_samples, 1}`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing. Thank you for your comments.
Implemented the changes proposed here
Please note the changes to
test/scholar/linear/bayesian_ridge_regression_test.exs
to fully understand the scope of the changes.On the above comment, I defended models being equal when fitting single column vectors and one dimensional vectors.
However, I've just thought a drawback to this approach.
If the output of
.predict
is the same on both input cases, this means that prediction and target shapes may be different. This can cause some inconveniences.I still think this is the better approach, but I want to make clear that the change is significant.