XGBoost로 회귀 문제를 해결하고 싶습니다. 학습 과제 매개 변수 목표 [기본값 = reg : 선형] (XGboost)와 혼동 스럽지만, ** '목표'가 손실 기능 설정에 사용 된 것 같습니다. **하지만 'reg : linear'를 이해할 수는 없습니다. 영향력 손실 함수. 로지스틱 회귀 데모 (XGBoost logistic regression demo), 객관적인 = 이진 : 로지스틱 의미 손실 함수는 물류 손실 함수입니다. 그래서 '객관적인 = reg : 선형'어떤 손실 기능에 해당 하는가?XGBoost : 'objective'매개 변수는 무엇입니까?
2
A
답변
2
그래서 'objective = reg : linear'는 어느 손실 함수에 해당합니까? 당신은 로지스틱 회귀 여기 선형 회귀
https://github.com/dmlc/xgboost/blob/master/src/objective/regression_obj.cc
모두 (기울기와 헤센 기반으로) 손실 기능이 좀 걸릴 수 있습니다
제곱 오류 손실 함수는 합리적으로 유사합니다. 그냥 SecondOrderGradient
평방 손실의 일정하다는
// common regressions
// linear regression
struct LinearSquareLoss {
static float PredTransform(float x) { return x; }
static bool CheckLabel(float x) { return true; }
static float FirstOrderGradient(float predt, float label) { return predt - label; }
static float SecondOrderGradient(float predt, float label) { return 1.0f; }
static float ProbToMargin(float base_score) { return base_score; }
static const char* LabelErrorMsg() { return ""; }
static const char* DefaultEvalMetric() { return "rmse"; }
};
// logistic loss for probability regression task
struct LogisticRegression {
static float PredTransform(float x) { return common::Sigmoid(x); }
static bool CheckLabel(float x) { return x >= 0.0f && x <= 1.0f; }
static float FirstOrderGradient(float predt, float label) { return predt - label; }
static float SecondOrderGradient(float predt, float label) {
const float eps = 1e-16f;
return std::max(predt * (1.0f - predt), eps);
}
저자는이 여기 https://github.com/dmlc/xgboost/tree/master/demo/regression
언급