0

I have a couple of points, who are the input for linear regression. LR outputs the parameters w and b, so that the ideal line is

y = wx+b.

I would like to depict that line in D2D1 with the following command:

pRenderTarget->DrawLine(D2D1::Point2F(startX, startY), D2D1::Point2F(endX, endY), pBrush);

The problem is that i cannot figure out what the points startX, startY, endX, endY have to be. I tried with

startX = minX, startY = w * startX + b, endX = maxX, endY = w * endX + b

where minX and minY are the minimum X and Y values in the dataset, but it gives a horizontal slope.

current output

3
  • I tried to do something like this with R2D2 once but I couldn't understand the beep codes. Commented Jun 18, 2024 at 20:51
  • why you deleted stackoverflow.com/questions/79667723/… without saying us the reason, or the solution of your problem if you found (I am 99% sure to flush out before to close the file was missing) ? This is not a gentle behavior with people using time trying to help you ... Commented Jun 16 at 14:40
  • Sorry, that was because the problem was idiotic (not the correct path) and I didn't want to disturb anymore. Commented Jun 17 at 14:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.