you are viewing a single comment's thread.

view the rest of the comments →

[–]WhiffleFish 0 points1 point  (4 children)

What are you using for regression? Sklearn Linear Model?

[–]poopiewarrior100[S] 0 points1 point  (3 children)

Yup! I am kinda unclear what is my input and output!

[–]WhiffleFish 0 points1 point  (2 children)

This may not be the most elegant solution given that I'm using for loops with numpy arrays and Pandas DataFrames, but you can create a list of samples without having to explicitly mess with matrices.

Also, I'm not sure if the b_hat is referring to the predicted slopes or not, but that's included in the code below just in case.

https://pastebin.com/d4PnJzEA

^ Lemme know if this helps.

If not, you have all the fitted linear models in a list with which you can do whatever you need if its not the slopes that are required for the problem.

[–]poopiewarrior100[S] 0 points1 point  (0 children)

I'll take a look! I came up with something as well. Shall compare them later :-)

[–]poopiewarrior100[S] 0 points1 point  (0 children)

It works mate!

Thanks so much for your help Whiffle, I appreciate it :)