Skip to main content
Ctrl+K
scikit-plots homepage scikit-plots homepage
  • Introduction
  • User Guide
  • APIs Reference
  • Tutorials
  • Tags
    • Release History
    • Community-G
    • Community-Z
    • Developer's Guide
    • Code of Conduct
    • Governance
    • Roadmap
    • About us
  • GitHub
  • PyPI
  • Introduction
  • User Guide
  • APIs Reference
  • Tutorials
  • Tags
  • Release History
  • Community-G
  • Community-Z
  • Developer's Guide
  • Code of Conduct
  • Governance
  • Roadmap
  • About us
  • GitHub
  • PyPI

Section Navigation

  • scikitplot
    • config_context
    • get_config
    • get_logger
    • logger
    • reset
    • set_config
    • show_config
    • show_versions
    • online_help
  • scikitplot.api
    • plot_pca_2d_projection
    • plot_pca_component_variance
    • plot_feature_importances
    • plot_learning_curve
    • plot_elbow
    • plot_residuals_distribution
    • plot_classifier_eval
    • plot_confusion_matrix
    • plot_precision_recall
    • plot_roc
    • plot_calibration
    • plot_silhouette
    • validate_labels
    • cumulative_gain_curve
    • binary_ks_curve
    • validate_plotting_kwargs
  • scikitplot.cexperimental
    • expit
    • log_expit
    • logit
    • py_print
    • sigmoid
    • softmax
    • logsumexp
    • log_softmax
  • scikitplot.cexternals
    • stats
    • get_include
  • scikitplot.experimental
    • ENVELOPES
    • compose_as_waveform
    • play_waveform
    • plot_waveform
    • save_waveform
    • save_waveform_as_mp3
    • sheet_to_note
    • sheet_converter
    • serialize_sheet
    • export_sheet
    • LLM_PROVIDER_CONFIG_MAP
    • LLM_PROVIDER_ENV_CONNECTOR_MAP
    • get_response
    • load_mlflow_gateway_config
  • scikitplot.externals
    • ProbScale
    • probplot
    • plot_pos
    • fit_line
  • scikitplot.kds
    • print_labels
    • decile_table
    • plot_cumulative_gain
    • plot_lift
    • plot_lift_decile_wise
    • plot_ks_statistic
    • report
  • scikitplot.modelplotpy
    • ModelPlotPy
    • plot_response
    • plot_cumresponse
    • plot_cumlift
    • plot_cumgains
    • plot_all
    • plot_costsrevs
    • plot_profit
    • plot_roi
  • scikitplot.preprocessing
    • GetDummies
  • scikitplot.snsx
    • print_labels
    • kdsplot
    • aucplot
  • scikitplot.sp_logging
    • CRITICAL
    • DEBUG
    • ERROR
    • FATAL
    • INFO
    • NOTSET
    • WARN
    • WARNING
    • AlwaysStdErrHandler
    • GoogleLogFormatter
    • critical
    • debug
    • error
    • error_log
    • fatal
    • getEffectiveLevel
    • get_logger
    • log_if
    • setLevel
    • vlog
    • warn
    • warning
  • scikitplot.stats
    • Events
    • FitnessFunc
    • PointMeasures
    • RegularEvents
    • bayesian_blocks
    • binned_binom_proportion
    • binom_conf_interval
    • bootstrap
    • cdf_from_intervals
    • fold_intervals
    • gaussian_fwhm_to_sigma
    • gaussian_sigma_to_fwhm
    • histogram_intervals
    • interval_overlap_length
    • kuiper
    • kuiper_false_positive_probability
    • kuiper_two
    • mad_std
    • median_absolute_deviation
    • poisson_conf_interval
    • signal_to_noise_oir_ccd
    • calculate_bin_edges
    • freedman_bin_width
    • histogram
    • knuth_bin_width
    • scott_bin_width
    • akaike_info_criterion
    • akaike_info_criterion_lsq
    • bayesian_info_criterion
    • bayesian_info_criterion_lsq
    • tweedie_gen
    • tweedie
  • scikitplot.visualkeras
    • graph_view
    • layered_view
    • SpacingDummyLayer
  • Recently Deprecated
    • _factory_api
    • plot_roc_curve
    • plot_precision_recall_curve
  • APIs Reference
  • scikitplot.snsx
  • print_labels

print_labels#

scikitplot.snsx.print_labels(as_json=True, indent=2)[source]#

Pretty-print the legend of decile table column names.

[
    "decile",
    "prob_min",
    "prob_max",
    "prob_avg",
    "cnt_resp_total",
    "cnt_resp",
    "cnt_resp_non",
    "cnt_resp_rndm",
    "cnt_resp_wiz",
    "rate_resp",  # (alias to decile_wise_response, decile_wise_gain)
    "cum_resp_total",
    "cum_resp_total_pct",
    "cum_resp",  #  (alias to cumulative_gain)
    "cum_resp_pct",
    "cum_resp_non",
    "cum_resp_non_pct",
    "cum_resp_rndm",
    "cum_resp_rndm_pct",
    "cum_resp_wiz",
    "cum_resp_wiz_pct",
    "KS",
    "cumulative_lift",
    "decile_wise_lift",
]
Parameters:
as_jsonbool, default=True

If True, pretty-print as JSON. If False, use Python’s pprint.

indentint, default=2

Indentation for JSON formatting.

Parameters:
  • as_json (bool)

  • indent (int)

Return type:

None

See also

kdsplot

Given binary labels y_true (0/1) and probabilities y_score 1d array, compute/plot a decile table.

References

[1]

tensorbored/kds

[2]

tensorbored/kds

Examples

