def get_estimators(positions_all, positions_relevant):
samples_all = [<EOL>(position,) for _, positions in positions_all.items() for position in positions]<EOL>samples_relevant = [<EOL>(position,) for _, positions in positions_relevant.items() for position in positions]<EOL>estimators = dict()<EOL>estimators["<STR_LIT>"] = len(samples_relevant) / len(samples_all)<EOL>LOGGER.info("<STR_LIT>")<EOL>estimators["<STR_LIT>"] = KernelDensity(**KERNEL).fit(samples_all)<EOL>LOGGER.info("<STR_LIT>")<EOL>estimators["<STR_LIT>"] = KernelDensity(**KERNEL).fit(samples_relevant)<EOL>return (<EOL>estimators["<STR_LIT>"], estimators["<STR_LIT>"], estimators["<STR_LIT>"])<EOL>
Extracts density estimators from a judged sample of paragraph positions.

Parameters
----------
positions_all : dict of (Path, float)
    A sample of paragraph positions from various datasets in the NTCIR-11
    Math-2, and NTCIR-12 MathIR format.
positions_relevant : dict of (Path, float)
    A sample of relevant paragraph positions from various datasets in the
    NTCIR-11 A subsample of relevant paragraph positions.

Returns
-------
(float, KernelDensity, KernelDensity)
    An estimate of P(relevant), and estimators of p(position), and p(position | relevant).