Conversation
|
I also ended up adding a miminimzation for 1st and 2nd order polynomials if that is wanted? |
mish15
left a comment
There was a problem hiding this comment.
Thanks for this! In principle i really like the idea. Needs a bit more work though. I've added some comments accordingly
| } | ||
|
|
||
| //Plot regression and return file path where its saved | ||
| func (r *Regression) Plot() string { |
There was a problem hiding this comment.
This should:
- return the
errinstead of panicking. - allow the user to specify where to save the file
- needs to be more configurable in general. e.g. only the first two vars are plotted. What if there are more?
|
|
||
| p, err := plot.New() | ||
| if err != nil { | ||
| panic(err) |
| "Observed", observed, | ||
| "Predicted", predicted) | ||
| if err != nil { | ||
| panic(err) |
| panic(err) | ||
| } | ||
| if err := p.Save(4*vg.Inch, 4*vg.Inch, "points.png"); err != nil { | ||
| panic(err) |
| panic(err) | ||
| } | ||
| p.Title.Text = r.GetObserved() | ||
| p.X.Label.Text = r.GetVar(1) |
There was a problem hiding this comment.
The var numbers are hardcoded to 0 and 1, but what if there are > 2 vars?
|
Hi @mish15 and @domenicrosati. I'm going to use this project in my master thesis as a lib. I'M going to need plotting... So since this PR is not completed for a long time, may I continue to work on different PR and contribute to you?. Thanks! |
|
@olimpias yes of course! |
|
|
|
@olimpias yeah i guess in general each variable needs to be plotted against Y. Potentially it would also be useful to see X1 against Xn, but that's less important. |
Made this WIP while I was working on something else.
If this is interesting I can polish it up and test it.
Just let me know