title: Curve fitting for large datasets in Python
body: <p>I have a very large set of data, ( around 100k points) and I want to fit a curve to this plot.</p>
  <p>I tried the filters suggested by answers to another question, but that lead to overfitting.
  I am using numpy and matplotlib as of now.</p>
  <p><a href="https://www.google.com/url?sa=i&amp;source=images&amp;cd=&amp;ved=2ahUKEwijx7j325HmAhWv_XMBHSV_ADYQjRx6BAgBEAQ&amp;url=https%3A%2F%2Fwww.researchgate.net%2Ffigure%2FI-B-I-color-magnitude-diagram-for-the-entire-CFHT-dataset_fig3_1749812&amp;psig=AOvVaw1ZWRSPTHnDv3y4Qg_uhrAV&amp;ust=1575195836096112" rel="nofollow noreferrer">This</a> is the type of scatter plot I am trying to fit.</p>
  <p>Edit 1:</p>
  <p>Please ignore the data points to the side of the central main set of data points(Thus only a single curve can fit this)</p>
  <p><a href="https://archive.stsci.edu/hlsps/hugs/ngc2808/hlsp_hugs_hst_wfc3-uvis-acs-wfc_ngc2808_multi_v1_catalog-meth1.txt" rel="nofollow noreferrer">Here</a> is the dataset, download the file as a text file to separate the columns, consider the columns 3 and 9 ( 1-based indexing), the y-axis has column 3 while the x-axis plots the difference of column 3 and column 9.</p>
  <p>Edit 2: Ignore the negative values</p>
  <p>Edit 3: As there appears to be a lot of noise, consider the column 33 which accounts for probability and consider stars only which have &gt;90% probability</p>