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

Method SetScaleAndBias

catboost/libs/model/model.cpp:695–709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

693}
694
695void TModelTrees::SetScaleAndBias(const TScaleAndBias& scaleAndBias) {
696 CB_ENSURE(IsValidFloat(scaleAndBias.Scale), "Invalid scale " << scaleAndBias.Scale);
697 TVector<double> bias = scaleAndBias.GetBiasRef();
698 for (auto i : xrange(bias.size())) {
699 CB_ENSURE(IsValidFloat(bias[i]), "Invalid bias[" << i << "] : " << bias[i]);
700 }
701 if (bias.empty()) {
702 bias.resize(GetDimensionsCount(), 0);
703 }
704 CB_ENSURE(
705 GetDimensionsCount() == bias.size(),
706 "Inappropraite dimension of bias, should be " << GetDimensionsCount() << " found " << bias.size());
707
708 ScaleAndBias = TScaleAndBias(scaleAndBias.Scale, bias);
709}
710
711void TModelTrees::SetScaleAndBias(const NCatBoostFbs::TModelTrees* fbObj) {
712 ApproxDimension = fbObj->ApproxDimension();

Callers 14

TruncateTreesMethod · 0.95
mode_normalize_modelMethod · 0.45
SumModelsFunction · 0.45
ConfigureSymmetricTreesFunction · 0.45
Y_UNIT_TESTFunction · 0.45
Y_UNIT_TESTFunction · 0.45
SaveModelFunction · 0.45
ReadModelMethod · 0.45
CarryModelFunction · 0.45

Calls 9

IsValidFloatFunction · 0.85
xrangeFunction · 0.85
GetDimensionsCountFunction · 0.85
TScaleAndBiasClass · 0.85
sizeMethod · 0.45
emptyMethod · 0.45
resizeMethod · 0.45
assignMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected