public class ModelUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static float[] |
DEFAULT_THRESHOLDS
List of default thresholds
|
| Constructor and Description |
|---|
ModelUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
getPrediction(float[] preds,
double[] data)
Utility function to get a best prediction from an array of class
prediction distribution.
|
static int |
getPrediction(float[] preds,
int row) |
static int[] |
sampleOOBRows(int nrows,
float rate,
java.util.Random sampler)
Sample out-of-bag rows with given rate with help of given sampler.
|
static int[] |
sampleOOBRows(int nrows,
float rate,
java.util.Random sampler,
int[] oob)
In-situ version of
sampleOOBRows(int, float, Random). |
public static int getPrediction(float[] preds,
double[] data)
preds - an array of prediction distribution. Length of arrays is equal to a number of classes+1.public static int getPrediction(float[] preds,
int row)
public static int[] sampleOOBRows(int nrows,
float rate,
java.util.Random sampler)
nrows - number of rows to sample from.rate - sampling ratesampler - random "dice"public static int[] sampleOOBRows(int nrows,
float rate,
java.util.Random sampler,
int[] oob)
sampleOOBRows(int, float, Random).oob - an initial array to hold sampled rows. Can be internally realocted.sampleOOBRows(int, float, Random)