MCPcopy Create free account
hub / github.com/catboost/catboost / PredictSpecificClass

Function PredictSpecificClass

catboost/libs/model_interface/c_api.cpp:751–775  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

749}
750
751CATBOOST_API bool PredictSpecificClass(
752 ModelCalcerHandle* modelHandle,
753 size_t docCount,
754 const float** floatFeatures, size_t floatFeaturesSize,
755 const char*** catFeatures, size_t catFeaturesSize,
756 int classId,
757 double* result, size_t resultSize) {
758 try {
759 const size_t dim = FULL_MODEL_PTR(modelHandle)->GetDimensionsCount();
760 TVector<double> rawResult(docCount * dim);
761 if (!CalcModelPrediction(
762 modelHandle, docCount,
763 floatFeatures, floatFeaturesSize,
764 catFeatures, catFeaturesSize,
765 rawResult.data(), rawResult.size()))
766 {
767 return false;
768 }
769 GetSpecificClass(classId, rawResult, dim, TArrayRef<double>(result, resultSize));
770 } catch (...) {
771 ErrorMessageHolder.Get().Message = CurrentExceptionMessage();
772 return false;
773 }
774 return true;
775}
776
777CATBOOST_API bool PredictSpecificClassText(
778 ModelCalcerHandle* modelHandle,

Callers

nothing calls this directly

Calls 7

CalcModelPredictionFunction · 0.85
GetSpecificClassFunction · 0.85
CurrentExceptionMessageFunction · 0.85
GetDimensionsCountMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected