MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / CreateMetric

Method CreateMetric

python-package/compile/src/metric/metric.cpp:16–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14namespace LightGBM {
15
16Metric* Metric::CreateMetric(const std::string& type, const Config& config) {
17 if (type == std::string("l2")) {
18 return new L2Metric(config);
19 } else if (type == std::string("rmse")) {
20 return new RMSEMetric(config);
21 } else if (type == std::string("l1")) {
22 return new L1Metric(config);
23 } else if (type == std::string("quantile")) {
24 return new QuantileMetric(config);
25 } else if (type == std::string("huber")) {
26 return new HuberLossMetric(config);
27 } else if (type == std::string("fair")) {
28 return new FairLossMetric(config);
29 } else if (type == std::string("poisson")) {
30 return new PoissonMetric(config);
31 } else if (type == std::string("binary_logloss")) {
32 return new BinaryLoglossMetric(config);
33 } else if (type == std::string("binary_error")) {
34 return new BinaryErrorMetric(config);
35 } else if (type == std::string("auc")) {
36 return new AUCMetric(config);
37 } else if (type == std::string("ndcg")) {
38 return new NDCGMetric(config);
39 } else if (type == std::string("map")) {
40 return new MapMetric(config);
41 } else if (type == std::string("multi_logloss")) {
42 return new MultiSoftmaxLoglossMetric(config);
43 } else if (type == std::string("multi_error")) {
44 return new MultiErrorMetric(config);
45 } else if (type == std::string("cross_entropy")) {
46 return new CrossEntropyMetric(config);
47 } else if (type == std::string("cross_entropy_lambda")) {
48 return new CrossEntropyLambdaMetric(config);
49 } else if (type == std::string("kullback_leibler")) {
50 return new KullbackLeiblerDivergence(config);
51 } else if (type == std::string("mape")) {
52 return new MAPEMetric(config);
53 } else if (type == std::string("gamma")) {
54 return new GammaMetric(config);
55 } else if (type == std::string("gamma_deviance")) {
56 return new GammaDevianceMetric(config);
57 } else if (type == std::string("tweedie")) {
58 return new TweedieMetric(config);
59 }
60 return nullptr;
61}
62
63} // namespace LightGBM

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected