A feature is an input attribute used to predict an outcome. In regression, features are also called independent variables, explanatory variables, or predictors; the outcome is the dependent, response, or target variable. Labeled data pairs known feature values with known outcomes so a fitted model can predict outcomes for new observations. section 4.0
Choose features for the outcome being predicted. Linear regression uses one or more features to predict a numeric response and assumes a linear relationship. A simple regression has one predictor; a multiple regression has two or more. Logistic regression instead combines predictors to estimate the probability of a binary outcome. Its predictors may be numeric or categorical. section 4.1 section 5.1
Predicting race split times
To estimate a Stage 2 split time from a Stage 1 split time, set `y = mds['stage2']` and `x = mds['stage1']`. Add an intercept with `x = sm.add_constant(x)`, then fit `sm.OLS(y, x).fit()`. For two predictors, select both columns into `x` instead. Ordinary least squares estimates coefficients by minimizing squared differences between observed and predicted Stage 2 times; the fitted output still needs evaluation before use. section 4.2.2
>>> x = mds[['stage1', 'second_variable']]
The two-column `x` selection shows how a single-predictor input becomes a multiple-predictor input. section 4.2.2
A fitted coefficient does not, by itself, establish that a feature is useful. Inspect coefficient p-values and overall fit, and test regression assumptions before interpreting results. Adding predictors merely to raise R² can increase complexity and multicollinearity. In a raisin-classification example, an initial logistic model uses seven morphological features; insignificant predictors and multicollinearity motivate a reduced model using MinorAxisLength and Perimeter. Feature choice is therefore part of model evaluation, not just input preparation. section 4.3 section 5.2.2













