A wrapper for random generator.
More...
#include <random.h>
|
|
| Random () |
| | Constructor, with random seed.
|
| |
|
| Random (int seed) |
| | Constructor, with specific seed.
|
| |
| int | NextShort (int lower_bound, int upper_bound) |
| | Generate random integer, int16 range. [0, 65536].
|
| |
| int | NextInt (int lower_bound, int upper_bound) |
| | Generate random integer, int32 range.
|
| |
| float | NextFloat () |
| | Generate random float data.
|
| |
| std::vector< int > | Sample (int N, int K) |
| | Sample K data from {0,1,...,N-1}.
|
| |
A wrapper for random generator.
◆ NextFloat()
| float LightGBM::Random::NextFloat |
( |
| ) |
|
|
inline |
Generate random float data.
- Returns
- The random float between [0.0, 1.0)
◆ NextInt()
| int LightGBM::Random::NextInt |
( |
int |
lower_bound, |
|
|
int |
upper_bound |
|
) |
| |
|
inline |
Generate random integer, int32 range.
- Parameters
-
| lower_bound | lower bound |
| upper_bound | upper bound |
- Returns
- The random integer between [lower_bound, upper_bound)
◆ NextShort()
| int LightGBM::Random::NextShort |
( |
int |
lower_bound, |
|
|
int |
upper_bound |
|
) |
| |
|
inline |
Generate random integer, int16 range. [0, 65536].
- Parameters
-
| lower_bound | lower bound |
| upper_bound | upper bound |
- Returns
- The random integer between [lower_bound, upper_bound)
◆ Sample()
| std::vector< int > LightGBM::Random::Sample |
( |
int |
N, |
|
|
int |
K |
|
) |
| |
|
inline |
Sample K data from {0,1,...,N-1}.
- Parameters
-
- Returns
- K Ordered sampled data from {0,1,...,N-1}
The documentation for this class was generated from the following file:
- External/LightGBM_2.2.3/LightGBM-2.2.3/include/LightGBM/utils/random.h