meta.h 801 Bytes
Newer Older
Guolin Ke's avatar
Guolin Ke committed
1
2
3
4
5
6
7
8
#ifndef LIGHTGBM_META_H_
#define LIGHTGBM_META_H_

#include <cstdint>

#include <limits>
#include <vector>
#include <functional>
Guolin Ke's avatar
Guolin Ke committed
9
#include <memory>
Guolin Ke's avatar
Guolin Ke committed
10
11
12
13
14

namespace LightGBM {

/*! \brief Type of data size, it is better to use signed type*/
typedef int32_t data_size_t;
15
16
/*! \brief Type of score, and gradients */
typedef float score_t;
Guolin Ke's avatar
Guolin Ke committed
17

18
const score_t kMinScore = -std::numeric_limits<score_t>::infinity();
Guolin Ke's avatar
Guolin Ke committed
19

20
const score_t kEpsilon = 1e-15f;
Guolin Ke's avatar
Guolin Ke committed
21

Guolin Ke's avatar
Guolin Ke committed
22
const double kZeroAsMissingValueRange = 1e-20f;
Guolin Ke's avatar
Guolin Ke committed
23

Guolin Ke's avatar
Guolin Ke committed
24
25
using ReduceFunction = std::function<void(const char*, char*, int)>;

Guolin Ke's avatar
Guolin Ke committed
26
using PredictFunction =
Guolin Ke's avatar
Guolin Ke committed
27
std::function<void(const std::vector<std::pair<int, double>>&, double* output)>;
Guolin Ke's avatar
Guolin Ke committed
28
29
30

#define NO_SPECIFIC (-1)

31
32
33
34
#if (_MSC_VER <= 1800)
#define __func__ __FUNCTION__
#endif

Guolin Ke's avatar
Guolin Ke committed
35
36
}  // namespace LightGBM

Guolin Ke's avatar
Guolin Ke committed
37
#endif   // LightGBM_META_H_