class_docstr: The SCAD penalty of Fan and Li.
  
  The SCAD penalty is linear around zero as a L1 penalty up to threshold tau.
  The SCAD penalty is constant for values larger than c*tau.
  The middle segment is quadratic and connect the two segments with a continuous
  derivative.
  The penalty is symmetric around zero.
  
  Parameterization follows Boo, Johnson, Li and Tan 2011.
  Fan and Li use lambda instead of tau, and a instead of c. Fan and Li
  recommend setting c=3.7.
  
  f(x) = { tau |x|                                        if 0 <= |x| < tau
         { -(|x|^2 - 2 c tau |x| + tau^2) / (2 (c - 1))   if tau <= |x| < c tau
         { (c + 1) tau^2 / 2                              if c tau <= |x|
  
  Parameters
  ----------
  tau : float
      slope and threshold for linear segment
  c : float
      factor for second threshold which is c * tau
  weights : None or array
      weights for penalty of each parameter. If an entry is zero, then the
      corresponding parameter will not be penalized.
  
  References
  ----------
  Buu, Anne, Norman J. Johnson, Runze Li, and Xianming Tan. "New variable
  selection methods for zero‐inflated count data with applications to the
  substance abuse field."
  Statistics in medicine 30, no. 18 (2011): 2326-2340.
  
  Fan, Jianqing, and Runze Li. "Variable selection via nonconcave penalized
  likelihood and its oracle properties."
  Journal of the American statistical Association 96, no. 456 (2001):
  1348-1360.
class_docstr_tok: ["The","SCAD","penalty","of","Fan","and","Li",".","The","SCAD","penalty","is","linear","around","zero","as","a","L1","penalty","up","to","threshold","tau",".","The","SCAD","penalty","is","constant","for","values","larger","than","c","*","tau",".","The","middle","segment","is","quadratic","and","connect","the","two","segments","with","a","continuous","derivative",".","The","penalty","is","symmetric","around","zero",".","Parameterization","follows","Boo",",","Johnson",",","Li","and","Tan","2011",".","Fan","and","Li","use","lambda","instead","of","tau",",","and","a","instead","of","c.","Fan","and","Li","recommend","setting","c=3.7",".","f","(","x",")","=","{","tau","|x|","if","0","<","=","|x|","<","tau","{","-","(","|x|^2","-","2","c","tau","|x|","+","tau^2",")","\/","(","2","(","c","-","1",")",")","if","tau","<","=","|x|","<","c","tau","{","(","c","+","1",")","tau^2","\/","2","if","c","tau","<","=","|x|","Parameters","--","--","--","--","--","tau",":","float","slope","and","threshold","for","linear","segment","c",":","float","factor","for","second","threshold","which","is","c","*","tau","weights",":","None","or","array","weights","for","penalty","of","each","parameter",".","If","an","entry","is","zero",",","then","the","corresponding","parameter","will","not","be","penalized",".","References","--","--","--","--","--","Buu",",","Anne",",","Norman","J.","Johnson",",","Runze","Li",",","and","Xianming","Tan",".","``","New","variable","selection","methods","for","zero\u2010inflated","count","data","with","applications","to","the","substance","abuse","field",".","''","Statistics","in","medicine","30",",","no",".","18","(","2011",")",":","2326-2340",".","Fan",",","Jianqing",",","and","Runze","Li",".","``","Variable","selection","via","nonconcave","penalized","likelihood","and","its","oracle","properties",".","''","Journal","of","the","American","statistical","Association","96",",","no",".","456","(","2001",")",":","1348-1360","."]
code: def __init__(self, tau, c=3.7, weights=1.0):
      super().__init__(weights)
      self.tau = tau
      self.c = c
  
imports: import numpy
label_desc: Use image node_id 1 to create a new SCAD object from inherited base classes: Penalty with example: obj = SCAD(tau, c, weights)