MCPcopy Create free account
hub / github.com/dmlc/xgboost / PredTransform

Method PredTransform

plugin/example/custom_obj.cc:59–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57 return "logloss";
58 }
59 void PredTransform(HostDeviceVector<float> *io_preds) const override {
60 // transform margin value to probability.
61 std::vector<float> &preds = io_preds->HostVector();
62 for (auto& pred : preds) {
63 pred = 1.0f / (1.0f + std::exp(-pred));
64 }
65 }
66 void ProbToMargin(linalg::Vector<float>* base_score) const override {
67 // transform probability to margin value
68 auto h_intercept = base_score->HostView();

Callers 7

TESTFunction · 0.45
TestGammaRegressionBasicFunction · 0.45

Calls

no outgoing calls

Tested by 7

TESTFunction · 0.36
TestGammaRegressionBasicFunction · 0.36