aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorYuhao Yang <yuhao.yang@intel.com>2017-02-21 09:38:14 -0800
committerFelix Cheung <felixcheung@apache.org>2017-02-21 09:38:14 -0800
commit280afe0ef384433eae2076cda569c5f1b3e49d42 (patch)
tree3094225b03b30bea69a5e0f0a7019a3f225624aa /docs
parent17b93b5feb7595e5b881f288a2774acb5a77e0ab (diff)
downloadspark-280afe0ef384433eae2076cda569c5f1b3e49d42.tar.gz
spark-280afe0ef384433eae2076cda569c5f1b3e49d42.tar.bz2
spark-280afe0ef384433eae2076cda569c5f1b3e49d42.zip
[SPARK-19337][ML][DOC] Documentation and examples for LinearSVC
## What changes were proposed in this pull request? Documentation and examples (Java, scala, python, R) for LinearSVC ## How was this patch tested? local doc generation Author: Yuhao Yang <yuhao.yang@intel.com> Closes #16968 from hhbyyh/mlsvmdoc.
Diffstat (limited to 'docs')
-rw-r--r--docs/ml-classification-regression.md44
1 files changed, 44 insertions, 0 deletions
diff --git a/docs/ml-classification-regression.md b/docs/ml-classification-regression.md
index 782ee58188..37862f82c3 100644
--- a/docs/ml-classification-regression.md
+++ b/docs/ml-classification-regression.md
@@ -363,6 +363,50 @@ Refer to the [R API docs](api/R/spark.mlp.html) for more details.
</div>
+## Linear Support Vector Machine
+
+A [support vector machine](https://en.wikipedia.org/wiki/Support_vector_machine) constructs a hyperplane
+or set of hyperplanes in a high- or infinite-dimensional space, which can be used for classification,
+regression, or other tasks. Intuitively, a good separation is achieved by the hyperplane that has
+the largest distance to the nearest training-data points of any class (so-called functional margin),
+since in general the larger the margin the lower the generalization error of the classifier. LinearSVC
+in Spark ML supports binary classification with linear SVM. Internally, it optimizes the
+[Hinge Loss](https://en.wikipedia.org/wiki/Hinge_loss) using OWLQN optimizer.
+
+
+**Examples**
+
+<div class="codetabs">
+
+<div data-lang="scala" markdown="1">
+
+Refer to the [Scala API docs](api/scala/index.html#org.apache.spark.ml.classification.LinearSVC) for more details.
+
+{% include_example scala/org/apache/spark/examples/ml/LinearSVCExample.scala %}
+</div>
+
+<div data-lang="java" markdown="1">
+
+Refer to the [Java API docs](api/java/org/apache/spark/ml/classification/LinearSVC.html) for more details.
+
+{% include_example java/org/apache/spark/examples/ml/JavaLinearSVCExample.java %}
+</div>
+
+<div data-lang="python" markdown="1">
+
+Refer to the [Python API docs](api/python/pyspark.ml.html#pyspark.ml.classification.LinearSVC) for more details.
+
+{% include_example python/ml/linearsvc.py %}
+</div>
+
+<div data-lang="r" markdown="1">
+
+Refer to the [R API docs](api/R/spark.svmLinear.html) for more details.
+
+{% include_example r/ml/svmLinear.R %}
+</div>
+
+</div>
## One-vs-Rest classifier (a.k.a. One-vs-All)