I am trying to generate a regression curve for a set of x-y values where a single x value can have multiple y values. Although in the end, only one y value should be the correct one and rest all should be categorized as outliers. Is least square linear regression the right way to do this? I was reading a paper which said I could apply linear regression here; but when I use an existing code library and input my data, it gives an error. How do I get the line for this data?