"...git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "053e888d870a641f2c9271f5771e890309fa4ba0"
tree_learner.cpp 743 Bytes
Newer Older
Guolin Ke's avatar
Guolin Ke committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <LightGBM/tree_learner.h>

#include "serial_tree_learner.h"
#include "parallel_tree_learner.h"

namespace LightGBM {

TreeLearner* TreeLearner::CreateTreeLearner(TreeLearnerType type, const TreeConfig& tree_config) {
  if (type == TreeLearnerType::kSerialTreeLearner) {
    return new SerialTreeLearner(tree_config);
  } else if (type == TreeLearnerType::kFeatureParallelTreelearner) {
    return new FeatureParallelTreeLearner(tree_config);
  } else if (type == TreeLearnerType::kDataParallelTreeLearner) {
    return new DataParallelTreeLearner(tree_config);
Guolin Ke's avatar
Guolin Ke committed
15
16
  } else if (type == TreeLearnerType::KVotingParallelTreeLearner) {
    return new VotingParallelTreeLearner(tree_config);
Guolin Ke's avatar
Guolin Ke committed
17
18
19
20
21
  }
  return nullptr;
}

}  // namespace LightGBM