docstr: ...Test LinearRegression fit with different solvers and penalties
          
docstr_tok: ["...","Test","LinearRegression","fit","with","different","solvers","and","penalties"]
code: def test_LinearRegression_fit(self):
      """...Test LinearRegression fit with different solvers and penalties"""
      fit_intercepts = [False, True]
      n_samples = 2000
      n_features = 20
      X, y, weights0, _ = self.get_train_data(
          n_samples=n_samples,
          n_features=n_features,
          fit_intercept=False,
      )
      intercept0 = -1
      for i, (solver, penalty, fit_intercept) in enumerate(
          product(
              LinearRegression._solvers.keys(),
              LinearRegression._penalties.keys(),
              fit_intercepts,
          )
      ):
          if fit_intercept:
              y_ = y + intercept0
          else:
              y_ = y.copy()
          if penalty == "binarsity":
              learner = LinearRegression(
                  verbose=False,
                  fit_intercept=fit_intercept,
                  solver=solver,
                  penalty=penalty,
                  tol=1e-10,
                  blocks_start=[0],
                  blocks_length=[1],
              )
          else:
              learner = LinearRegression(
                  verbose=False,
                  fit_intercept=fit_intercept,
                  solver=solver,
                  penalty=penalty,
                  tol=1e-10,
              )
          learner.fit(X, y_)
          err = norm(learner.weights - weights0) / n_features**0.5
          self.assertLess(err, 3e-2)
          if fit_intercept:
              self.assertLess(abs(learner.intercept - intercept0), 3e-2)
  
imports: import itertools
  import unittest
  from itertools import product
  import numpy
  from scipy.linalg import norm
  from tick.base.inference import InferenceTest
  from tick.linear_model import SimuLinReg, LinearRegression
  from tick.simulation import weights_sparse_gauss
label_desc: Use image node_id 3 for calling the Test obj's underlying member method code with example usage: obj.test_LinearRegression_fit() without return types