Apply imputation to a DataFrame based on the method specified in config.
Supports three strategies:
"weighted": forward-fill then backward-fill gaps, then build a WeightFunction that down-weights training rows near any gap. Rows inside a gap receive weight 0; the penalty window controls how far the zero-weight zone extends. By default the penalty window is config.window_size; if config.imputation_window_size is set (not None) it overrides window_size for the penalty zone only, so the gap-penalty width can be tuned independently of any rolling feature window.
"weighted_interp": like "weighted" but uses time-interpolation (via LinearlyInterpolateTS) for the fill step instead of ffill/bfill. Boundary NaNs that interpolation cannot bracket are resolved by ffill/bfill as a final fallback. The pre-fill NaN mask drives the same rolling penalty-window zero-weight construction as "weighted". Intended for use with target_corruption_policy="heal", where physically-impossible dropouts should be bridged smoothly rather than step-filled.
A diagnostic summary (NaN count before and after imputation) is always written to the logger.
Configuration object that must expose: - imputation_method (str): "weighted" or "linear". - targets (list[str]): column names to interpolate ("linear" method only; also accepted as the explicit targets keyword argument which takes precedence). - window_size (int): rolling-window size passed to get_missing_weights() ("weighted" method only).