Spearman
Overview
Spearman's rank correlation coefficient ρ measures the strength and direction of a monotonic relationship between a numerical parameter and an objective. It compares ranks rather than raw values, so a nonlinear but monotonic relationship can still have a strong correlation. It does not detect U-shaped effects or interactions, and association is not causation.
The Importance Chart ranks numerical parameters by |ρ|. The Sensitivity Heatmap shows signed ρ for each numerical parameter and objective.
Supported inputs and output
- Optuna Int/Float parameters are supported. Optuna categorical choices are
nominal even when labels look numeric, such as
10,2,99. - Nominal categories have no inherent order. They are excluded rather than assigned ordinal IDs, and shown separately as Unsupported (categorical) in charts, heatmaps, CSV and reports. They receive no score, bar, colored score cell or ranking. Unsupported is not a measured zero effect.
- All-categorical input shows No supported numerical parameters in the widgets. There are no Spearman scores.
- Numerical missingness is different: pairwise deletion drops each non-finite parameter/objective pair before ranking. Fewer than two retained pairs produce an unavailable (NaN) correlation, not categorical unsupported.
Calculation
Rank the parameter and objective independently, assigning average ranks to ties, then compute Pearson correlation of the ranks: \rho = \frac{\sum_i (R_{x,i}-\bar R_x)(R_{y,i}-\bar R_y)} {\sqrt{\sum_i (R_{x,i}-\bar R_x)^2\sum_i (R_{y,i}-\bar R_y)^2}}
The range is −1 to 1: positive values indicate increasing monotonic association, negative values decreasing association. A constant series has undefined correlation.
For numerical worked examples and the derivation, see the detailed numerical theory.
Use Ridge for numerical linear contributions. See the method guide for other methods and their categorical-encoding limitations.