Repository: ourownstory/neural_prophet

Issue:
[bug] After m.predict(), forecast output contains object dtypes instead of float64 dtypes
`Forecast` dataframe output contains `y`, `residual1`, `yhat1`, `ar1`, and so on. I expect that all of them have _float64_ dtype. However, all of them except `y` have _object_ dtype instead. This makes it more difficult to further process this data, for example aggregating.

**Code:**

```
m = NeuralProphet(...)
metrics = m.fit(df_train)
forecast = m.predict(df_test)
print(forecast.dtypes)
```

**Result:**

```
ds              datetime64[ns]
y                      float64
residual1               object
yhat1                   object
ar1                     object
trend                   object
season_daily            object
dtype: object
```

**Desired Result:**

```
ds               datetime64[ns]
y                       float64
residual1               float64
yhat1                   float64
ar1                     float64
trend                   float64
season_daily            float64
dtype: float64
```

Also, replace any `None` with `NaN`.


Discussion:

Resolving patch:
diff --git a/neuralprophet/forecaster.py b/neuralprophet/forecaster.py
--- a/neuralprophet/forecaster.py
+++ b/neuralprophet/forecaster.py
@@ -2808,7 +2808,7 @@ def _reshape_raw_predictions_to_forecst_df(self, df, predicted, components):
                 forecast = predicted[:, forecast_lag - 1, j]
                 pad_before = self.max_lags + forecast_lag - 1
                 pad_after = self.n_forecasts - forecast_lag
-                yhat = np.concatenate(([None] * pad_before, forecast, [None] * pad_after))
+                yhat = np.concatenate(([np.NaN] * pad_before, forecast, [np.NaN] * pad_after))
                 # 0 is the median quantile index
                 if j == 0:
                     name = f"yhat{forecast_lag}"
@@ -2834,7 +2834,7 @@ def _reshape_raw_predictions_to_forecst_df(self, df, predicted, components):
                         forecast = components[comp][:, forecast_lag - 1, j]  # 0 is the median quantile
                         pad_before = self.max_lags + forecast_lag - 1
                         pad_after = self.n_forecasts - forecast_lag
-                        yhat = np.concatenate(([None] * pad_before, forecast, [None] * pad_after))
+                        yhat = np.concatenate(([np.NaN] * pad_before, forecast, [np.NaN] * pad_after))
                         if j == 0:  # temporary condition to add only the median component
                             name = f"{comp}{forecast_lag}"
                             df_forecast[name] = yhat
@@ -2845,7 +2845,7 @@ def _reshape_raw_predictions_to_forecst_df(self, df, predicted, components):
                 for j in range(len(self.config_train.quantiles)):
                     forecast_0 = components[comp][0, :, j]
                     forecast_rest = components[comp][1:, self.n_forecasts - 1, j]
-                    yhat = np.concatenate(([None] * self.max_lags, forecast_0, forecast_rest))
+                    yhat = np.concatenate(([np.NaN] * self.max_lags, forecast_0, forecast_rest))
                     if j == 0:  # temporary condition to add only the median component
                         # add yhat into dataframe, using df_forecast indexing
                         yhat_df = pd.Series(yhat, name=comp).set_axis(df_forecast.index)


Test patch: