Class SVMModel
Object
org.apache.spark.mllib.regression.GeneralizedLinearModel
org.apache.spark.mllib.classification.SVMModel
- All Implemented Interfaces:
Serializable,ClassificationModel,PMMLExportable,Saveable
public class SVMModel
extends GeneralizedLinearModel
implements ClassificationModel, Serializable, Saveable, PMMLExportable
Model for Support Vector Machines (SVMs).
param: weights Weights computed for every feature. param: intercept Intercept computed for this model.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClears the threshold so thatpredictwill output raw prediction scores.scala.Option<Object>Returns the threshold (if any) used for converting raw prediction scores into 0/1 predictions.doublestatic SVMModelload(SparkContext sc, String path) voidsave(SparkContext sc, String path) Save this model to the given path.setThreshold(double threshold) Sets the threshold that separates positive predictions from negative predictions.toString()Print a summary of the model.weights()Methods inherited from class org.apache.spark.mllib.regression.GeneralizedLinearModel
predict, predictMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.spark.mllib.classification.ClassificationModel
predict, predict, predict
-
Constructor Details
-
SVMModel
-
-
Method Details
-
load
-
weights
- Overrides:
weightsin classGeneralizedLinearModel
-
intercept
public double intercept()- Overrides:
interceptin classGeneralizedLinearModel
-
setThreshold
Sets the threshold that separates positive predictions from negative predictions. An example with prediction score greater than or equal to this threshold is identified as a positive, and negative otherwise. The default value is 0.0.- Parameters:
threshold- (undocumented)- Returns:
- (undocumented)
-
getThreshold
Returns the threshold (if any) used for converting raw prediction scores into 0/1 predictions.- Returns:
- (undocumented)
-
clearThreshold
Clears the threshold so thatpredictwill output raw prediction scores.- Returns:
- (undocumented)
-
save
Description copied from interface:SaveableSave this model to the given path.This saves: - human-readable (JSON) model metadata to path/metadata/ - Parquet formatted data to path/data/
The model may be loaded using
Loader.load. -
toString
Description copied from class:GeneralizedLinearModelPrint a summary of the model.- Overrides:
toStringin classGeneralizedLinearModel- Returns:
- (undocumented)
-