Self-concordant analysis for logistic regression
Francis Bach
Introduction
The theoretical analysis of statistical methods is usually greatly simplified when the estimators have closed-form expressions. For methods based on the minimization of a certain functional, such as M-estimation methods , this is true when the function to minimize is quadratic, i.e., in the context of regression, for the square loss.
When such loss is used, asymptotic and non-asymptotic results may be derived with classical tools from probability theory (see, e.g., ). When the function which is minimized in M-estimation is not amenable to closed-form solutions, local approximations are then needed for obtaining and analyzing a solution of the optimization problem. In the asymptotic regime, this has led to interesting developments and extensions of results from the quadratic case, e.g., consistency or asymptotic normality (see, e.g., ). However, the situation is different when one wishes to derive non-asymptotic results, i.e., results where all constants of the problem are explicit. Indeed, in order to prove results as sharp as for the square loss, much notation and many assumptions have to be introduced regarding second and third derivatives; this makes the derived results much more complicated than the ones for closed-form estimators .
A similar situation occurs in convex optimization, for the study of Newton’s method for obtaining solutions of unconstrained optimization problems. It is known to be locally quadratically convergent for convex problems. However, its classical analysis requires cumbersome notations and assumptions regarding second and third-order derivatives (see, e.g., ). This situation was greatly enhanced with the introduction of the notion of self-concordant functions, i.e., functions whose third derivatives are controlled by their second derivatives. With this tool, the analysis is much more transparent . While Newton’s method is a commonly used algorithm for logistic regression (see, e.g., ), leading to iterative least-squares algorithms, we don’t focus in the paper on the resolution of the optimization problems, but on the statistical analysis of the associated global minimizers.
In order to consider such extensions and make sure that the new results closely match the corresponding ones for least-squares regression, we derive in Appendix G new Bernstein-like concentration inequalities for quadratic forms of bounded random variables, obtained from general results on U-statistics .
Taylor expansions and Newton’s method
If , i.e., the Hessian is invertible at , we can define the Newton step as , and the Newton decrement at , defined through:
The one-step Newton iterate is the minimizer of the second-order Taylor expansion of at , i.e., of the function . Newton’s method consists in successively applying the same iteration until convergence. For more background and details about Newton’s method, see, e.g., .
which allows to prove an upper-bound of the error of the one-step iterate, by application of Eq. (1) to . Note that these bounds are not the sharpest, but are sufficient in our context. These are commonly used to show the global convergence of the damped Newton’s method or of Newton’s method with backtracking line search , as well as a precise upper bound on the number of iterations to reach a given precision.
Note that in the context of machine learning and statistics, self-concordant functions have been used for bandit optimization and online learning , but for barrier functions related to constrained optimization problems, and not directly for M-estimation.
2 Modifications of self-concordant functions
The logistic function is not self-concordant as the third derivative is bounded by a constant times the second derivative (without the power ). However, similar bounds can be derived with a different control of the third derivatives. Proposition 1 provides lower and upper Taylor expansions while Proposition 2 considers the behavior of Newton’s method. Proofs may be found in Appendix A and follow closely the ones for regular self-concordant functions found in .
Inequalities in Eq. (3) and Eq. (4) provide upper and lower second-order Taylor expansions of , while Eq. (5) provides a first-order Taylor expansion of and Eq. (6) can be considered as an upper and lower zero-order Taylor expansion of . Note the difference here between Eqs. (3-4) and regular third-order Taylor expansions of : the remainder term in the Taylor expansion, i.e., is upper-bounded by ; for small, we obtain a term proportional to (like a regular local Taylor expansion), but the bound remains valid for all and does not grow as fast as a third-order polynomial. Moreover, a regular Taylor expansion with a uniformly bounded third-order derivative would lead to a bound proportional to , which does not take into account the local curvature of at . Taking into account this local curvature is key to obtaining sharp and simple bounds on the behavior of Newton’s method (see proof in Appendix A):
Eq. (7) extends Eq. (1) while Eq. (8) extends Eq. (2). Note that the notion and the results are not invariant by affine transform (contrary to self-concordant functions) and that we still need a (non-uniformly) lower-bounded Hessian. The last two propositions constitute the main technical contribution of this paper. We now apply these to logistic regression and its regularized versions.
Application to logistic regression
Throughout this paper, we consider a fixed design setting (i.e., are consider deterministic) and we make the following assumptions:
Independent outputs: The outputs , are independent (but not identically distributed).
Bounded inputs: .
We denote by the expectation of , i.e.:
Note that with our notation, . In this paper we consider as the generalization performance of a certain estimator . This corresponds to the average Kullback-Leibler divergence to the best model when the model is well-specified, and is common for the study of logistic regression and more generally generalized linear models . Measuring the classification performance through the 0–1 loss is out of the scope of this paper.
with respect to the function in the RKHS (with norm and kernel ), is equivalent to minimizing the cost function
2 Minimal assumptions (misspecified model)
In this section, we do not assume that the model is well-specified. We obtain the following theorem (see proof in Appendix B), which only assumes boundedness of the covariates and independence of the outputs:
This is to be compared with , which uses different proof techniques but obtains similar results for all convex Lipschitz-continuous losses (and not only for the logistic loss). However, the techniques presented in this paper allow the derivation of much more precise statements in terms of bias and variance (and with better rates), that involves some knowledge of the problem. We do not pursue detailed results here, but focus in the next section on well-specified models, where results have a simpler form.
This highlights two opposite strategies for the theoretical analysis of regularized problems: the first one, followed by , is mostly loss-independent and relies on advanced tools from empirical process theory, namely uniform concentration inequalities. Results are widely applicable and make very few assumptions. However, they tend to give performance guarantees which are far below the observed performances of such methods in applications. The second strategy, which we follow in this paper, is to restrict the loss class (to linear or logistic) and derive the limiting convergence rate, which does depend on unknown constants (typically the best linear classifier itself). Once the limit is obtained, we believe it gives a better interpretation of the performance of these methods, and if one really wishes to make no assumption, taking upper bounds on these quantities, we may get back results obtained with the generic strategy, which is exactly what Theorem 1 is achieving.
Thus, a detailed analysis of the convergence rate, as done in Theorem 2 in the next section, serves two purposes: first, it gives a sharp result that depends on unknown constants; second the constants can be maximized out and more general results may be obtained, with fewer assumptions but worse convergence rates.
3 Well-specified models
We now assume that the model is well-specified, i.e., that the probability that is a sigmoid function of a linear function of , which is equivalent to:
Moreover, we denote by the following quantity
Such quantity is an extension of the one used by in the context of kernel Fisher discriminant analysis used as a test for homogeneity. In order to obtain asymptotic equivalents, we require to be small, which, as shown later in this section, occurs in many interesting cases when is large enough.
In this section, we will apply results from Section 2 to the functions and . Essentially, we will consider local quadratic approximations of these functions around the generating loading vector , leading to replacing the true estimator by the one-step Newton iterate from . This is only possible if the Newton decrement is small enough, which leads to additional constraints (in particular the upper-bound on ).
Assume (A1), (A2) and (A3). Assume moreover , where is defined in Eq. (13). If satisfies , then, with probability at least :
When the dimension of is bounded, then under the regular asymptotic regime ( tends to ), has the following expansion J_{0}(w_{0})+\frac{1}{2}\big{(}b_{2}+\frac{d_{2}}{n}\big{)}, a result which has been obtained by several authors in several settings . In this asymptotic regime, the optimal is known to be of order . The main contribution of our analysis is to allow a non asymptotic analysis with explicit constants. Moreover, note that for the square loss, the bound in Eq. (14) holds with , which can be linked to the fact that our self-concordant analysis from Propositions 1 and 2 is applicable with for the square loss. Note that the constants in the previous theorem could probably be improved.
Conditions for asymptotic equivalence.
In order to have the remainder term in Eq. (14) negligible with high probability compared to the lowest order term in the expansion of , we need to have large and small (so that can be taken taking small while is large, and hence we have a result with high-probability). The assumption that grows unbounded when tends to infinity is a classical assumption in the study of smoothing splines and RKHSs , and simply states that the convergence rate of the excess risk , i.e., , is slower than for parametric estimation, i.e., slower than .
Study of parameter κ𝜅\kappa.
First, we always have \kappa\geqslant\frac{R}{\lambda^{1/2}}\big{(}\frac{d_{1}}{n}+b_{1}\big{)}^{1/2}; thus an upper bound on implies an upperbound on which is needed in the proof of Theorem 2 to show that the Newton decrement is small enough. Moreover, is bounded by the sum of and \kappa_{\rm var}=\frac{R}{\lambda^{1/2}}\big{(}\frac{d_{1}}{n}\big{)}\big{(}\frac{d_{2}}{n}\big{)}^{-1/2}. Under simple assumptions on the eigenvalues of or equivalently of , one can show that is small. For example, if of these eigenvalues are equal to one and the remaining ones are zero, then, . And thus we simply need asymptotically greater than . For additional conditions for , see . A simple condition for can be obtained if is assumed bounded (in the context of RKHSs this is a stricter condition that the generating function is inside the RKHS, and is used by in the context of sparsity-inducing norms). In this case, the bias terms are negligible compared to the variance term as soon as is asymptotically greater than .
Variance term.
Note that the diagonal matrix is upperbounded by , i.e., , so that the degrees of freedom for logistic regression are always less than the corresponding ones for least-squares regression (for multiplied by 4). Indeed, the pairs for which the conditional distribution is close to deterministic are such that is close to zero. And thus it should reduce the variance of the estimator, as little noise is associated with these points, and the effect of this reduction is exactly measured by the reduction in the degrees of freedom.
Moreover, the rate of convergence of the variance term has been studied by many authors (see, e.g., ) and depends on the decay of the eigenvalues of (the faster the decay, the smaller ). The degrees of freedom usually grows with , but in many cases is slower than , leading to faster rates in Eq. (14).
4 Smoothing parameter selection
In this section, we obtain a criterion similar to Mallow’s to estimate the generalization error and select in a data-driven way the regularization parameter (referred to as the smoothing parameter when dealing with splines or RKHSs). The following theorem shows that with a data-dependent criterion, we may obtain a good estimate of the generalization performance, up to a constant term independent of (see proof in Appendix D):
The previous theorem, which is essentially a non-asymptotic version of results in can be further extended to obtain oracle inequalities when minimizing the data-driven criterion , similar to results obtained in for the square loss. Note that contrary to least-squares regression with Gaussian noise, there is no need to estimate the unknown noise variance (of course only when the logistic model is actually well-specified); however, the matrix used to define the degrees of freedom does depend on and thus requires that is used as an estimate. Finally, criteria based on generalized cross-validation could be studied with similar tools.
We denote by the set of non-zero components of and the vector of signs of . On top of Assumptions (A1), (A2) and (A3), we will make the following assumption regarding normalization for each covariate (which can always be imposed by renormalization), i.e.,
Normalized covariates: for all , .
The following theorem provides a sufficient condition for model consistency. It is based on the consistency condition , which is exactly the same as the one for the square loss (see proof in Appendix E):
Assume (A1), (A2), (A3) and (A4). Assume that there exists such that
and . Assume . Then the probability that the vector of signs of is different from is upperbounded by
For the square loss, the previous theorem simplifies : with our notations, the constraint and the last term in Eq. (16), which are the only ones depending on , can be removed (indeed, the square loss allows the application of our adapted self-concordant analysis with the constant ). On the one hand, the favorable scaling between and , i.e., for a certain well-chosen , is preserved (since the logarithm of the added term is proportional to ). However, on the other hand, the terms in may be large as is the radius of the entire data (i.e., with all covariates). Bounds with the radius of the data on only the relevant features in could be derived as well (see details in the proof in Appendix E).
Necessary condition.
In the case of the square loss, a weak form of Eq. (15), i.e., turns out to be necessary and sufficient for asymptotic correct model selection . While the weak form is clearly necessary for model consistency, and the strict form sufficient (as proved in Theorem 4), we are currently investigating whether the weak condition is also sufficient for the logistic loss.
2 Efficiency
Another type of result has been derived, based on different proof techniques and aimed at efficiency (i.e., predictive performance). Here again, we can extend the result in a very simple way. We assume, given the set of non-zero components of :
Note that the assumption made in is slightly stronger but only depends on the cardinality of (by minimizing with respect to all sets of indices with cardinality equal to the one of ). The following theorem provides an estimate of the estimation error as well as an oracle inequality for the generalization performance (see proof in Appendix F):
Assume (A1), (A2), (A3), (A4), and (A5). For all , with probability at least , we have:
We obtain a result which directly mimics the one obtained in for the square loss with the exception of the added bound on . In particular, if we take , we get with probability at least , an upper bound on the generalization performance . Again, the proof of this result is a direct extension of the corresponding one for the square loss, with few additional assumptions owing to the proper self-concordant analysis.
Conclusion
The present work could be extended in several interesting ways to different settings. First, for logistic regression, other extensions of theoretical results from least-squares regression could be carried out: for example, the analysis of sequential experimental design for logistic regression leads to many assumptions that could be relaxed (see, e.g., ). Also, other regularization frameworks based on sparsity-inducing norms could be applied to logistic regression with similar guarantees than for least-squares regression, such as group Lasso for grouped variables or non-parametric problems , or resampling-based procedures that allow to get rid of sufficient consistency conditions.
Appendix A Proofs of optimization results
We first consider univariate functions and prove the following lemma that gives upper and lower Taylor expansions:
Thus, we need to prove Eq. (18) for always strictly positive (which is done above) and for identically equal to zero, which implies that is linear, which is then equivalent to Eq. (18). Note the difference with a classical uniform bound on the third derivative, which leads to a third-order polynomial lower bound, which tends to more quickly than Eq. (20). Moreover, Eq. (21) may be interpreted as an upperbound on the remainder in the Taylor expansion of around :
The right hand-side is equivalent to for close to zero (which should be expected from a three-times differentiable function such that ), but still provides a good bound for away from zero (which cannot be obtained from a regular Taylor expansion).
A.2 Proof of Proposition 1
In order to prove Eq. (5), we consider . We have , and using Eq. (6) and Eq. (17). Thus, by integrating between and ,
which implies which in turn leads to Eq. (5).
A.3 Proof of Proposition 2
Since we have assumed that , then by Eq. (6), the Hessian of is everywhere invertible, and hence the function is strictly convex. Therefore, if the minimum is attained, it is unique.
Moreover, a short calculation shows that for all :
This implies that for , . Since , we have for .
Since this is true for all such that , this shows that the value of the function on the entire ellipsoid (since is positive definite) is greater or equal to the value at ; thus, by convexity, there must be a minimizer —which is unique because of Eq. (6)—of such that
In order to prove Eq. (9), we will simply apply Eq. (7) at , which requires to upper-bound . If we denote by the Newton step, we have:
Therefore, using Eq. (6) again, we obtain:
We have , and thus, we have
which leads to Eq. (8). Moreover, it shows that we can apply Eq. (7) at and get:
which leads to the desired result, i.e., Eq. (9).
Appendix B Proof of Theorem 1
Following , we denote by the unique global minimizer of the expected regularized risk . We simply apply Eq. (7) from Proposition 2 to and , to obtain, if the Newton decrement (see Section 2 for its definition) is less than , that and its population counterpart are close, i.e.:
We can then apply the upper Taylor expansion in Eq. (4) from Proposition 1 to and , to obtain, with (which is such that ):
We can now apply the concentration inequality from Proposition 4 in Appendix G, i.e., Eq. (42), with . We use . In order to actually have (so that we can apply our self-concordant analysis), it is sufficient that:
leading to the constraints . We then get with probability at least (for ):
For , the bound in Eq. (12) is always satisfied. Indeed, this implies with our choice of that . Moreover, since is bounded from above by ,
which is smaller than the right hand-side of Eq. (12).
Appendix C Proof of Theorem 2
We denote by the second-order Taylor expansion of around , equal to , with , and the expansion of around , equal to . We denote by the one-step Newton iterate from for the function , defined as the global minimizer of and equal to .
What the following proposition shows is that we can replace by for obtaining the estimator and that we can replace by for measuring its performance, i.e., we may do as if we had a weighted least-squares cost, as long as the Newton decrement is small enough:
Assume . We have:
Proof We show that (1) is close to using Proposition 2 on the behavior of Newton’s method, (2) that is close to by using its closed form , and (3) that and are close using Proposition 1 on upper and lower Taylor expansions.
We first apply Eq. (9) from Proposition 2 to get
This implies that and are close, i.e.,
Thus, using the closed form expression for , we obtain
We can now apply Eq. (3) from Proposition 2 to get for all such that ,
Thus, using Eq. (28) for and :
From Eq. (27), we have . We thus obtain, using that :
We can now go on with the proof of Theorem 2. From Eq. (26) in Proposition 3 above, we have, if ,
We can now bound each term separately and check that we indeed have (which allows to apply Proposition 2). First, from Eq. (13), we can derive
We can now apply concentration inequalities from Appendix G, together with the following applications of Bernstein’s inequality. Indeed, we have with
Similarly, with probability at least , we have:
We thus get, through the union bound, with probability at least :
together with . We now take and assume , , and , so that, we have
This implies that , so that we can apply Proposition 2. Thus, by denoting , , and , we get a global upper bound:
With , we get
which leads to the desired result, i.e., Eq. (14).
Appendix D Proof of Theorem 3
We follow the same proof technique than for Theorem 2 in Appendix C. We have:
where is the two-step Newton iterate from . We have, from Eq. (24), , which then implies (with Eq. (9)):
Moreover, we have from the closed-form expression of :
Finally, we have, using Eq. (5) from Proposition 1:
where .
What also needs to be shown is that \big{|}\mathop{\rm tr}\hat{Q}_{\lambda}(\hat{Q}_{\lambda}+\lambda I)^{-1}-\mathop{\rm tr}Q(Q+\lambda I)^{-1}\big{|} is small enough; by noting that , , and , we have, using Eq. (22) from Appendix A.2:
All the terms in Eqs. (30,31,32,33) that need to be added to obtain the required upperbound are essentially the same than the ones proof of Theorem 2 in Appendix C (with smaller constants). Thus the rest of the proof follows.
Appendix E Proof of Theorem 4
We directly use Proposition 2 with the function —where denotes the -dimensional vector obtained by completing by zeros—to obtain from Eq. (7):
as soon as , and thus as soon as and . We thus have:
Note that , thus it is implied by the following constraint:
In terms of upper bound on we then get:
which can be reduced . In terms of upper bound on we get:
which can be reduced to , using the constraint on .
We now derive and use concentration inequalities. We first use Bernstein’s inequality (using for all and , and ), and the union bound to get
as soon as , i.e., as soon as, , which is indeed satisfied because of our assumption on . We also use Bernstein’s inequality to get
The union bound then leads to the desired result.
Appendix F Proof of Theorem 5
We follow the proof technique of . We have . Thus, because is a minimizer of ,
which implies, since :
If we denote by the estimation error, we deduce:
If we assume , then, we have , and thus using (A5), we get . From Eq. (38), we thus get:
Using Eq. (3) in Proposition 1 with , we obtain:
which implies, using and Eq. (39):
We can now use, with , to get:
This implies using Eq. (23), that a soon as , which itself implies that \frac{1}{(R\|\Delta\|_{2})^{2}}\big{(}e^{-R\|\Delta\|_{2}}+R\|\Delta\|_{2}-1\big{)}\geqslant 1/2, and thus, from Eq. (40),
Appendix G Concentration inequalities
In this section, we derive concentration inequalities for quadratic forms of bounded random variables that extend the ones already known for Gaussian random variables . The following proposition is a simple corollary of a general concentration result on U-statistics .
Proof We apply Theorem 3.4 from , with , if and zero otherwise. We then have (following notations from ):
Moreover, we have from Bernstein’s inequality :
leading to the desired result, noting that for , the bound is trivial.
We can apply to our setting to get, with (with ), leading to and .
If no assumptions are made, we simply have: and we get after bringing terms together:
Well-specified models
In this case, and , , .
Acknowledgements
I would like to thank Sylvain Arlot, Jean-Yves Audibert and Guillaume Obozinski for fruitful discussions related to this work. This work was supported by a French grant from the Agence Nationale de la Recherche (MGA Project ANR-07-BLAN-0311).