code: def transfer_multitask_leastsquares_regression(
      fm_train=traindat, fm_test=testdat, label_train=label_traindat
  ):
      from shogun import RegressionLabels, Task, TaskGroup
  
      try:
          from shogun import MultitaskLeastSquaresRegression
      except ImportError:
          print("MultitaskLeastSquaresRegression not available")
          exit(0)
      import shogun as sg
  
      features = sg.create_features(traindat)
      labels = RegressionLabels(label_train)
  
      n_vectors = features.get_num_vectors()
      task_one = Task(0, n_vectors // 2)
      task_two = Task(n_vectors // 2, n_vectors)
      task_group = TaskGroup()
      task_group.append_task(task_one)
      task_group.append_task(task_two)
  
      mtlsr = MultitaskLeastSquaresRegression(
          0.1, features, labels, task_group
      )
      mtlsr.set_regularization(1)  # use regularization ratio
      mtlsr.set_tolerance(1e-2)  # use 1e-2 tolerance
      mtlsr.train()
      mtlsr.set_current_task(0)
      out = mtlsr.apply_regression().get_labels()
      return out
  
label_desc: Use image node_id 1 for calling a global function with example usage: transfer_multitask_leastsquares_regression(fm_train, fm_test, label_train) and returns: out