docstr: Convert TimeSeriesDataFrame to a format expected by MLForecast methods `predict` and `preprocess`.
  
  Each row contains unique_id, ds, y, and (optionally) known covariates & static features.
code: def _to_mlforecast_df(
      self,
      data: TimeSeriesDataFrame,
      static_features: pd.DataFrame,
      include_target: bool = True,
  ) -> pd.DataFrame:
      """Convert TimeSeriesDataFrame to a format expected by MLForecast methods `predict` and `preprocess`.
  
      Each row contains unique_id, ds, y, and (optionally) known covariates & static features.
      """
      # TODO: Add support for past_covariates
      selected_columns = self.metadata.known_covariates_real.copy()
      column_name_mapping = {
          ITEMID: MLF_ITEMID,
          TIMESTAMP: MLF_TIMESTAMP,
      }
      if include_target:
          selected_columns += [self.target]
          column_name_mapping[self.target] = MLF_TARGET
  
      df = pd.DataFrame(data)[selected_columns].reset_index()
      if static_features is not None:
          df = pd.merge(
              df,
              static_features,
              how="left",
              on=ITEMID,
              suffixes=(None, "_static_feat"),
          )
  
      # Convert float64 to float32 to reduce memory usage
      float64_cols = list(df.select_dtypes(include="float64"))
      df[float64_cols] = df[float64_cols].astype("float32")
      # We assume that df is sorted by 'unique_id' inside `TimeSeriesPredictor._check_and_prepare_data_frame`
      return df.rename(columns=column_name_mapping)
  
imports: import logging
  import math
  import os
  import time
  from typing import Any, Dict, List, Optional, Tuple
  import numpy
  import pandas
  from sklearn.base import BaseEstimator
  import autogluon.core
  from autogluon.common.utils.log_utils import set_logger_verbosity
  from autogluon.tabular import TabularPredictor
  from autogluon.timeseries.dataset.ts_dataframe import ITEMID, TIMESTAMP, TimeSeriesDataFrame
  from autogluon.timeseries.models.abstract import AbstractTimeSeriesModel
  from autogluon.timeseries.models.local import SeasonalNaiveModel
  from autogluon.timeseries.utils.datetime import get_lags_for_frequency, get_seasonality, get_time_features_for_frequency
  from autogluon.timeseries.utils.forecast import get_forecast_horizon_index_ts_dataframe
  from autogluon.timeseries.utils.warning_filters import warning_filter
label_desc: Use image node_id 8 for calling the AbstractMLForecastModel obj's underlying member method code with example usage: obj._to_mlforecast_df(data, static_features, include_target) and returns: df