code: def test_linear_regression_positive_vs_nonpositive_when_positive(
      setup,
  ):
      # Test LinearRegression fitted coefficients
      # when the problem is positive.
      n_samples = 200
      n_features = 4
      X = rng.rand(n_samples, n_features)
      y = X[:, 0] + 2 * X[:, 1] + 3 * X[:, 2] + 1.5 * X[:, 3]
  
      # reg = LinearRegression(positive=True)
      reg = sklearn_LR(positive=True)
      reg.fit(X, y)
      regn = LinearRegression(positive=False)
      regn.fit(X, y)
  
      assert np.mean(((reg.coef_ - regn.coef_) ** 2).to_numpy()) < 1e-6
  
imports: import re
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal, assert_almost_equal, assert_allclose
  from scipy import sparse
  from scipy import linalg
  from sklearn.datasets import make_sparse_uncorrelated, make_regression, load_iris
  from sklearn.linear_model import LinearRegression
  from sklearn.linear_model._base import make_dataset
  from sklearn.utils import check_random_state
  from ..None import LinearRegression
  from .._base import _preprocess_data, _rescale_data
label_desc: Use image node_id 11 for calling a global function with example usage: test_linear_regression_positive_vs_nonpositive_when_positive(setup) without return types