Is there a plan to add an equivalent of `forecast_...
# mlforecast
i
Is there a plan to add an equivalent of
forecast_fitted_values
to MLForecast?
I've written a function that I think performs the same operations in the meantime:
Copy code
def get_in_sample_mlforecast(train_df, mfcster) -> pd.DataFrame:
    """Create in-sample predictions for MLForecast.

    Arguments:
        train_df (pd.DataFrame): Training data.
        mfcster (MLForecast): Forecaster.

    Returns:
        pd.DataFrame: In-sample predictions.
    """
    # Iterate through training dates.
    train_dates = np.sort(train_df['ds'].unique())

    def predict(date):
        return (
            mfcster.predict(
                horizon=1,
                new_data=train_df.query("ds <= @date"),
                before_predict_callback=fill_with_zeros,
            )
        )

    in_sample_df = pd.concat(
        Parallel(n_jobs=12, timeout=99999)(
            delayed(predict)(
                date=date,
            )
            for date in train_dates[:-1]
        ),
        ignore_index=True
    )

    return in_sample_df
j
Hey. We will implement something soon which will do something like this
🙌 1