class_docstr: Estimator for learning linear classifiers by FISTA.
  
  The objective functions considered take the form
  
  minimize F(W) = C * L(W) + alpha * R(W),
  
  where L(W) is a loss term and R(W) is a penalty term.
  
  Parameters
  ----------
  loss : str, 'squared_hinge', 'log', 'modified_huber', 'squared'
      The loss function to be used.
  
  penalty : str or Penalty object, {'l2', 'l1', 'l1/l2', 'tv1d', 'simplex'}
      The penalty or constraint to be used.
  
      - l2: ridge
      - l1: lasso
      - l1/l2: group lasso
      - tv1d: 1-dimensional total variation (also known as fused lasso)
      - simplex: simplex constraint
  
      The method can also take an arbitrary Penalty object, i.e., an instance
      that implements methods projection regularization method (see file penalty.py)
  
  multiclass : bool
      Whether to use a direct multiclass formulation (True) or one-vs-rest
      (False).
  
  C : float
      Weight of the loss term.
  
  alpha : float
      Weight of the penalty term.
  
  max_iter : int
      Maximum number of iterations to perform.
  
  max_steps : int
      Maximum number of steps to use during the line search.
  
  sigma : float
      Constant used in the line search sufficient decrease condition.
  
  eta : float
       Decrease factor for line-search procedure. For example, eta=2.
       will decrease the step size by a factor of 2 at each iteration
       of the line-search routine.
  
  callback : callable
      Callback function.
  
  verbose : int
      Verbosity level.
class_docstr_tok: ["Estimator","for","learning","linear","classifiers","by","FISTA",".","The","objective","functions","considered","take","the","form","minimize","F","(","W",")","=","C","*","L","(","W",")","+","alpha","*","R","(","W",")",",","where","L","(","W",")","is","a","loss","term","and","R","(","W",")","is","a","penalty","term",".","Parameters","--","--","--","--","--","loss",":","str",",","'squared_hinge","'",",","'log","'",",","'modified_huber","'",",","'squared'","The","loss","function","to","be","used",".","penalty",":","str","or","Penalty","object",",","{","'l2","'",",","'l1","'",",","'l1\/l2","'",",","'tv1d","'",",","'simplex","'","}","The","penalty","or","constraint","to","be","used",".","-","l2",":","ridge","-","l1",":","lasso","-","l1\/l2",":","group","lasso","-","tv1d",":","1-dimensional","total","variation","(","also","known","as","fused","lasso",")","-","simplex",":","simplex","constraint","The","method","can","also","take","an","arbitrary","Penalty","object",",","i.e.",",","an","instance","that","implements","methods","projection","regularization","method","(","see","file","penalty.py",")","multiclass",":","bool","Whether","to","use","a","direct","multiclass","formulation","(","True",")","or","one-vs-rest","(","False",")",".","C",":","float","Weight","of","the","loss","term",".","alpha",":","float","Weight","of","the","penalty","term",".","max_iter",":","int","Maximum","number","of","iterations","to","perform",".","max_steps",":","int","Maximum","number","of","steps","to","use","during","the","line","search",".","sigma",":","float","Constant","used","in","the","line","search","sufficient","decrease","condition",".","eta",":","float","Decrease","factor","for","line-search","procedure",".","For","example",",","eta=2",".","will","decrease","the","step","size","by","a","factor","of","2","at","each","iteration","of","the","line-search","routine",".","callback",":","callable","Callback","function",".","verbose",":","int","Verbosity","level","."]
code: def _get_loss(self):
      if self.multiclass:
          losses = {
              "squared_hinge": MulticlassSquaredHinge(),
              "log": MulticlassLog(),
              "log_margin": MulticlassLog(margin=1),
          }
      else:
          losses = {
              "squared_hinge": SquaredHinge(),
          }
  
      return losses[self.loss]
  
imports: import numpy
  from sklearn.utils.extmath import safe_sparse_dot
  from .base import BaseClassifier, BaseRegressor
  from .dataset_fast import get_dataset
  from .loss_fast import Squared
  from .loss_fast import SquaredHinge
  from .loss_fast import MulticlassSquaredHinge
  from .loss_fast import MulticlassLog
  from .penalty import L1Penalty
  from .penalty import L1L2Penalty
  from .penalty import TracePenalty
  from .penalty import SimplexConstraint
  from .penalty import L1BallConstraint
  from .penalty import TotalVariation1DPenalty
label_desc: Use image node_id 2 for calling the FistaClassifier obj's underlying member method code with example usage: obj._get_loss() and returns: losses