class_docstr: Linear regression is an approach for modeling a scalar target :math:`y` as
  a linear function of one or more explanatory variables denoted :math:`X`.
  
  Given a set of features :math:`x_i`, and a label :math:`y_i`, linear
  regression interprets the probability that the label is in one class as
  a linear function of a linear combination of the features.
  
      .. math::
        f_i(\theta) =  \theta^T x + \epsilon_i
  
  where :math:`\epsilon_i` is noise.  An intercept term is added by appending
  a column of 1's to the features.  Regularization is often required to
  prevent overfitting by penalizing models with extreme parameter values. The
  linear regression module supports l1 and l2 regularization, which are added
  to the loss function.
  
  The composite objective being optimized for is the following:
  
      .. math::
         \min_{\theta} \sum_{i = 1}^{n} (\theta^Tx - y_i)^2 + \lambda_1 ||\theta||_1 + \lambda_2 ||\theta||^{2}_{2}
  
  where :math:`\lambda_1` is the ``l1_penalty`` and :math:`\lambda_2` is the
  ``l2_penalty``.
  
  This model cannot be constructed directly.  Instead, use
  :func:`turicreate.linear_regression.create` to create an instance
  of this model. A detailed list of parameter options and code samples
  are available in the documentation for the create function.
  
  Examples
  --------
  .. sourcecode:: python
  
      # Load the data (From an S3 bucket)
      >>> data =  turicreate.SFrame('https://static.turi.com/datasets/regression/houses.csv')
  
      # Make a linear regression model
      >>> model = turicreate.linear_regression.create(data, target='price', features=['bath', 'bedroom', 'size'])
  
      # Extract the coefficients
      >>> coefficients = model.coefficients
  
      # Make predictions
      >>> predictions = model.predict(data)
  
      # Evaluate the model
      >>> results = model.evaluate(data)
  
  See Also
  --------
  create
