Skip to content

Commit 9a030c7

Browse files
authored
Merge pull request #111730 from cartacioS/patch-35
Predict should not be used in forecasting
2 parents 87d01bf + 0960b29 commit 9a030c7

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

articles/machine-learning/how-to-auto-train-forecast.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,7 @@ fitted_model.named_steps['timeseriestransformer'].get_featurization_summary()
208208

209209
Use the best model iteration to forecast values for the test data set.
210210

211-
```python
212-
predict_labels = fitted_model.predict(test_data)
213-
actual_labels = test_labels.flatten()
214-
```
215-
216-
Alternatively, you can use the `forecast()` function instead of `predict()`, which will allow specifications of when predictions should start. In the following example, you first replace all values in `y_pred` with `NaN`. The forecast origin will be at the end of training data in this case, as it would normally be when using `predict()`. However, if you replaced only the second half of `y_pred` with `NaN`, the function would leave the numerical values in the first half unmodified, but forecast the `NaN` values in the second half. The function returns both the forecasted values and the aligned features.
211+
The `forecast()` function should be used instead of `predict()`, this will allow specifications of when predictions should start. In the following example, you first replace all values in `y_pred` with `NaN`. The forecast origin will be at the end of training data in this case, as it would normally be when using `predict()`. However, if you replaced only the second half of `y_pred` with `NaN`, the function would leave the numerical values in the first half unmodified, but forecast the `NaN` values in the second half. The function returns both the forecasted values and the aligned features.
217212

218213
You can also use the `forecast_destination` parameter in the `forecast()` function to forecast values up until a specified date.
219214

0 commit comments

Comments
 (0)