public class LinearSVC extends Classifier<Vector,LinearSVC,LinearSVCModel> implements LinearSVCParams, DefaultParamsWritable
This binary classifier optimizes the Hinge Loss using the OWLQN optimizer. Only supports L2 regularization currently.
Since 3.1.0, it supports stacking instances into blocks and using GEMV for better performance. The block size will be 1.0 MB, if param maxBlockSizeInMB is set 0.0 by default.
| Modifier and Type | Method and Description |
|---|---|
IntParam |
aggregationDepth()
Param for suggested depth for treeAggregate (>= 2).
|
LinearSVC |
copy(ParamMap extra)
Creates a copy of this instance with the same UID and some extra params.
|
BooleanParam |
fitIntercept()
Param for whether to fit an intercept term.
|
static LinearSVC |
load(String path) |
DoubleParam |
maxBlockSizeInMB()
Param for Maximum memory in MB for stacking input data into blocks.
|
IntParam |
maxIter()
Param for maximum number of iterations (>= 0).
|
static MLReader<T> |
read() |
DoubleParam |
regParam()
Param for regularization parameter (>= 0).
|
LinearSVC |
setAggregationDepth(int value)
Suggested depth for treeAggregate (greater than or equal to 2).
|
LinearSVC |
setFitIntercept(boolean value)
Whether to fit an intercept term.
|
LinearSVC |
setMaxBlockSizeInMB(double value)
Sets the value of param
maxBlockSizeInMB. |
LinearSVC |
setMaxIter(int value)
Set the maximum number of iterations.
|
LinearSVC |
setRegParam(double value)
Set the regularization parameter.
|
LinearSVC |
setStandardization(boolean value)
Whether to standardize the training features before fitting the model.
|
LinearSVC |
setThreshold(double value)
Set threshold in binary classification.
|
LinearSVC |
setTol(double value)
Set the convergence tolerance of iterations.
|
LinearSVC |
setWeightCol(String value)
Set the value of param
weightCol. |
BooleanParam |
standardization()
Param for whether to standardize the training features before fitting the model.
|
DoubleParam |
threshold()
Param for threshold in binary classification prediction.
|
DoubleParam |
tol()
Param for the convergence tolerance for iterative algorithms (>= 0).
|
String |
uid()
An immutable unique ID for the object and its derivatives.
|
Param<String> |
weightCol()
Param for weight column name.
|
rawPredictionCol, setRawPredictionColfeaturesCol, fit, labelCol, predictionCol, setFeaturesCol, setLabelCol, setPredictionCol, transformSchemaparamsequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvalidateAndTransformSchemagetLabelCol, labelColfeaturesCol, getFeaturesColgetPredictionCol, predictionColclear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, onParamChange, paramMap, params, set, set, set, setDefault, setDefault, shouldOwntoStringgetRawPredictionCol, rawPredictionColgetRegParamgetMaxItergetFitInterceptgetStandardizationgetWeightColgetAggregationDepthgetThresholdgetMaxBlockSizeInMBwritesave$init$, initializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, initLock, isTraceEnabled, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning, org$apache$spark$internal$Logging$$log__$eq, org$apache$spark$internal$Logging$$log_, uninitializepublic static LinearSVC load(String path)
public static MLReader<T> read()
public final DoubleParam threshold()
LinearSVCParamsthreshold in interface LinearSVCParamsthreshold in interface HasThresholdpublic final DoubleParam maxBlockSizeInMB()
HasMaxBlockSizeInMBmaxBlockSizeInMB in interface HasMaxBlockSizeInMBpublic final IntParam aggregationDepth()
HasAggregationDepthaggregationDepth in interface HasAggregationDepthpublic final Param<String> weightCol()
HasWeightColweightCol in interface HasWeightColpublic final BooleanParam standardization()
HasStandardizationstandardization in interface HasStandardizationpublic final DoubleParam tol()
HasTolpublic final BooleanParam fitIntercept()
HasFitInterceptfitIntercept in interface HasFitInterceptpublic final IntParam maxIter()
HasMaxItermaxIter in interface HasMaxIterpublic final DoubleParam regParam()
HasRegParamregParam in interface HasRegParampublic String uid()
Identifiableuid in interface Identifiablepublic LinearSVC setRegParam(double value)
value - (undocumented)public LinearSVC setMaxIter(int value)
value - (undocumented)public LinearSVC setFitIntercept(boolean value)
value - (undocumented)public LinearSVC setTol(double value)
value - (undocumented)public LinearSVC setStandardization(boolean value)
value - (undocumented)public LinearSVC setWeightCol(String value)
weightCol.
If this is not set or empty, we treat all instance weights as 1.0.
Default is not set, so all instances have weight one.
value - (undocumented)public LinearSVC setThreshold(double value)
value - (undocumented)public LinearSVC setAggregationDepth(int value)
value - (undocumented)public LinearSVC setMaxBlockSizeInMB(double value)
maxBlockSizeInMB.
Default is 0.0, then 1.0 MB will be chosen.
value - (undocumented)