class_docstr: Support Vector Machines can be used to predict binary target variable using
  several feature variables.
  
  The :py:class:`~turicreate.svm.SVMClassifier` model predicts a binary target
  variable given one or more feature variables. In an SVM model, the examples
  are represented as points in space, mapped so that the examples from the
  two classes being classified are divided by linear separator.
  
  Given a set of features :math:`x_i`, and a label :math:`y_i \in \{0,1\}`,
  SVM minimizes the loss function:
  
      .. math::
        f_i(\theta) =  \max(1 - \theta^T x, 0)
  
  An intercept term is added by appending a column of 1's to the features.
  Regularization is often required to prevent over fitting by penalizing
  models with extreme parameter values. The composite objective being
  optimized for is the following:
  
      .. math::
         \min_{\theta} \sum_{i = 1}^{n} f_i(\theta) + \lambda ||\theta||^{2}_{2}
  
  where :math:`\lambda` is the ``penalty`` parameter.
  
  This model cannot be constructed directly.  Instead, use
  :func:`turicreate.svm_classifier.create` to create an instance of this model.
  Additional details on parameter options and code samples are available in
  the documentation for the create function.
  
  Examples
  --------
  
  .. sourcecode:: python
  
      # Load the data (From an S3 bucket)
      >>> import turicreate as tc
      >>> data =  tc.SFrame('https://static.turi.com/datasets/regression/houses.csv')
  
      # Make sure the target is binary 0/1
      >>> data['is_expensive'] = data['price'] > 30000
  
      # Make a logistic regression model
      >>> model = tc.svm_classifier.create(data, target='is_expensive'
                                      , features=['bath', 'bedroom', 'size'])
  
      # Extract the coefficients
      >>> coefficients = model.coefficients # an SFrame
  
      # Make predictions (as margins, or class)
      >>> predictions = model.progressredict(data)    # Predicts 0/1
      >>> predictions = model.progressredict(data, output_type='margin')
  
      # Evaluate the model
      >>> results = model.progressvaluate(data)               # a dictionary
  
  See Also
  --------
  create
