public class LinearSVC extends Classifier<Vector,LinearSVC,LinearSVCModel> implements DefaultParamsWritable
This binary classifier optimizes the Hinge Loss using the OWLQN optimizer. Only supports L2 regularization currently.
Modifier and Type | Method and Description |
---|---|
static IntParam |
aggregationDepth() |
static Params |
clear(Param<?> param) |
LinearSVC |
copy(ParamMap extra)
Creates a copy of this instance with the same UID and some extra params.
|
static String |
explainParam(Param<?> param) |
static String |
explainParams() |
static ParamMap |
extractParamMap() |
static ParamMap |
extractParamMap(ParamMap extra) |
static Param<String> |
featuresCol() |
static M |
fit(Dataset<?> dataset) |
static M |
fit(Dataset<?> dataset,
ParamMap paramMap) |
static scala.collection.Seq<M> |
fit(Dataset<?> dataset,
ParamMap[] paramMaps) |
static M |
fit(Dataset<?> dataset,
ParamPair<?> firstParamPair,
ParamPair<?>... otherParamPairs) |
static M |
fit(Dataset<?> dataset,
ParamPair<?> firstParamPair,
scala.collection.Seq<ParamPair<?>> otherParamPairs) |
static BooleanParam |
fitIntercept() |
static <T> scala.Option<T> |
get(Param<T> param) |
static int |
getAggregationDepth() |
static <T> scala.Option<T> |
getDefault(Param<T> param) |
static String |
getFeaturesCol() |
static boolean |
getFitIntercept() |
static String |
getLabelCol() |
static int |
getMaxIter() |
static <T> T |
getOrDefault(Param<T> param) |
static Param<Object> |
getParam(String paramName) |
static String |
getPredictionCol() |
static String |
getRawPredictionCol() |
static double |
getRegParam() |
static boolean |
getStandardization() |
static double |
getThreshold() |
static double |
getTol() |
static String |
getWeightCol() |
static <T> boolean |
hasDefault(Param<T> param) |
static boolean |
hasParam(String paramName) |
static boolean |
isDefined(Param<?> param) |
static boolean |
isSet(Param<?> param) |
static Param<String> |
labelCol() |
static LinearSVC |
load(String path) |
static IntParam |
maxIter() |
static Param<?>[] |
params() |
static Param<String> |
predictionCol() |
static Param<String> |
rawPredictionCol() |
static DoubleParam |
regParam() |
static void |
save(String path) |
static <T> Params |
set(Param<T> param,
T value) |
LinearSVC |
setAggregationDepth(int value)
Suggested depth for treeAggregate (greater than or equal to 2).
|
static Learner |
setFeaturesCol(String value) |
LinearSVC |
setFitIntercept(boolean value)
Whether to fit an intercept term.
|
static Learner |
setLabelCol(String value) |
LinearSVC |
setMaxIter(int value)
Set the maximum number of iterations.
|
static Learner |
setPredictionCol(String value) |
static E |
setRawPredictionCol(String value) |
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 . |
static BooleanParam |
standardization() |
static DoubleParam |
threshold() |
DoubleParam |
threshold()
Param for threshold in binary classification prediction.
|
static DoubleParam |
tol() |
static String |
toString() |
static StructType |
transformSchema(StructType schema) |
String |
uid()
An immutable unique ID for the object and its derivatives.
|
StructType |
validateAndTransformSchema(StructType schema,
boolean fitting,
DataType featuresDataType) |
StructType |
validateAndTransformSchema(StructType schema,
boolean fitting,
DataType featuresDataType)
Validates and transforms the input schema with the provided param map.
|
static Param<String> |
weightCol() |
static MLWriter |
write() |
setRawPredictionCol
fit, setFeaturesCol, setLabelCol, setPredictionCol, transformSchema
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRawPredictionCol, rawPredictionCol
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn
toString
getRegParam, regParam
getMaxIter, maxIter
fitIntercept, getFitIntercept
getStandardization, standardization
getWeightCol, weightCol
aggregationDepth, getAggregationDepth
getThreshold
write
save
getLabelCol, labelCol
featuresCol, getFeaturesCol
getPredictionCol, predictionCol
initializeLogging, initializeLogIfNecessary, initializeLogIfNecessary, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
public static LinearSVC load(String path)
public static String toString()
public static Param<?>[] params()
public static String explainParam(Param<?> param)
public static String explainParams()
public static final boolean isSet(Param<?> param)
public static final boolean isDefined(Param<?> param)
public static boolean hasParam(String paramName)
public static Param<Object> getParam(String paramName)
public static final <T> scala.Option<T> get(Param<T> param)
public static final <T> T getOrDefault(Param<T> param)
public static final <T> scala.Option<T> getDefault(Param<T> param)
public static final <T> boolean hasDefault(Param<T> param)
public static final ParamMap extractParamMap()
public static M fit(Dataset<?> dataset, ParamPair<?> firstParamPair, scala.collection.Seq<ParamPair<?>> otherParamPairs)
public static M fit(Dataset<?> dataset, ParamPair<?> firstParamPair, ParamPair<?>... otherParamPairs)
public static final Param<String> labelCol()
public static final String getLabelCol()
public static final Param<String> featuresCol()
public static final String getFeaturesCol()
public static final Param<String> predictionCol()
public static final String getPredictionCol()
public static Learner setLabelCol(String value)
public static Learner setFeaturesCol(String value)
public static Learner setPredictionCol(String value)
public static M fit(Dataset<?> dataset)
public static StructType transformSchema(StructType schema)
public static final Param<String> rawPredictionCol()
public static final String getRawPredictionCol()
public static E setRawPredictionCol(String value)
public static final DoubleParam regParam()
public static final double getRegParam()
public static final IntParam maxIter()
public static final int getMaxIter()
public static final BooleanParam fitIntercept()
public static final boolean getFitIntercept()
public static final DoubleParam tol()
public static final double getTol()
public static final BooleanParam standardization()
public static final boolean getStandardization()
public static final Param<String> weightCol()
public static final String getWeightCol()
public static final IntParam aggregationDepth()
public static final int getAggregationDepth()
public static double getThreshold()
public static final DoubleParam threshold()
public static void save(String path) throws java.io.IOException
java.io.IOException
public static MLWriter write()
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 copy(ParamMap extra)
Params
defaultCopy()
.public DoubleParam threshold()
threshold
in interface HasThreshold
public StructType validateAndTransformSchema(StructType schema, boolean fitting, DataType featuresDataType)
public StructType validateAndTransformSchema(StructType schema, boolean fitting, DataType featuresDataType)
schema
- input schemafitting
- whether this is in fittingfeaturesDataType
- SQL DataType for FeaturesType.
E.g., VectorUDT
for vector features.