class_docstr: This is the multiple segments signal record class that generates the signal prediction.
  This class inherits the ``RecordTemp`` class.
class_docstr_tok: ["This","is","the","multiple","segments","signal","record","class","that","generates","the","signal","prediction",".","This","class","inherits","the","``","RecordTemp","``","class","."]
code: def generate(self, segments: Dict[Text, Any], save: bool = False):
      for key, segment in segments.items():
          predics = self.model.predict(self.dataset, segment)
          if isinstance(predics, pd.Series):
              predics = predics.to_frame("score")
          labels = self.dataset.prepare(
              segments=segment,
              col_set="label",
              data_key=qlib_dataset.handler.DataHandlerLP.DK_R,
          )
          # Compute the IC and Rank IC
          ic, ric = calc_ic(predics.iloc[:, 0], labels.iloc[:, 0])
          results = {
              "all-IC": ic,
              "mean-IC": ic.mean(),
              "all-Rank-IC": ric,
              "mean-Rank-IC": ric.mean(),
          }
          logger.info(
              "--- Results for {:} ({:}) ---".format(key, segment)
          )
          ic_x100, ric_x100 = ic * 100, ric * 100
          logger.info("IC: {:.4f}%".format(ic_x100.mean()))
          logger.info(
              "ICIR: {:.4f}%".format(ic_x100.mean() / ic_x100.std())
          )
          logger.info("Rank IC: {:.4f}%".format(ric_x100.mean()))
          logger.info(
              "Rank ICIR: {:.4f}%".format(
                  ric_x100.mean() / ric_x100.std()
              )
          )
  
          if save:
              save_name = "results-{:}.pkl".format(key)
              self.save(**{save_name: results})
              logger.info(
                  "The record '{:}' has been saved as the artifact of the Experiment {:}".format(
                      save_name, self.recorder.experiment_id
                  )
              )
  
file_path: qlib/qlib/contrib/workflow/record_temp.py
imports: import logging
  import pandas
  import numpy
  from sklearn.metrics import mean_squared_error
  from typing import Dict, Text, Any
  from ...contrib.eva.alpha import calc_ic
  from ...workflow.record_temp import RecordTemp
  from ...workflow.record_temp import SignalRecord
  from ...data import dataset
  from ...log import get_module_logger
label_desc: Use image node_id 2 for calling the MultiSegRecord obj's underlying member method code with example usage: obj.generate(segments, save) without return types