Showing only MAPE value of Exponential Smoothing

Summary

I intend to show only the MAPE value of the Exponential Smoothing output but it is displaying other extra information. How do I only show the MAPE values, as seen with the Prophet and AutoARIMA models.

Steps to reproduce

Code snippet:

st.header('Error Metrics: MAPE, MSE, RMSE')
       # col1, col2, col3 = st.columns([10, 10, 10])

        models = [ExponentialSmoothing(
                        trend=None, 
                        damped=False
                    ), Prophet(), AutoARIMA()]

        backtests = [model.historical_forecasts(series,
                            start=.5,
                            forecast_horizon=3)
             for model in models]
        
       
        fig = plt.figure()
        series.plot(label='actual')
        for i, m in enumerate(models):
                err = mape(backtests[i], series)
                backtests[i].plot(lw = 3, label = '{}\nMAPE = {:.2f}%\n'.format(m, err))
                #backtests[i].plot(lw = 3, label = '{}, MAPE = {:.2f}%'.format(m, err))
                
        plt.title('Backtest with 3-months forecast horizon (MAPE)')
        plt.legend()
        st.pyplot(fig)

Oh fixed! I just changed the backtest section of the code to permit only the model name and MAPE values.

backtests[i].plot(lw=3, label='{}, MAPE={:.2f}%'.format(m.__class__.__name__, err))

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.