class_docstr_tok: ["Linear","regression","is","an","approach","for","modeling","a","scalar","target",":","math",":","`","y","`","as","a","linear","function","of","one","or","more","explanatory","variables","denoted",":","math",":","`","X","`",".","Given","a","set","of","features",":","math",":","`","x_i","`",",","and","a","label",":","math",":","`","y_i","`",",","linear","regression","interprets","the","probability","that","the","label","is","in","one","class","as","a","linear","function","of","a","linear","combination","of","the","features",".","..","math",":",":","f_i","(","\\theta",")","=","\\theta^T","x","+","\\epsilon_i","where",":","math",":","`","\\epsilon_i","`","is","noise",".","An","intercept","term","is","added","by","appending","a","column","of","1","'s","to","the","features",".","Regularization","is","often","required","to","prevent","overfitting","by","penalizing","models","with","extreme","parameter","values",".","The","linear","regression","module","supports","l1","and","l2","regularization",",","which","are","added","to","the","loss","function",".","The","composite","objective","being","optimized","for","is","the","following",":","..","math",":",":","\\min_","{","\\theta","}","\\sum_","{","i","=","1","}","^","{","n","}","(","\\theta^Tx","-","y_i",")","^2","+","\\lambda_1","||\\theta||_1","+","\\lambda_2","||\\theta||^","{","2","}","_","{","2","}","where",":","math",":","`","\\lambda_1","`","is","the","``","l1_penalty","``","and",":","math",":","`","\\lambda_2","`","is","the","``","l2_penalty","``",".","This","model","can","not","be","constructed","directly",".","Instead",",","use",":","func",":","`","turicreate.linear_regression.create","`","to","create","an","instance","of","this","model",".","A","detailed","list","of","parameter","options","and","code","samples","are","available","in","the","documentation","for","the","create","function",".","Examples","--","--","--","--","..","sourcecode",":",":","python","#","Load","the","data","(","From","an","S3","bucket",")",">",">",">","data","=","turicreate.SFrame","(","'https",":","\/\/static.turi.com\/datasets\/regression\/houses.csv","'",")","#","Make","a","linear","regression","model",">",">",">","model","=","turicreate.linear_regression.create","(","data",",","target='price","'",",","features=","[","'bath","'",",","'bedroom","'",",","'size","'","]",")","#","Extract","the","coefficients",">",">",">","coefficients","=","model.coefficients","#","Make","predictions",">",">",">","predictions","=","model.predict","(","data",")","#","Evaluate","the","model",">",">",">","results","=","model.evaluate","(","data",")","See","Also","--","--","--","--","create"]
docstr: Get the value of a given field. The list of all queryable fields is
  detailed below, and can be obtained programmatically using the
  :func:`~turicreate.linear_regression.LinearRegression._list_fields`
  method.
  
  +------------------------+-------------------------------------------------------------+
  |      Field             | Description                                                 |
  +========================+=============================================================+
  | coefficients           | Regression coefficients                                     |
  +------------------------+-------------------------------------------------------------+
  | convergence_threshold  | Desired solver accuracy                                     |
  +------------------------+-------------------------------------------------------------+
  | feature_rescaling      | Bool indicating if features were rescaled during training   |
  +------------------------+-------------------------------------------------------------+
  | features               | Feature column names                                        |
  +------------------------+-------------------------------------------------------------+
  | l1_penalty             | l1 regularization weight                                    |
  +------------------------+-------------------------------------------------------------+
  | l2_penalty             | l2 regularization weight                                    |
  +------------------------+-------------------------------------------------------------+
  | lbfgs_memory_level     | LBFGS memory level ('lbfgs only')                           |
  +------------------------+-------------------------------------------------------------+
  | max_iterations         | Maximum number of solver iterations                         |
  +------------------------+-------------------------------------------------------------+
  | num_coefficients       | Number of coefficients in the model                         |
  +------------------------+-------------------------------------------------------------+
  | num_examples           | Number of examples used for training                        |
  +------------------------+-------------------------------------------------------------+
  | num_features           | Number of dataset columns used for training                 |
  +------------------------+-------------------------------------------------------------+
  | num_unpacked_features  | Number of features (including expanded list/dict features)  |
  +------------------------+-------------------------------------------------------------+
  | solver                 | Type of solver                                              |
  +------------------------+-------------------------------------------------------------+
  | step_size              | Initial step size for the solver                            |
  +------------------------+-------------------------------------------------------------+
  | target                 | Target column name                                          |
  +------------------------+-------------------------------------------------------------+
  | training_iterations    | Number of solver iterations                                 |
  +------------------------+-------------------------------------------------------------+
  | training_loss          | Residual sum-of-squares training loss                       |
  +------------------------+-------------------------------------------------------------+
  | training_rmse          | Training root-mean-squared-error (RMSE)                     |
  +------------------------+-------------------------------------------------------------+
  | training_solver_status | Solver status after training                                |
  +------------------------+-------------------------------------------------------------+
  | training_time          | Training time (excludes preprocessing)                      |
  +------------------------+-------------------------------------------------------------+
  | unpacked_features      | Feature names (including expanded list/dict features)       |
  +------------------------+-------------------------------------------------------------+
  
  
  Parameters
  ----------
  field : string
      Name of the field to be retrieved.
  
  Returns
  -------
  out : [various]
      The current value of the requested field.
