Skip to content

Commit

Permalink
Rename gmax to maxLabel
Browse files Browse the repository at this point in the history
  • Loading branch information
russcam committed Nov 19, 2024
1 parent 0d897c0 commit 9ecb642
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/RankLib/Eval/EvaluatorFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,21 @@ public Evaluator CreateEvaluator(
Metric.Metric testMetric,
int testK,
Normalizer? normalizer = null,
double? gMax = null,
bool mustHaveRelDoc = false,
double? maxLabel = null,
bool mustHaveRelevantDocs = false,
bool useSparseRepresentation = false,
string? queryRelevanceFile = null)
{
var trainScorer = _metricScorerFactory.CreateScorer(trainMetric, trainK);
var testScorer = _metricScorerFactory.CreateScorer(testMetric, testK);

if (gMax != null)
if (maxLabel != null)
{
if (trainScorer is ERRScorer errTrainScorer)
errTrainScorer.Max = gMax.Value;
errTrainScorer.Max = maxLabel.Value;

if (testScorer is ERRScorer errTestScorer)
errTestScorer.Max = gMax.Value;
errTestScorer.Max = maxLabel.Value;
}

if (queryRelevanceFile != null)
Expand All @@ -106,7 +106,7 @@ public Evaluator CreateEvaluator(
testScorer,
_trainer,
normalizer,
mustHaveRelDoc,
mustHaveRelevantDocs,
useSparseRepresentation,
_loggerFactory.CreateLogger<Evaluator>());
}
Expand All @@ -116,21 +116,21 @@ public Evaluator CreateEvaluator(
Metric.Metric testMetric,
int k,
Normalizer? normalizer = null,
double? gMax = null,
bool mustHaveRelDoc = false,
double? maxLabel = null,
bool mustHaveRelevantDocs = false,
bool useSparseRepresentation = false,
string? queryRelevanceFile = null)
{
var trainScorer = _metricScorerFactory.CreateScorer(trainMetric, k);
var testScorer = _metricScorerFactory.CreateScorer(testMetric, k);

if (gMax != null)
if (maxLabel != null)
{
if (trainScorer is ERRScorer errTrainScorer)
errTrainScorer.Max = gMax.Value;
errTrainScorer.Max = maxLabel.Value;

if (testScorer is ERRScorer errTestScorer)
errTestScorer.Max = gMax.Value;
errTestScorer.Max = maxLabel.Value;
}

if (queryRelevanceFile != null)
Expand All @@ -146,7 +146,7 @@ public Evaluator CreateEvaluator(
testScorer,
_trainer,
normalizer,
mustHaveRelDoc,
mustHaveRelevantDocs,
useSparseRepresentation,
_loggerFactory.CreateLogger<Evaluator>());
}
Expand Down

0 comments on commit 9ecb642

Please sign in to comment.