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, setRawPredictionCol
featuresCol, fit, labelCol, predictionCol, setFeaturesCol, setLabelCol, setPredictionCol, transformSchema
params
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
extractInstances, validateAndTransformSchema
extractInstances, extractInstances
getLabelCol, labelCol
featuresCol, getFeaturesCol
getPredictionCol, predictionCol
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, onParamChange, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn
toString
getRawPredictionCol, rawPredictionCol
getRegParam
getMaxIter
getFitIntercept
getStandardization
getWeightCol
getAggregationDepth
getThreshold
getMaxBlockSizeInMB
write
save
$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_, uninitialize
public static LinearSVC load(String path)
public static MLReader<T> read()
public final DoubleParam threshold()
LinearSVCParams
threshold
in interface LinearSVCParams
threshold
in interface HasThreshold
public final DoubleParam maxBlockSizeInMB()
HasMaxBlockSizeInMB
maxBlockSizeInMB
in interface HasMaxBlockSizeInMB
public final IntParam aggregationDepth()
HasAggregationDepth
aggregationDepth
in interface HasAggregationDepth
public final Param<String> weightCol()
HasWeightCol
weightCol
in interface HasWeightCol
public final BooleanParam standardization()
HasStandardization
standardization
in interface HasStandardization
public final DoubleParam tol()
HasTol
public final BooleanParam fitIntercept()
HasFitIntercept
fitIntercept
in interface HasFitIntercept
public final IntParam maxIter()
HasMaxIter
maxIter
in interface HasMaxIter
public final DoubleParam regParam()
HasRegParam
regParam
in interface HasRegParam
public String uid()
Identifiable
uid
in interface Identifiable
public 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)