docstr_tok: ["Get","the","value","of","a","given","field",".","The","list","of","all","queryable","fields","is","detailed","below",",","and","can","be","obtained","programmatically","using","the",":","func",":","`","~turicreate.linear_regression.LinearRegression._list_fields","`","method",".","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","Field","|","Description","|","+========================+=============================================================+","|","coefficients","|","Regression","coefficients","|","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","convergence_threshold","|","Desired","solver","accuracy","|","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","feature_rescaling","|","Bool","indicating","if","features","were","rescaled","during","training","|","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","features","|","Feature","column","names","|","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","l1_penalty","|","l1","regularization","weight","|","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","l2_penalty","|","l2","regularization","weight","|","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","lbfgs_memory_level","|","LBFGS","memory","level","(","'lbfgs","only","'",")","|","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","max_iterations","|","Maximum","number","of","solver","iterations","|","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","num_coefficients","|","Number","of","coefficients","in","the","model","|","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","num_examples","|","Number","of","examples","used","for","training","|","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","num_features","|","Number","of","dataset","columns","used","for","training","|","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","num_unpacked_features","|","Number","of","features","(","including","expanded","list\/dict","features",")","|","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","solver","|","Type","of","solver","|","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","step_size","|","Initial","step","size","for","the","solver","|","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","target","|","Target","column","name","|","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","training_iterations","|","Number","of","solver","iterations","|","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","training_loss","|","Residual","sum-of-squares","training","loss","|","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","training_rmse","|","Training","root-mean-squared-error","(","RMSE",")","|","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","training_solver_status","|","Solver","status","after","training","|","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","training_time","|","Training","time","(","excludes","preprocessing",")","|","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","unpacked_features","|","Feature","names","(","including","expanded","list\/dict","features",")","|","+","--","--","--","--","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","Parameters","--","--","--","--","--","field",":","string","Name","of","the","field","to","be","retrieved",".","Returns","--","--","--","-","out",":","[","various","]","The","current","value","of","the","requested","field","."]
code: def _get(self, field):
      """
      Get the value of a given field. The list of all queryable fields is
      detailed below, and can be obtained programmatically using the
      :func:`~turicreate.linear_regression.LinearRegression._list_fields`
      method.
  
      +------------------------+-------------------------------------------------------------+
      |      Field             | Description                                                 |
      +========================+=============================================================+
      | coefficients           | Regression coefficients                                     |
      +------------------------+-------------------------------------------------------------+
      | convergence_threshold  | Desired solver accuracy                                     |
      +------------------------+-------------------------------------------------------------+
      | feature_rescaling      | Bool indicating if features were rescaled during training   |
      +------------------------+-------------------------------------------------------------+
      | features               | Feature column names                                        |
      +------------------------+-------------------------------------------------------------+
      | l1_penalty             | l1 regularization weight                                    |
      +------------------------+-------------------------------------------------------------+
      | l2_penalty             | l2 regularization weight                                    |
      +------------------------+-------------------------------------------------------------+
      | lbfgs_memory_level     | LBFGS memory level ('lbfgs only')                           |
      +------------------------+-------------------------------------------------------------+
      | max_iterations         | Maximum number of solver iterations                         |
      +------------------------+-------------------------------------------------------------+
      | num_coefficients       | Number of coefficients in the model                         |
      +------------------------+-------------------------------------------------------------+
      | num_examples           | Number of examples used for training                        |
      +------------------------+-------------------------------------------------------------+
      | num_features           | Number of dataset columns used for training                 |
      +------------------------+-------------------------------------------------------------+
      | num_unpacked_features  | Number of features (including expanded list/dict features)  |
      +------------------------+-------------------------------------------------------------+
      | solver                 | Type of solver                                              |
      +------------------------+-------------------------------------------------------------+
      | step_size              | Initial step size for the solver                            |
      +------------------------+-------------------------------------------------------------+
      | target                 | Target column name                                          |
      +------------------------+-------------------------------------------------------------+
      | training_iterations    | Number of solver iterations                                 |
      +------------------------+-------------------------------------------------------------+
      | training_loss          | Residual sum-of-squares training loss                       |
      +------------------------+-------------------------------------------------------------+
      | training_rmse          | Training root-mean-squared-error (RMSE)                     |
      +------------------------+-------------------------------------------------------------+
      | training_solver_status | Solver status after training                                |
      +------------------------+-------------------------------------------------------------+
      | training_time          | Training time (excludes preprocessing)                      |
      +------------------------+-------------------------------------------------------------+
      | unpacked_features      | Feature names (including expanded list/dict features)       |
      +------------------------+-------------------------------------------------------------+
  
  
      Parameters
      ----------
      field : string
          Name of the field to be retrieved.
  
      Returns
      -------
      out : [various]
          The current value of the requested field.
      """
      return super(LinearRegression, self)._get(field)
  
file_path: turicreate/src/python/turicreate/toolkits/regression/linear_regression.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 SupervisedLearningModel
  from turicreate.toolkits._internal_utils import _toolkit_repr_print, _toolkit_get_topk_bottomk, _summarize_coefficients, _raise_error_evaluation_metric_is_valid
label_desc: Use image node_id 7 for calling the LinearRegression obj's underlying member method code with example usage: obj._get(field) and returns: super