def get_auto_step_size(max_squared_sum, alpha_scaled, loss, fit_intercept):
 if (loss in ('log', 'multinomial')):
  return (4.0 / ((max_squared_sum + int(fit_intercept)) + (4.0 * alpha_scaled)))
 elif (loss == 'squared'):
  return (1.0 / ((max_squared_sum + int(fit_intercept)) + alpha_scaled))
 else:
  raise ValueError(("Unknown loss function for SAG solver, got %s instead of 'log' or 'squared'" % loss))

def get_auto_step_size ( max_squared_sum , alpha_scaled , loss , fit_intercept ) : if ( loss in ( 'log' , 'multinomial' ) ) : return ( 4.0 / ( ( max_squared_sum + int ( fit_intercept ) ) + ( 4.0 * alpha_scaled ) ) ) elif ( loss == 'squared' ) : return ( 1.0 / ( ( max_squared_sum + int ( fit_intercept ) ) + alpha_scaled ) ) else : raise ValueError ( ( "Unknown loss function for SAG solver, got %s instead of 'log' or 'squared'" % loss ) )
compute automatic step size for sag solver the step size is set to 1 / where l is the max sum of squares for over all samples .