class_docstr_tok: ["Support","Vector","Machines","can","be","used","to","predict","binary","target","variable","using","several","feature","variables",".","The",":","py",":","class",":","`","~turicreate.svm.SVMClassifier","`","model","predicts","a","binary","target","variable","given","one","or","more","feature","variables",".","In","an","SVM","model",",","the","examples","are","represented","as","points","in","space",",","mapped","so","that","the","examples","from","the","two","classes","being","classified","are","divided","by","linear","separator",".","Given","a","set","of","features",":","math",":","`","x_i","`",",","and","a","label",":","math",":","`","y_i","\\in","\\","{","0,1\\","}","`",",","SVM","minimizes","the","loss","function",":","..","math",":",":","f_i","(","\\theta",")","=","\\max","(","1","-","\\theta^T","x",",","0",")","An","intercept","term","is","added","by","appending","a","column","of","1","'s","to","the","features",".","Regularization","is","often","required","to","prevent","over","fitting","by","penalizing","models","with","extreme","parameter","values",".","The","composite","objective","being","optimized","for","is","the","following",":","..","math",":",":","\\min_","{","\\theta","}","\\sum_","{","i","=","1","}","^","{","n","}","f_i","(","\\theta",")","+","\\lambda","||\\theta||^","{","2","}","_","{","2","}","where",":","math",":","`","\\lambda","`","is","the","``","penalty","``","parameter",".","This","model","can","not","be","constructed","directly",".","Instead",",","use",":","func",":","`","turicreate.svm_classifier.create","`","to","create","an","instance","of","this","model",".","Additional","details","on","parameter","options","and","code","samples","are","available","in","the","documentation","for","the","create","function",".","Examples","--","--","--","--","..","sourcecode",":",":","python","#","Load","the","data","(","From","an","S3","bucket",")",">",">",">","import","turicreate","as","tc",">",">",">","data","=","tc.SFrame","(","'https",":","\/\/static.turi.com\/datasets\/regression\/houses.csv","'",")","#","Make","sure","the","target","is","binary","0\/1",">",">",">","data","[","'is_expensive","'","]","=","data","[","'price","'","]",">","30000","#","Make","a","logistic","regression","model",">",">",">","model","=","tc.svm_classifier.create","(","data",",","target='is_expensive'",",","features=","[","'bath","'",",","'bedroom","'",",","'size","'","]",")","#","Extract","the","coefficients",">",">",">","coefficients","=","model.coefficients","#","an","SFrame","#","Make","predictions","(","as","margins",",","or","class",")",">",">",">","predictions","=","model.progressredict","(","data",")","#","Predicts","0\/1",">",">",">","predictions","=","model.progressredict","(","data",",","output_type='margin","'",")","#","Evaluate","the","model",">",">",">","results","=","model.progressvaluate","(","data",")","#","a","dictionary","See","Also","--","--","--","--","create"]
docstr: Return predictions for ``dataset``, using the trained logistic
  regression model. Predictions can be generated as class labels (0 or
  1), or margins (i.e. the distance of the observations from the hyperplane
  separating the classes). By default, the predict method returns class
  labels.
  
  For each new example in ``dataset``, the margin---also known as the
  linear predictor---is the inner product of the example and the model
  coefficients plus the intercept term. Predicted classes are obtained by
  thresholding the margins at 0.
  
  Parameters
  ----------
  dataset : SFrame | dict
      Dataset of new observations. Must include columns with the same
      names as the features used for model training, but does not require
      a target column. Additional columns are ignored.
  
  output_type : {'margin', 'class'}, optional
      Form of the predictions which are one of:
  
      - 'margin': Distance of the observations from the hyperplane
        separating the classes.
      - 'class': Class prediction.
  
  missing_value_action : str, optional
      Action to perform when missing values are encountered. This can be
      one of:
  
      - 'auto': Default to 'impute'
      - 'impute': Proceed with evaluation by filling in the missing
        values with the mean of the training data. Missing
        values are also imputed if an entire column of data is
        missing during evaluation.
      - 'error' : Do not proceed with prediction and terminate with
        an error message.
  
  Returns
  -------
  out : SArray
      An SArray with model predictions.
  
  See Also
  ----------
  create, evaluate, classify
  
  Examples
  ----------
  >>> data =  turicreate.SFrame('https://static.turi.com/datasets/regression/houses.csv')
  
  >>> data['is_expensive'] = data['price'] > 30000
  >>> model = turicreate.svm_classifier.create(data,
                            target='is_expensive',
                            features=['bath', 'bedroom', 'size'])
  
  >>> class_predictions = model.progressredict(data)
  >>> margin_predictions = model.progressredict(data, output_type='margin')
