elixir-nx / scholar

Traditional machine learning on top of Nx
Apache License 2.0
418 stars 43 forks source link

Fix/linear shapes #288

Closed JoaquinIglesiasTurina closed 2 months ago

JoaquinIglesiasTurina commented 2 months ago

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.

JoaquinIglesiasTurina commented 2 months ago

I think it looks great :). Additionally, I would indicate somewhere information that the different input and target shapes may be different in specific case.

Great, I'll update the docs