>>> import scikitplot.snsx as sp
>>> sp.print_labels()
{
  "decile": "Meaning: Ranked group (1 = highest predicted probability). Critical: Ensure sorted descending by model score. Fatal if top deciles don't capture positives.Formula: rank by model score into k quantiles (e.g., 10 deciles). ",
  "prob_min": "Meaning: Lowest predicted probability in the decile. Critical: Signals model calibration. Fatal if too close to prob_max (poor ranking).Formula: min(score in decile). ",
  "prob_max": "Meaning: Highest predicted probability in the decile. Critical: Checks separation. Fatal if overlaps lower deciles (poor discrimination).Formula: max(score in decile). ",
  "prob_avg": "Meaning: Average predicted probability in the decile. Critical: Useful for calibration curves; should decrease monotonically across deciles.Formula: mean(score in decile). ",
  "cnt_resp_total": "Meaning: Total samples in the decile. Critical: Denominator for rate_resp and cumulative % calculations. Fatal if deciles uneven.Formula: count(samples in decile). ",
  "cnt_resp": "Meaning: Actual responders in the decile (how many responders we captured). Critical: Should never exceed cnt_resp_wiz. Flat counts across deciles indicate useless model.Formula: sum(y_true=1 in decile). ",
  "cnt_resp_non": "Meaning: Non-responders in the decile. Critical: Used for KS/statistics. Too high in top deciles is a warning.Formula: cnt_resp_total - cnt_resp. ",
  "cnt_resp_rndm": "Meaning: Expected responders if randomly assigned. Critical: Baseline for comparison. Fatal if model only slightly above random.Formula: cnt_resp_total * (total_responders / total_samples). ",
  "cnt_resp_wiz": "Meaning: Ideal responders if model were perfect. Critical: Must be ≥ cnt_resp. Fatal if NaN or actual far below.Formula: allocate top responders directly into highest deciles. ",
  "rate_resp": "Meaning: Per-decile response rate (alias to decile_wise_response, decile_wise_gain). Critical: Measures decile quality. Early deciles should outperform later ones.Formula: rate_resp = decile_wise_response = cnt_resp / cnt_resp_total. ",
  "cum_resp_total": "Meaning: Cumulative total samples. Critical: Tracks population coverage.Formula: Σ cnt_resp_total(≤ current decile). ",
  "cum_resp_total_pct": "Meaning: % cumulative population. Critical: X-axis for lift/gain curves; check decile balance.Formula: cum_resp_total / total_samples * 100. ",
  "cum_resp": "Meaning: Cumulative responders (alias to cumulative_gain) up to this decile so ML evaluation (how much `gain` vs random baseline). Critical: Should increase; max = total responders. Flat curve = weak model.Formula: cumulative_gain = cumulative_response = Σ cnt_resp(≤ current decile) = cum_resp_pct vs cum_resp_total_pct. ",
  "cum_resp_pct": "Meaning: % cumulative responders = cum_resp / total_responders * 100. Critical: Wizard curve should be ≥ model; used in lift/gain charts.Formula: cum_resp / total_responders * 100. ",
  "cum_resp_non": "Meaning: Cumulative non-responders. Critical: Used in KS statistic; early dominance is bad.Formula: Σ cnt_resp_non(≤ current decile). ",
  "cum_resp_non_pct": "Meaning: % cumulative non-responders. Critical: Should differ from cum_resp_pct; almost equal = model fails.Formula: cum_resp_non / total_nonresponders * 100. ",
  "cum_resp_rndm": "Meaning: Cumulative expected responders if randomly assigned. Critical: Baseline for cumulative lift. Fatal if model ≈ random curve.Formula: Σ cnt_resp_rndm(≤ current decile). ",
  "cum_resp_rndm_pct": "Meaning: % cumulative random responders = cum_resp_rndm / total_responders * 100. Critical: Random baseline curve (diagonal). Always linear from (0,0) to (100,100). Fatal if model curve is near or below it.Formula: cum_resp_rndm / total_responders * 100. ",
  "cum_resp_wiz": "Meaning: Cumulative ideal responders. Critical: Should always ≥ model; never NaN.Formula: Σ cnt_resp_wiz(≤ current decile). ",
  "cum_resp_wiz_pct": "Meaning: % cumulative ideal responders. Critical: Wizard benchmark for lift/gain curves; gaps indicate model weakness.Formula: cum_resp_wiz / total_responders * 100. ",
  "KS": "Meaning: KS Kolmogorov-Smirnov statistic. Range: 0-100 (percent scale) or 0-1 (fractional scale). Interpretation: - <20 → Poor discrimination (model barely better than random). - 20-40 → Fair. - 40-60 → Good. - ≥60 → Excellent. - ≥70 → Suspiciously high; likely overfitting or data leakage unless justified by very strong signal. Critical: Report max KS and check across train/validation/test. Fatal if KS is too low (<0.2) or unrealistically high (≥0.7 without strong justification).Formula: KS = max(cum_resp_pct - cum_resp_non_pct). ",
  "cumulative_lift": "Meaning: Cumulative lift = cum_resp_pct / cum_resp_total_pct. Critical: Shows model gain over random. Always cumulative. Fatal if <1 or <2 in top decile.Formula: Lift@k = cum_resp_pct / cum_resp_total_pct. ",
  "decile_wise_lift": "Meaning: Decile-wise lift = cnt_resp / cnt_resp_rndm. Critical: Measures decile-level improvement vs random. Fatal if <1.Formula: cnt_resp / cnt_resp_rndm. "
}

previous

scikitplot.snsx

next

kdsplot

On this page
  • print_labels

This Page

  • Show Source

© Copyright 2024 - 2025 scikit-plots developers (BSD-3 Clause License) 0.4.0.post4+git.20250919.60797d0 2025-09-19T05:57Z.