class_docstr: Train a Support Vector Machine (SVM) using Stochastic Gradient Descent.
  
  .. versionadded:: 0.9.0
class_docstr_tok: ["Train","a","Support","Vector","Machine","(","SVM",")","using","Stochastic","Gradient","Descent",".","..","versionadded",":",":","0.9.0"]
docstr: Train a support vector machine on the given data.
  
  .. versionadded:: 0.9.0
  
  Parameters
  ----------
  data : :py:class:`pyspark.RDD`
      The training data, an RDD of :py:class:`pyspark.mllib.regression.LabeledPoint`.
  iterations : int, optional
      The number of iterations.
      (default: 100)
  step : float, optional
      The step parameter used in SGD.
      (default: 1.0)
  regParam : float, optional
      The regularizer parameter.
      (default: 0.01)
  miniBatchFraction : float, optional
      Fraction of data to be used for each SGD iteration.
      (default: 1.0)
  initialWeights : :py:class:`pyspark.mllib.linalg.Vector` or convertible, optional
      The initial weights.
      (default: None)
  regType : str, optional
      The type of regularizer used for training our model.
      Allowed values:
  
      - "l1" for using L1 regularization
      - "l2" for using L2 regularization (default)
      - None for no regularization
  
  intercept : bool, optional
      Boolean parameter which indicates the use or not of the
      augmented representation for training data (i.e. whether bias
      features are activated or not).
      (default: False)
  validateData : bool, optional
      Boolean parameter which indicates if the algorithm should
      validate data before training.
      (default: True)
  convergenceTol : float, optional
      A condition which decides iteration termination.
      (default: 0.001)
docstr_tok: ["Train","a","support","vector","machine","on","the","given","data",".","..","versionadded",":",":","0.9.0","Parameters","--","--","--","--","--","data",":",":","py",":","class",":","`","pyspark.RDD","`","The","training","data",",","an","RDD","of",":","py",":","class",":","`","pyspark.mllib.regression.LabeledPoint","`",".","iterations",":","int",",","optional","The","number","of","iterations",".","(","default",":","100",")","step",":","float",",","optional","The","step","parameter","used","in","SGD",".","(","default",":","1.0",")","regParam",":","float",",","optional","The","regularizer","parameter",".","(","default",":","0.01",")","miniBatchFraction",":","float",",","optional","Fraction","of","data","to","be","used","for","each","SGD","iteration",".","(","default",":","1.0",")","initialWeights",":",":","py",":","class",":","`","pyspark.mllib.linalg.Vector","`","or","convertible",",","optional","The","initial","weights",".","(","default",":","None",")","regType",":","str",",","optional","The","type","of","regularizer","used","for","training","our","model",".","Allowed","values",":","-","``","l1","''","for","using","L1","regularization","-","``","l2","''","for","using","L2","regularization","(","default",")","-","None","for","no","regularization","intercept",":","bool",",","optional","Boolean","parameter","which","indicates","the","use","or","not","of","the","augmented","representation","for","training","data","(","i.e",".","whether","bias","features","are","activated","or","not",")",".","(","default",":","False",")","validateData",":","bool",",","optional","Boolean","parameter","which","indicates","if","the","algorithm","should","validate","data","before","training",".","(","default",":","True",")","convergenceTol",":","float",",","optional","A","condition","which","decides","iteration","termination",".","(","default",":","0.001",")"]
code: def train(
      cls,
      data: RDD[LabeledPoint],
      iterations: int = 100,
      step: float = 1.0,
      regParam: float = 0.01,
      miniBatchFraction: float = 1.0,
      initialWeights: Optional["VectorLike"] = None,
      regType: str = "l2",
      intercept: bool = False,
      validateData: bool = True,
      convergenceTol: float = 0.001,
  ) -> SVMModel:
      """
      Train a support vector machine on the given data.
  
      .. versionadded:: 0.9.0
  
      Parameters
      ----------
      data : :py:class:`pyspark.RDD`
          The training data, an RDD of :py:class:`pyspark.mllib.regression.LabeledPoint`.
      iterations : int, optional
          The number of iterations.
          (default: 100)
      step : float, optional
          The step parameter used in SGD.
          (default: 1.0)
      regParam : float, optional
          The regularizer parameter.
          (default: 0.01)
      miniBatchFraction : float, optional
          Fraction of data to be used for each SGD iteration.
          (default: 1.0)
      initialWeights : :py:class:`pyspark.mllib.linalg.Vector` or convertible, optional
          The initial weights.
          (default: None)
      regType : str, optional
          The type of regularizer used for training our model.
          Allowed values:
  
          - "l1" for using L1 regularization
          - "l2" for using L2 regularization (default)
          - None for no regularization
  
      intercept : bool, optional
          Boolean parameter which indicates the use or not of the
          augmented representation for training data (i.e. whether bias
          features are activated or not).
          (default: False)
      validateData : bool, optional
          Boolean parameter which indicates if the algorithm should
          validate data before training.
          (default: True)
      convergenceTol : float, optional
          A condition which decides iteration termination.
          (default: 0.001)
      """
  
      def train(rdd: RDD[LabeledPoint], i: Vector) -> Iterable[Any]:
          return callMLlibFunc(
              "trainSVMModelWithSGD",
              rdd,
              int(iterations),
              float(step),
              float(regParam),
              float(miniBatchFraction),
              i,
              regType,
              bool(intercept),
              bool(validateData),
              float(convergenceTol),
          )
  
      return _regression_train_wrapper(
          train, SVMModel, data, initialWeights
      )
  
imports: from math import exp
  import sys
  import warnings
  from typing import Any, Iterable, Optional, Union, overload, TYPE_CHECKING
  import numpy
  from pyspark import RDD, SparkContext, since
  from pyspark.streaming.dstream import DStream
  from pyspark.mllib.common import callMLlibFunc, _py2java, _java2py
  from pyspark.mllib.linalg import _convert_to_vector
  from pyspark.mllib.regression import LabeledPoint, LinearModel, _regression_train_wrapper, StreamingLinearAlgorithm
  from pyspark.mllib.util import Saveable, Loader, inherit_doc
  from pyspark.mllib.linalg import Vector
  from pyspark.mllib.regression import LabeledPoint
label_desc: Use image node_id 1 for calling the SVMWithSGD obj's underlying member method code with example usage: obj.train(cls, data, iterations, step, regParam, miniBatchFraction, initialWeights, regType, intercept, validateData, convergenceTol) and returns: _regression_train_wrapper, callMLlibFunc