1
進行放鬆,我aggreagate管道我有中間結果如後:MongoDB的與特定領域的最大價值每組查找文件(argmax)
[
{_id:1, precision:0.91, recall:0.71, other fields...},
{_id:1, precision:0.71, recall:0.81, other fields...},
{_id:1, precision:0.61, recall:0.91, other fields...},
{_id:2, precision:0.82, recall:0.42, other fields...},
{_id:2, precision:0.72, recall:0.52, other fields...},
{_id:2, precision:0.62, recall:0.62, other fields...}
]
現在我想組文件由_id,然後在每個組中查找具有最大召回的文件,並獲得該文件的召回,精確度和_id。
那麼結果將是:
[
{_id:1, precisionOfDocWithMaxRecall:0.61, maxRecall:0.91},
{_id:2, precisionOfDocWithMaxRecall:0.62, maxRecall:0.62}
]
我已成功地獲得使用羣體和最大,但沒有精確場的結果。