Predictive Models, Feature Transformations, and Decision Trees

Foundations of Predictive Models and Linear Regression

  • Definition of a predictive model:

    • A predictive model is formally defined as a collection of numbers that specifies the mathematical relationship mapping a specific input to a specific output label.

    • Once established, this relationship allows deterministic calculation or direct inference of an output value given any valid input value.

  • Linear regression as a learning algorithm:

    • Prior to exposure to data, the learning algorithm defines the general functional form of the relationship, such as a linear regression algorithm.

    • After executing the fitting process on a dataset, a concrete predictive model is created.

    • In a two-dimensional visual representation, this fitted model manifests as a straight line, which corresponds directly to a green mathematical equation defining the relationship.

  • Prediction mechanics:

    • For an individual who is 4040 years of age, their predicted glucose level can be derived in two distinct ways:

    • Mathematically/manually by evaluating the input through the fitted equation.

    • Visually by reading the corresponding coordinate point directly from the two-dimensional plot.

Feature Transformations and Input Modifications

  • Limitations of raw input functions:

    • In statistics and machine learning, input variables do not always exhibit a direct linear relationship with the target output in their raw form.

    • To enable a linear regression algorithm to capture the true underlying data-generating process, the input features frequently require mathematical transformation.

  • Case study of C-reactive protein (CRP) and inflammation score:

    • In raw form, measured CRP levels do not display a linear relationship with the calculated inflammation score.

    • Applying a log transformation to the raw CRP values establishes a clear linear relationship with the inflammation score.

    • This feature modification enables the linear learning algorithm to map the input onto the output label effectively.

  • Alternative learning algorithms and model specification:

    • Defining an algorithm involves deciding the functional nature of the relationship connecting inputs to outputs.

    • For instance, a relationship can be hypothesized to include a subscript component or non-linear structural form.

    • Exposing different learning algorithms to the exact same dataset during fitting produces entirely distinct predictive models, each reflecting the underlying structural assumptions of the chosen algorithm.

Rule-Based Learning Algorithms and Decision Trees

  • Concept of decision trees:

    • A decision tree is an alternative learning algorithm that departs from continuous linear formulations.

    • Instead of modeling relationships via a continuous equation or a straight line, a decision tree represents the relationship between input values (e.g., age) and output values (e.g., glucose) through a discrete set of rules.

  • Alignment of rules to empirical data:

    • In linear regression, the learning algorithm specifies a linear framework, and the fitting process identifies the specific coefficients that best fit the data points.

    • In decision trees, the learning algorithm specifies a rule-based hierarchical framework, and the fitting process identifies the specific split boundaries and output values that conform to the training data points.

Mechanics of Decision Tree Predictions and Step-Function Plots

  • Classification of decision trees as predictive models:

    • A decision tree qualifies as a predictive model because it provides a well-defined mathematical mapping from an input domain to an output domain.

  • Sequential rule evaluation for age 4040:

    • When evaluating an individual who is 4040 years of age, the model processes the following rule sequence:

    • Evaluates whether age is greater than 2323: condition met.

    • Evaluates whether age falls within the interval between 2323 and 2727: condition not met.

    • Evaluates whether age falls within the interval between 2727 and 3939: condition not met.

    • Evaluates whether age falls within the interval between 3030 and 5151: condition met.

    • Concludes evaluation: for an individual falling in the 3030 to 5151 range, the assigned predicted glucose level is 133133.

  • Two-dimensional geometric representation:

    • Both linear regression and decision trees can be plotted in two dimensions using age on the horizontal axis and glucose on the vertical axis.

    • While linear regression produces a continuous diagonal line across the space, a decision tree produces an "escalator" or staircase step-function plot.

    • Each flat step on the escalator corresponds to a specific discrete rule interval identified during fitting.

The Machine Learning Fitting Process

  • Core definition of fitting:

    • Fitting represents the computational process wherein an abstract learning algorithm is exposed to empirical data points.

    • The algorithm systematically learns the mathematical relationships present among the data points.

  • Contrast across model paradigms:

    • In parametric regression models, fitting derives optimal numerical coefficients for a predefined equation.

    • In non-parametric, rule-based models like decision trees, fitting extracts and establishes the explicit set of conditional decision rules and threshold values that partition the data points.

Questions & Peer Discussion

  • Peer exercise instructions:

    • Objective: Connect the textual set of rules displayed on the right to the visual plot displayed on the left.

    • Prompt: Assess the two-dimensional plot to confirm whether an individual at age 4040 maps directly to a predicted glucose level of 133133.

  • Dialogue and exchange:

    • Inquiry: "From your Object to grasp. Mhmm. Would you be able to establish that when you're 40, your predicted glucose is a 133?"

    • Response: "Mhmm. Yes? Yes."