liveBook · Manning

Second derivative

As explained in Ensemble Methods for Machine Learning

A second derivative is the derivative of a function's first derivative and describes its local curvature with respect to a variable.

A second derivative describes how a function’s slope changes. In optimization, it adds local curvature to the first derivative, replacing a merely linear approximation with a quadratic one and often producing more informative steps. section 6.1

Use the second derivative to:

  • Differentiate a univariate function twice to obtain its second derivative. section 6.1
  • Represent second-order information for multivariate functions with a Hessian matrix. section 6.1
  • Construct Newton updates from the gradient and inverse Hessian, typically using a unit step length. section 6.1.1
  • Weight boosting residuals through the Hessian, focusing learning more strongly on badly misclassified examples. section 6.2.1

Newton’s descent on the Branin function

Starting from [2, −5], compute the Branin function’s gradient and Hessian, set the descent direction to −H⁻¹g, update with step length 1, and stop when successive estimates are sufficiently close. Compared with gradient descent, the resulting path reaches a local minimum more directly, although both methods can converge to a saddle point. section 6.1.1

Figure 6.1 Comparing gradient descent (left) and Newton’s method (right). Gradient descent only uses local first-order information near the current solution, which leads to a linear approximation of the function being optimized. Different step lengths will then lead to different next steps. Newton’s method uses both local first- and second-order information near the current solution, leading to a quadratic (parabolic) approximation of the function being optimized. This provides a better estimate of the next step.
CH06_F01_Kunapuli

Compare first-order linear and second-order quadratic approximations visually; the contrast clarifies why curvature can improve optimization steps. section 6.1

How Ensemble Methods for Machine Learning covers it

How deep it goes
Explains repeated differentiation, Hessian representation, quadratic approximation, and Newton updates with an implemented example.
Examples
Uses the Branin function, logistic loss, and Hessian-weighted residuals to illustrate curvature and optimization.
What it assumes
Assumes familiarity with first derivatives, gradients, optimization updates, and basic univariate and multivariate functions.
What you can do after
Build it from scratch by computing gradients, Hessians, Newton directions, updates, and convergence checks.
How it connects
Connects second derivatives to first derivatives, Hessian matrices, gradient descent, Newton’s method, and gradient boosting.

Also explained in

Compare how 3 books explain second derivative →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Ensemble Methods for Machine Learning. The section links point to the parts of the book it draws on.