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

Method CreateBoosting

src/boosting/boosting.cpp:35–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35Boosting* Boosting::CreateBoosting(const std::string& type, const char* filename) {
36 if (filename == nullptr || filename[0] == '\0') {
37 if (type == std::string("gbdt")) {
38 return new GBDT();
39 } else if (type == std::string("dart")) {
40 return new DART();
41 } else if (type == std::string("goss")) {
42 return new GOSS();
43 } else if (type == std::string("rf")) {
44 return new RF();
45 } else {
46 return nullptr;
47 }
48 } else {
49 std::unique_ptr<Boosting> ret;
50 if (GetBoostingTypeFromModelFile(filename) == std::string("tree")) {
51 if (type == std::string("gbdt")) {
52 ret.reset(new GBDT());
53 } else if (type == std::string("dart")) {
54 ret.reset(new DART());
55 } else if (type == std::string("goss")) {
56 ret.reset(new GOSS());
57 } else if (type == std::string("rf")) {
58 return new RF();
59 } else {
60 Log::Fatal("Unknown boosting type %s", type.c_str());
61 }
62 LoadFileToBoosting(ret.get(), filename);
63 } else {
64 Log::Fatal("Unknown model format or submodel type in model file %s", filename);
65 }
66 return ret.release();
67 }
68}
69
70bool TrainOneIter_new(const score_t* gradients, const score_t* hessians,const score_t* gradients2, const score_t* hessians2){
71 return 0;

Callers

nothing calls this directly

Calls 3

resetMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected