Medial Code Documentation
Loading...
Searching...
No Matches
prediction_early_stop.h
1#ifndef LIGHTGBM_PREDICTION_EARLY_STOP_H_
2#define LIGHTGBM_PREDICTION_EARLY_STOP_H_
3
4#include <functional>
5#include <string>
6
7#include <LightGBM/export.h>
8
9namespace LightGBM {
10
15 using FunctionType = std::function<bool(const double*, int)>;
16
17 FunctionType callback_function; // callback function itself
18 int round_period; // call callback_function every `runPeriod` iterations
19};
20
22 int round_period;
23 double margin_threshold;
24};
25
27LIGHTGBM_EXPORT PredictionEarlyStopInstance CreatePredictionEarlyStopInstance(const std::string& type,
28 const PredictionEarlyStopConfig& config);
29
30} // namespace LightGBM
31
32#endif // LIGHTGBM_PREDICTION_EARLY_STOP_H_
desc and descl2 fields must be written in reStructuredText format
Definition application.h:10
LIGHTGBM_EXPORT PredictionEarlyStopInstance CreatePredictionEarlyStopInstance(const std::string &type, const PredictionEarlyStopConfig &config)
Create an early stopping algorithm of type type, with given round_period and margin threshold.
Definition prediction_early_stop.cpp:76
Definition prediction_early_stop.h:21
Definition prediction_early_stop.h:11
std::function< bool(const double *, int)> FunctionType
Callback function type for early stopping.
Definition prediction_early_stop.h:15