liveBook · Manning

Generation

As explained in Statistics Every Programmer Needs

Prediction is the process of estimating an outcome from patterns or information in input data without necessarily modeling its temporal ordering.

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

How Statistics Every Programmer Needs covers it

How deep it goes
Explains method selection, implementation, comparison with observations, and limitations, but does not develop formal statistical proofs.
Examples
Demonstrates decision-tree labels, linear-regression responses, ARIMA stock forecasts, and Monte Carlo stock-price trajectories.
What it assumes
Assumes basic data analysis and probability, while distinguishing unordered observations from temporally ordered data.
What you can do after
Apply it via Python models to generate predictions, compare them with observed values, and interpret accuracy alongside uncertainty and volatility.
How it connects
Connects prediction with regression, classification, forecasting, time series analysis, ARIMA, exponential smoothing, and Monte Carlo simulation.

Also explained in

Compare how 20 books explain generation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Every Programmer Needs. The section links point to the parts of the book it draws on.