"...git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "f8ffd98829972f95e0884903a9c41f94d85ed48e"
objective_function.cpp 664 Bytes
Newer Older
Guolin Ke's avatar
Guolin Ke committed
1
2
3
4
#include <LightGBM/objective_function.h>
#include "regression_objective.hpp"
#include "binary_objective.hpp"
#include "rank_objective.hpp"
5
#include "multiclass_objective.hpp"
Guolin Ke's avatar
Guolin Ke committed
6
7
8
9
10
11
12
13
14
15

namespace LightGBM {

ObjectiveFunction* ObjectiveFunction::CreateObjectiveFunction(const std::string& type, const ObjectiveConfig& config) {
  if (type == "regression") {
    return new RegressionL2loss(config);
  } else if (type == "binary") {
    return new BinaryLogloss(config);
  } else if (type == "lambdarank") {
    return new LambdarankNDCG(config);
16
17
  } else if (type == "multiclass") {
    return new MulticlassLogloss(config);
Guolin Ke's avatar
Guolin Ke committed
18
19
20
21
  }
  return nullptr;
}
}  // namespace LightGBM