I am working on the following problem:
enter image description here
In linear regression, I have used the python sklearn.linear_model LinearRegression
by calling fit
In that, the fit function takes two arrays the first array is independent and the second
is the dependent variable. In the current case, there are two independent variables
and one dependent variable. And we have to minimize the residual squares.
Is there a way to use the Sklearn LinearRegression here?
I am reading an image like this:
enter image description here

  from sklearn.linear_model import LinearRegression
reg = LinearRegression()
 Not sure what do I call fit with.  
  This is the image I am using : 
enter code here

enter image description here

  • $\begingroup$ Yes, since the LinearRegression implementation in sklearn uses Ordinary Least Squares to optimize the parameters. Have you already tried fitting it on your data? $\endgroup$
    – Oxbowerce
    Jul 28, 2021 at 14:41
  • $\begingroup$ how to threshold an image using this plane? Is there a pythonic way to do it? $\endgroup$
    – joseph
    Jul 28, 2021 at 16:56


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.