RFCDE provides an implementation of random forests designed for conditional density estimation. It computes a kernel density estimate of y with nearest neighbor weightings defined by the location of the evaluation point x relative to the leaves in the random forest.
https://ui.adsabs.harvard.edu/abs/2018arXiv180405753P , https://ui.adsabs.harvard.edu/abs/2019arXiv190607177P , and https://ui.adsabs.harvard.edu/abs/2020A%26C....3000362D