docstr:    ^
   0 | x
  ---|--->
   0 | o
code: def test_weighted_problem(self) -> None:
      r"""
         ^
       0 | x
      ---|--->
       0 | o
      """
      xs = torch.tensor(
          [[0.5, 0.5], [-0.5, -0.5], [0.5, -0.5], [-0.5, 0.5]]
      )
      ys = torch.tensor([1.0, 1.0, -1.0, -1.0])
      weights = torch.tensor([1.0, 0.0, 1.0, 0.0])
  
      self.train_and_compare(
          SGDLinearRegression,
          xs,
          ys,
          expected_loss=0,
          expected_reg=0,
          expected_hyperplane=torch.Tensor([[0.0, 1.0]]),
          weights=weights,
          norm_hyperplane=True,
          init_scheme="zeros",
          objective="ols",
          bias=False,
      )
      self.train_and_compare(
          SGDLasso,
          xs,
          ys,
          expected_loss=0.5,
          expected_reg=0,
          expected_hyperplane=torch.Tensor([[0.0, 0.0]]),
          weights=weights,
          norm_hyperplane=False,
          init_scheme="zeros",
          objective="lasso",
          bias=False,
      )
      self.train_and_compare(
          SGDRidge,
          xs,
          ys,
          expected_loss=0.5,
          expected_reg=0,
          expected_hyperplane=torch.Tensor([[0.0, 0.0]]),
          weights=weights,
          norm_hyperplane=False,
          init_scheme="zeros",
          objective="ridge",
          bias=False,
      )
  
file_path: captum/tests/utils/test_linear_model.py
imports: import torch
  from captum._utils.models.linear_model.model import SGDLasso, SGDLinearRegression, SGDRidge
  from tests.helpers.basic import assertTensorAlmostEqual, BaseTest
label_desc: Use image node_id 6 for calling the TestLinearModel obj's underlying member method code with example usage: obj.test_weighted_problem() without return types