Generation estimates an outcome from patterns or information in input data. In machine learning, models generate predictions without necessarily modeling temporal order; in time series analysis, forecasts estimate future values from ordered past observations. section 7.1 section 1.0
Choose the generation method according to the data structure and decision problem:
- Use regression to generate numeric responses from relationships between predictors and a target; linear regression represents predictions with a fitted line and estimated coefficients. section 4.1.1
- Use classification models to generate class labels, then compare predicted labels with observed labels to evaluate predictive power. section 6.3.3
- Use forecasting when observations are time-ordered and future values depend on prior values, trends, seasonality, or other temporal patterns. section 7.0 section 7.1
- Use simulation to generate many possible outcomes when uncertainty and variability matter more than one precise estimate. section 9.5.7
Evaluating an out-of-sample generation
An ARIMA model can generate April closing-price forecasts from October–March training data. Comparing its approximately 173.51 daily forecast with April's approximately 169.43 average reveals a small overprediction and exposes the limits of forecasting volatile prices. section 7.3.11
>>> y_pred = clf.predict(X_test)
Generate class labels from held-out features with a trained decision-tree classifier, then use the resulting array for evaluation. section 6.3.3
>>> forecast_test = model_fit.forecast(len(test))
Generate a specified number of out-of-sample values from a fitted ARIMA model for direct comparison with a test set. section 7.3.11



















