microsoft/qlib · error · NotImplementedError

This type of input is not supported

Error message

This type of input is not supported

What it means

MetaTaskDS.get_meta_info/processing supports only specific fill_method values for handling NaN in the meta input matrix (a 'forward'-style interpolation branch and a 'zero' branch). Any other fill_method string reaches the else and raises NotImplementedError.

Source

Thrown at qlib/contrib/meta/data_selection/dataset.py:229

                        f"fill_method={self.fill_method}; the info after can't be correctly parsed. Please check your parameters."
                    )
                fill_value = meta_info_norm.max(axis=1)
                # fill it with row max to align with previous implementation
                # This will magnify the data similarity when data is in daily freq

                # the fill value corresponds to data like this
                # It get a performance value for each day.
                # The performance value are get from other models on this day
                # 2009-01-16    0.276320
                # 2009-01-19    0.280603
                #                 ...
                # 2011-06-27    0.203773
                meta_info_norm = meta_info_norm.T.fillna(fill_value).T
        elif self.fill_method == "zero":
            # It will fillna(0.0) at the end.
            pass
        else:
            raise NotImplementedError(f"This type of input is not supported")
        meta_info_norm = meta_info_norm.fillna(0.0)  # always fill zero in case of NaN
        return meta_info_norm

    def get_meta_input(self):
        return self.processed_meta_input


class MetaDatasetDS(MetaTaskDataset):
    def __init__(
        self,
        *,
        task_tpl: Union[dict, list],
        step: int,
        trunc_days: int = None,
        rolling_ext_days: int = 0,
        exp_name: Union[str, InternalData],
        segments: Union[Dict[Text, Tuple], float, str],
        hist_step_n: int = 10,

View on GitHub (pinned to 79633dd950)

Solutions

  1. Read the class source/docstring for the exact accepted fill_method values (the forward-fill branch and 'zero') and use one of them.
  2. Use fill_method='zero' if you want NaNs simply replaced by 0.0 after normalization.
  3. Pre-clean your data so the meta matrix has no NaNs, making fill_method irrelevant.

Example fix

// before
mds = MetaTaskDS(..., fill_method="ffill")

// after
mds = MetaTaskDS(..., fill_method="zero")
Defensive patterns

Strategy: validation

Validate before calling

if fill_method not in ("forward", "zero"):  # check class source for exact set
    fill_method = "zero"
MetaTaskDS(..., fill_method=fill_method)

Type guard

def is_valid_fill_method(m) -> bool:
    return m in ("forward", "zero")

Try / catch

try:
    mtds = MetaTaskDS(..., fill_method=fill_method)
    mtds.prepare("train")
except NotImplementedError as e:
    if "not supported" in str(e):
        mtds = MetaTaskDS(..., fill_method="zero")
    else:
        raise

Prevention

When it happens

Trigger: Constructing MetaTaskDS(fill_method='mean') or any value other than the two supported ones; the constructor does not validate fill_method, so the failure is deferred to data processing time.

Common situations: Assuming pandas fillna method names ('ffill', 'bfill', 'mean') work here; copying a fill_method from other qlib components into the meta data-selection pipeline.

Related errors


AI-assisted analysis of microsoft/qlib@79633dd950 (2026-08-15). Data as JSON: /api/errors/dc0fa80a4fb38824. Report an issue: GitHub.