#NEWLINE# def test_enet_multitarget( ) : #NEWLINE# #INDENT# n_targets = 3 #NEWLINE# ( X , y ) = make_sparse_data ( n_targets = n_targets ) #NEWLINE# estimator = ElasticNet ( alpha = 0.01 , fit_intercept = True , precompute = None ) #NEWLINE# estimator . fit ( X , y ) #NEWLINE# ( coef , intercept , dual_gap ) = ( estimator . coef_ , estimator . intercept_ , estimator . dual_gap_ ) #NEWLINE# for k in range ( n_targets ) : #NEWLINE# #INDENT# estimator . fit ( X , y [ : , k ] ) #NEWLINE# assert_array_almost_equal ( coef [ k , : ] , estimator . coef_ ) #NEWLINE# assert_array_almost_equal ( intercept [ k ] , estimator . intercept_ ) #NEWLINE# assert_array_almost_equal ( dual_gap [ k ] , estimator . dual_gap_ )