code: def test_fit():
      np.random.seed(435265)
      X = np.random.normal(size=(50, 3))
      inv = np.linalg.inv(np.cov(X.T))
      regcov = RegularizedInvCovariance(exog=X)
      regcov.fit()
      # check that unregularized is what we expect
      diff = np.linalg.norm(regcov.approx_inv_cov() - inv)
      assert_(diff < 0.1)
  
      # check that regularizing actually does something
      regcov.fit(alpha=0.5)
      assert_(np.sum(regcov.approx_inv_cov() == 0) > np.sum(inv == 0))
  
imports: import numpy
  from numpy.testing import assert_equal, assert_
  from statsmodels.stats.regularized_covariance import _calc_nodewise_row, _calc_nodewise_weight, _calc_approx_inv_cov, RegularizedInvCovariance
label_desc: Use image node_id 4 for calling a global function with example usage: test_fit() without return types