#NEWLINE# @ ignore_warnings #NEWLINE# def test_classifier_matching( ) : #NEWLINE# #INDENT# n_samples = 20 #NEWLINE# ( X , y ) = make_blobs ( n_samples = n_samples , centers = 2 , random_state = 0 , cluster_std = 0.1 ) #NEWLINE# y [ ( y == 0 ) ] = ( - 1 ) #NEWLINE# alpha = 1.1 #NEWLINE# n_iter = 80 #NEWLINE# fit_intercept = True #NEWLINE# step_size = get_step_size ( X , alpha , fit_intercept ) #NEWLINE# clf = LogisticRegression ( solver = 'sag' , fit_intercept = fit_intercept , tol = 1e-11 , C = ( ( 1.0 / alpha ) / n_samples ) , max_iter = n_iter , random_state = 10 ) #NEWLINE# clf . fit ( X , y ) #NEWLINE# ( weights , intercept ) = sag_sparse ( X , y , step_size , alpha , n_iter = y , dloss = log_dloss , fit_intercept = fit_intercept ) #NEWLINE# ( weights2 , intercept2 ) = sag ( X , y , step_size , alpha , n_iter = n_iter , dloss = log_dloss , fit_intercept = fit_intercept ) #NEWLINE# weights = np . atleast_2d ( weights ) #NEWLINE# intercept = np . atleast_1d ( intercept ) #NEWLINE# weights2 = np . atleast_2d ( weights2 ) #NEWLINE# intercept2 = np . atleast_1d ( intercept2 ) #NEWLINE# assert_array_almost_equal ( weights , clf . coef_ , decimal = 10 ) #NEWLINE# assert_array_almost_equal ( intercept , clf . intercept_ , decimal = 10 ) #NEWLINE# assert_array_almost_equal ( weights2 , clf . coef_ , decimal = 10 ) #NEWLINE# assert_array_almost_equal ( intercept2 , clf . intercept_ , decimal = 10 )