\mathcal{H}_s(R)^2$ parametrized by a separation lower bound $\Delta$ on $\|f-g\|$.

[**Main contributions and outline of the paper.**  ]{} In Section \[s:model\] we first state preliminary results about the margin behavior that will prove crucial in our analysis. We then make three types of contributions:

-   In Section \[s:upper\] we design a classifier ${\widehat}\Phi_{d_n}$ based on a thresholding rule. We derive an excess risk bound that generalizes the worst-case results of [@Cadre] but also imply faster rates when the distance $\|f-g\|$ is large. This acceleration is a consequence of the nice properties of the margin (see also, [e.g.]{}, [@AT07] and [@GKM16]).

    The classifier ${\widehat}\Phi_{d_n}$ defined in  with $d_n \approx n^{\frac{1}{2s+1}}$ has an excess risk roughly bounded by (omitting logarithmic factors and constant factors depending only on $s$ and $R$): for $n {\geqslant}N_{R,s}$ large enough, $$\sup_{\substack{f,g \in {\mathcal{H}_s}(R) \\ \|f-g\| {\geqslant}\Delta}} \left\{ \mathcal{R}_{f,g}({\widehat}\Phi_{d_n}) - \inf_{\Phi} \mathcal{R}_{f,g}(\Phi)  \right\}  \lesssim \left\{\begin{array}{ll}
        n^{-\frac{s}{2s+1}} & \textrm{if } \Delta \lesssim n^{-\frac{s}{2s+1}} \\[0.2em]
        \displaystyle \frac{1}{\Delta} n^{-\frac{2s}{2s+1}} & \textrm{if } \Delta \gtrsim n^{-\frac{s}{2s+1}}
    \end{array}\right.$$

-   In Section \[s:minimaxfano\] we derive a matching minimax lower bound (up to logarithmic factors) showing that the above worst-case bound cannot be improved by any classifier.

    For any number $n {\geqslant}N_{R,s}$ of observations, any 