Package org.apache.spark.ml.param.shared
Interface HasParallelism
- All Superinterfaces:
Identifiable
,Params
,Serializable
- All Known Implementing Classes:
CrossValidator
,OneVsRest
,TrainValidationSplit
Trait to define a level of parallelism for algorithms that are able to use
multithreaded execution, and provide a thread-pool based execution context.
-
Method Summary
Modifier and TypeMethodDescriptionscala.concurrent.ExecutionContext
Create a new execution context with a thread-pool that has a maximum number of threads set to the value ofparallelism()
.int
The number of threads to use when running parallel algorithms.Methods inherited from interface org.apache.spark.ml.util.Identifiable
toString, uid
Methods inherited from interface org.apache.spark.ml.param.Params
clear, copy, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, onParamChange, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn
-
Method Details
-
getExecutionContext
scala.concurrent.ExecutionContext getExecutionContext()Create a new execution context with a thread-pool that has a maximum number of threads set to the value ofparallelism()
. If this param is set to 1, a same-thread executor will be used to run in serial.- Returns:
- (undocumented)
-
getParallelism
int getParallelism() -
parallelism
IntParam parallelism()The number of threads to use when running parallel algorithms. Default is 1 for serial execution- Returns:
- (undocumented)
-