PDT removes systematic trends in light curves. It finds clusters of light curves that are highly correlated using machine learning, constructs one master trend per cluster and detrends an individual light curve using the constructed master trends by minimizing residuals while constraining coefficients to be positive.
https://ui.adsabs.harvard.edu/abs/2009MNRAS.397..558K and https://github.com/dwkim78/pdtrend