public final class BatchExecutorBuilder extends Object
IBatchExecutor
implementation.Modifier and Type | Field and Description |
---|---|
static long |
BUFFER_CLEARANCE_TIMEOUT_DEFAULT
1000L as default time in milliseconds to wait until blocking queue will be free.
|
static int |
BUFFER_SIZE_DEFAULT
1000 as default size of blocking queue.
|
static int |
CHUNK_SIZE_DEFAULT
150 as default chunk size to split initial data.
|
static boolean |
FAIL_FAST_DEFAULT
false as default for failing fast after any exception.
|
static String |
PRED_NAME_DEFAULT
"DR_Score" as default score name in output for regression.
|
static boolean |
PREDICTION_ONLY_DEFAULT
false as default for use only predictions as output.
|
static boolean |
PRESERVE_ORDERING_DEFAULT
true as default for preserving initial order of the scores.
|
static int |
THREADS_COUNT_DEFAULT
Constant equals to the number of available processor cores.
|
Constructor and Description |
---|
BatchExecutorBuilder(IClassificationPredictor predictor)
Constructor for builder using Classification Model.
|
BatchExecutorBuilder(IRegressionPredictor predictor)
Constructor for builder using Regression Model.
|
Modifier and Type | Method and Description |
---|---|
BatchExecutorBuilder |
bufferSize(int bufferSize)
Sets the size of the blocking queue for scheduling scoring threads work.
|
IBatchExecutor |
build()
Constructs the implementation of
IBatchExecutor based on parameters. |
BatchExecutorBuilder |
chunkSize(int chunkSize)
Sets the chunk size for splitting initial data.
|
BatchExecutorBuilder |
failFast(boolean failFast)
Sets the flag that indicates if we need to stop ASAP after
any exception appear or proceed further.
|
BatchExecutorBuilder |
logger(org.slf4j.Logger logger)
Sets the logger to use for batch scoring.
|
BatchExecutorBuilder |
outputPredictionsOnly(boolean predictionsOnly)
Sets the flag if we need output only predictions.
|
BatchExecutorBuilder |
predName(String predName)
Sets the name of the score for regression.
|
BatchExecutorBuilder |
preserveOrdering(boolean preserveOrdering)
Sets the flag if we need output results in the same order as corresponding inputs.
|
BatchExecutorBuilder |
threadsCount(int threadsCount)
Sets the number of threads to use for scoring.
|
BatchExecutorBuilder |
timeout(long milliseconds)
Sets the timeout for waiting the queue to free some capacity for new tasks.
|
public static final int THREADS_COUNT_DEFAULT
public static final boolean PREDICTION_ONLY_DEFAULT
public static final boolean PRESERVE_ORDERING_DEFAULT
public static final boolean FAIL_FAST_DEFAULT
public static final int CHUNK_SIZE_DEFAULT
public static final long BUFFER_CLEARANCE_TIMEOUT_DEFAULT
public static final int BUFFER_SIZE_DEFAULT
public static final String PRED_NAME_DEFAULT
public BatchExecutorBuilder(IRegressionPredictor predictor)
predictor
- implementation of the IRegressionPredictor
interface.public BatchExecutorBuilder(IClassificationPredictor predictor)
predictor
- implementation of the IClassificationPredictor
interface.public BatchExecutorBuilder outputPredictionsOnly(boolean predictionsOnly)
DEFAULT VALUE: false
predictionsOnly
- true if only predictor output use as output,
false if also add initial scoring inputs add to output.predictionsOnly
flag.public BatchExecutorBuilder preserveOrdering(boolean preserveOrdering)
DEFAULT VALUE: true
preserveOrdering
- true if in the same order,
false if you have any row id to distinguish results correspondingly.preserveOrdering
flag.public BatchExecutorBuilder logger(org.slf4j.Logger logger)
DEFAULT VALUE: org.slf4j.LoggerFactory.getLogger(BatchExecutorBuilder.class)
logger
- logger implementation.public BatchExecutorBuilder failFast(boolean failFast)
DEFAULT VALUE: "DR_Score"
failFast
- true if you want to fail ASAP,
false if continue scoring.failFast
flag.public BatchExecutorBuilder chunkSize(int chunkSize)
DEFAULT VALUE: 150
chunkSize
- chunk size to use.chunkSize
field.public BatchExecutorBuilder threadsCount(int threadsCount)
DEFAULT VALUE: number of available cores.
threadsCount
- number of threads to use.threadsCount
field.public BatchExecutorBuilder bufferSize(int bufferSize)
DEFAULT VALUE: 1000
bufferSize
- buffer size.bufferSize
field.public BatchExecutorBuilder timeout(long milliseconds)
DEFAULT VALUE: 1000L
milliseconds
- timeout in milliseconds.milliseconds
field.public BatchExecutorBuilder predName(String predName)
NOTE: For classification requests this field is not used.
DEFAULT VALUE: "DR_Score"
predName
- name to use for scoring output.predName
field.public IBatchExecutor build()
IBatchExecutor
based on parameters.IBatchExecutor
.Copyright © 2019. All rights reserved.