[catboost] Skip target values check for regression objectives
Note: mandatory check (NEED_CHECK) was skipped
@@ -98,6 +98,7 @@ namespace NCB {
TStringBuf datasetName,
bool isLearnData,
bool allowConstLabel,
+ bool needCheckTarget,
TConstArrayRef<NCatboostOptions::TLossDescription> metricDescriptions)
{
if (!maybeConvertedTarget) {
@@ -109,6 +110,7 @@ namespace NCB {
return;
}
+ if (needCheckTarget) {
for (auto objectIdx : xrange(convertedTarget.size())) {
const float value = convertedTarget[objectIdx];
if (!IsSafeTarget(value)) {
@@ -119,6 +121,7 @@ namespace NCB {
break;
}
}
+ }
for (const auto& metricDescription : metricDescriptions) {
::CheckPreprocessedTarget(
@@ -649,12 +652,14 @@ namespace NCB {
}
+ const bool needCheckTarget = !mainLossFunction || !IsRegressionObjective((*mainLossFunction)->GetLossFunction());
// TODO(akhropov): Will be split by target type. MLTOOLS-2337.
CheckPreprocessedTarget(
maybeConvertedTarget,
datasetName,
isLearnData,
allowConstLabel,
+ needCheckTarget,
metricDescriptions);
return MakeIntrusive<TTargetDataProvider>(
