@@ -129,7 +129,10 @@ class PositiveNegativePairOpMaker : public framework::OpProtoAndCheckerMaker {
...
@@ -129,7 +129,10 @@ class PositiveNegativePairOpMaker : public framework::OpProtoAndCheckerMaker {
.AsDispensable();
.AsDispensable();
AddInput("Weight",
AddInput("Weight",
"(float) Optional. Weight of current item. If specified, its "
"(float) Optional. Weight of current item. If specified, its "
"shape should be the same as Label.")
"shape should be the same as Label, and the meaning of the output "
"changes from numbers of pairs to the total sum of pairs' "
"weights. Weight of a pair of items is the average of their "
"weights.")
.AsDispensable();
.AsDispensable();
AddOutput("PositivePair",
AddOutput("PositivePair",
"(float) Number of positive pairs, i.e. the pairs of "
"(float) Number of positive pairs, i.e. the pairs of "
...
@@ -150,9 +153,13 @@ class PositiveNegativePairOpMaker : public framework::OpProtoAndCheckerMaker {
...
@@ -150,9 +153,13 @@ class PositiveNegativePairOpMaker : public framework::OpProtoAndCheckerMaker {
"Noting that reducing on the first dim will make the LoD info lost.")
"Noting that reducing on the first dim will make the LoD info lost.")
.SetDefault(0);
.SetDefault(0);
AddComment(R"DOC(
AddComment(R"DOC(
PositiveNegativePairOp can be used to evaluate Learning To Rank(LTR) model performance.
PositiveNegativePairOp can be used to evaluate Learning To Rank(LTR)
Within some context, e.g. the "query", a LTR model generates scores for a list of items, which gives a partial order of the items.
model performance.
PositiveNegativePairOp takes a list of reference rank order (Input("Label")) and the model generated scores (Input(Score)) as inputs and counts the pairs that ranked correctly and incorrectly.
Within some context, e.g. the "query", a LTR model generates scores
for a list of items, which gives a partial order of the items.
PositiveNegativePairOp takes a list of reference rank order
(Input("Label")) and the model generated scores (Input(Score)) as
inputs and counts the pairs that ranked correctly and incorrectly.