class_docstr: It is a rolling based on DDG-DA
  
  **NOTE**
  before running the example, please clean your previous results with following command
  - `rm -r mlruns`
class_docstr_tok: ["It","is","a","rolling","based","on","DDG-DA","*","*","NOTE","*","*","before","running","the","example",",","please","clean","your","previous","results","with","following","command","-","`","rm","-r","mlruns","`"]
docstr: training a meta model based on a simplified linear proxy model;
docstr_tok: ["training","a","meta","model","based","on","a","simplified","linear","proxy","model",";"]
code: def _train_meta_model(self, fill_method="max"):
      """
      training a meta model based on a simplified linear proxy model;
      """
  
      # 1) leverage the simplified proxy forecasting model to train meta model.
      # - Only the dataset part is important, in current version of meta model will integrate the
  
      # the train_start for training meta model does not necessarily align with final rolling
      train_start = (
          "2008-01-01" if self.train_start is None else self.train_start
      )
      train_end = (
          "2010-12-31"
          if self.meta_1st_train_end is None
          else self.meta_1st_train_end
      )
      test_start = (
          pd.Timestamp(train_end) + pd.Timedelta(days=1)
      ).strftime("%Y-%m-%d")
      proxy_forecast_model_task = {
          # "model": "qlib.contrib.model.linear.LinearModel",
          "dataset": {
              "class": "qlib.data.dataset.DatasetH",
              "kwargs": {
                  "handler": f"file://{(self.working_dir / self.proxy_hd).absolute()}",
                  "segments": {
                      "train": (train_start, train_end),
                      "test": (
                          test_start,
                          self.basic_task()["dataset"]["kwargs"][
                              "segments"
                          ]["test"][1],
                      ),
                  },
              },
          },
          # "record": ["qlib.workflow.record_temp.SignalRecord"]
      }
      # the proxy_forecast_model_task will be used to create meta tasks.
      # The test date of first task will be 2011-01-01. Each test segment will be about 20days
      # The tasks include all training tasks and test tasks.
  
      # 2) preparing meta dataset
      kwargs = dict(
          task_tpl=proxy_forecast_model_task,
          step=self.step,
          segments=0.62,  # keep test period consistent with the dataset yaml
          trunc_days=1 + self.horizon,
          hist_step_n=30,
          fill_method=fill_method,
          rolling_ext_days=0,
      )
      # NOTE:
      # the input of meta model (internal data) are shared between proxy model and final forecasting model
      # but their task test segment are not aligned! It worked in my previous experiment.
      # So the misalignment will not affect the effectiveness of the method.
      with self._internal_data_path.open("rb") as f:
          internal_data = pickle.load(f)
  
      md = MetaDatasetDS(exp_name=internal_data, **kwargs)
  
      # 3) train and logging meta model
      with R.start(experiment_name=self.meta_exp_name):
          R.log_params(**kwargs)
          mm = MetaModelDS(
              step=self.step,
              hist_step_n=kwargs["hist_step_n"],
              lr=0.001,
              max_epoch=30,
              seed=43,
              alpha=self.alpha,
          )
          mm.fit(md)
          R.save_objects(model=mm)
  
imports: from pathlib import Path
  import pickle
  from typing import Optional, Union
  import pandas
  import yaml
  from qlib.contrib.meta.data_selection.dataset import InternalData, MetaDatasetDS
  from qlib.contrib.meta.data_selection.model import MetaModelDS
  from qlib.data.dataset.handler import DataHandlerLP
  from qlib.model.meta.task import MetaTask
  from qlib.model.trainer import TrainerR
  from qlib.typehint import Literal
  from qlib.utils import init_instance_by_config
  from qlib.workflow import R
  from qlib.workflow.task.utils import replace_task_handler_with_cache
  from .base import Rolling
label_desc: Use image node_id 7 for calling the DDGDA obj's underlying member method code with example usage: obj._train_meta_model(fill_method) without return types