Implement reduceData to reduce the amount of data points before fitting