docstr_tok: ["Return","predictions","for","``","dataset","``",",","using","the","trained","logistic","regression","model",".","Predictions","can","be","generated","as","class","labels","(","0","or","1",")",",","or","margins","(","i.e",".","the","distance","of","the","observations","from","the","hyperplane","separating","the","classes",")",".","By","default",",","the","predict","method","returns","class","labels",".","For","each","new","example","in","``","dataset","``",",","the","margin","--","-also","known","as","the","linear","predictor","--","-is","the","inner","product","of","the","example","and","the","model","coefficients","plus","the","intercept","term",".","Predicted","classes","are","obtained","by","thresholding","the","margins","at","0",".","Parameters","--","--","--","--","--","dataset",":","SFrame","|","dict","Dataset","of","new","observations",".","Must","include","columns","with","the","same","names","as","the","features","used","for","model","training",",","but","does","not","require","a","target","column",".","Additional","columns","are","ignored",".","output_type",":","{","'margin","'",",","'class","'","}",",","optional","Form","of","the","predictions","which","are","one","of",":","-","'margin","'",":","Distance","of","the","observations","from","the","hyperplane","separating","the","classes",".","-","'class","'",":","Class","prediction",".","missing_value_action",":","str",",","optional","Action","to","perform","when","missing","values","are","encountered",".","This","can","be","one","of",":","-","'auto","'",":","Default","to","'impute'","-","'impute","'",":","Proceed","with","evaluation","by","filling","in","the","missing","values","with","the","mean","of","the","training","data",".","Missing","values","are","also","imputed","if","an","entire","column","of","data","is","missing","during","evaluation",".","-","'error","'",":","Do","not","proceed","with","prediction","and","terminate","with","an","error","message",".","Returns","--","--","--","-","out",":","SArray","An","SArray","with","model","predictions",".","See","Also","--","--","--","--","--","create",",","evaluate",",","classify","Examples","--","--","--","--","--",">",">",">","data","=","turicreate.SFrame","(","'https",":","\/\/static.turi.com\/datasets\/regression\/houses.csv","'",")",">",">",">","data","[","'is_expensive","'","]","=","data","[","'price","'","]",">","30000",">",">",">","model","=","turicreate.svm_classifier.create","(","data",",","target='is_expensive","'",",","features=","[","'bath","'",",","'bedroom","'",",","'size","'","]",")",">",">",">","class_predictions","=","model.progressredict","(","data",")",">",">",">","margin_predictions","=","model.progressredict","(","data",",","output_type='margin","'",")"]
code: def predict(
      self, dataset, output_type="class", missing_value_action="auto"
  ):
      """
      Return predictions for ``dataset``, using the trained logistic
      regression model. Predictions can be generated as class labels (0 or
      1), or margins (i.e. the distance of the observations from the hyperplane
      separating the classes). By default, the predict method returns class
      labels.
  
      For each new example in ``dataset``, the margin---also known as the
      linear predictor---is the inner product of the example and the model
      coefficients plus the intercept term. Predicted classes are obtained by
      thresholding the margins at 0.
  
      Parameters
      ----------
      dataset : SFrame | dict
          Dataset of new observations. Must include columns with the same
          names as the features used for model training, but does not require
          a target column. Additional columns are ignored.
  
      output_type : {'margin', 'class'}, optional
          Form of the predictions which are one of:
  
          - 'margin': Distance of the observations from the hyperplane
            separating the classes.
          - 'class': Class prediction.
  
      missing_value_action : str, optional
          Action to perform when missing values are encountered. This can be
          one of:
  
          - 'auto': Default to 'impute'
          - 'impute': Proceed with evaluation by filling in the missing
            values with the mean of the training data. Missing
            values are also imputed if an entire column of data is
            missing during evaluation.
          - 'error' : Do not proceed with prediction and terminate with
            an error message.
  
      Returns
      -------
      out : SArray
          An SArray with model predictions.
  
      See Also
      ----------
      create, evaluate, classify
  
      Examples
      ----------
      >>> data =  turicreate.SFrame('https://static.turi.com/datasets/regression/houses.csv')
  
      >>> data['is_expensive'] = data['price'] > 30000
      >>> model = turicreate.svm_classifier.create(data,
                                target='is_expensive',
                                features=['bath', 'bedroom', 'size'])
  
      >>> class_predictions = model.progressredict(data)
      >>> margin_predictions = model.progressredict(data, output_type='margin')
  
      """
  
      _check_categorical_option_type(
          "output_type", output_type, ["class", "margin"]
      )
      return super(_Classifier, self).predict(
          dataset,
          output_type=output_type,
          missing_value_action=missing_value_action,
      )
  
file_path: turicreate/src/python/turicreate/toolkits/classifier/svm_classifier.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import turicreate.toolkits._supervised_learning
  from turicreate.toolkits._supervised_learning import Classifier
  from turicreate.toolkits._internal_utils import _toolkit_repr_print, _toolkit_get_topk_bottomk, _raise_error_evaluation_metric_is_valid, _check_categorical_option_type, _summarize_coefficients
label_desc: Use image node_id 8 for calling the SVMClassifier obj's underlying member method code with example usage: obj.predict(dataset, output_type, missing_value_action) and returns: super