Medial Code Documentation
Loading...
Searching...
No Matches
application.h
1#ifndef LIGHTGBM_APPLICATION_H_
2#define LIGHTGBM_APPLICATION_H_
3
4#include <LightGBM/meta.h>
5#include <LightGBM/config.h>
6
7#include <vector>
8#include <memory>
9
10namespace LightGBM {
11
12class DatasetLoader;
13class Dataset;
14class Boosting;
16class Metric;
17
26 friend class MemApp; // ADDED by Medial to enable full control inheritance
27public:
28 Application(int argc, char** argv);
29
32
34 inline void Run();
35
36private:
38 void LoadParameters(int argc, char** argv);
39
41 void LoadData();
42
44 void InitTrain();
45
47 void Train();
48
50 void InitPredict();
51
53 void Predict();
54
56 void ConvertModel();
57
59 Config config_;
61 std::unique_ptr<Dataset> train_data_;
63 std::vector<std::unique_ptr<Dataset>> valid_datas_;
65 std::vector<std::unique_ptr<Metric>> train_metric_;
67 std::vector<std::vector<std::unique_ptr<Metric>>> valid_metrics_;
69 std::unique_ptr<Boosting> boosting_;
71 std::unique_ptr<ObjectiveFunction> objective_fun_;
72};
73
74
75inline void Application::Run() {
76 if (config_.task == TaskType::kPredict || config_.task == TaskType::KRefitTree) {
77 InitPredict();
78 Predict();
79 } else if (config_.task == TaskType::kConvertModel) {
80 ConvertModel();
81 } else {
82 InitTrain();
83 Train();
84 }
85}
86
87} // namespace LightGBM
88
89#endif // LightGBM_APPLICATION_H_
The main entrance of LightGBM. this application has two tasks: Train and Predict. Train task will tra...
Definition application.h:25
void Run()
To call this funciton to run application.
Definition application.h:75
~Application()
Destructor.
Definition application.cpp:44
The interface for Boosting.
Definition boosting.h:22
Definition dataset_loader.h:8
The main class of data set, which are used to traning or validation.
Definition dataset.h:278
Definition MedLightGBM.h:38
The interface of metric. Metric is used to calculate metric result.
Definition metric.h:20
The interface of Objective Function.
Definition objective_function.h:13
desc and descl2 fields must be written in reStructuredText format
Definition application.h:10
Definition config.h:27