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
    • 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
    • annoy
    • Annoy
    • AnnoyIndex
    • _astropy
    • stats
    • _f2py
    • get_include
    • _numcpp
  • scikitplot.config
    • __bibtex__
    • __citation__
  • scikitplot.exceptions
    • ModuleDeprecationWarning
    • ScikitplotException
    • VisibleDeprecationWarning
  • scikitplot.experimental
    • scikitplot.experimental.enable_annoyknn_imputer
    • pipeline
    • 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
    • _seaborn
    • _sphinxext
    • _tweedie
    • array_api_compat
    • array_api_extra
  • scikitplot.impute
    • AnnoyKNNImputer
  • scikitplot.kds
    • print_labels
    • decile_table
    • plot_cumulative_gain
    • plot_lift
    • plot_lift_decile_wise
    • plot_ks_statistic
    • report
  • scikitplot.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.modelplotpy
    • ModelPlotPy
    • plot_response
    • plot_cumresponse
    • plot_cumlift
    • plot_cumgains
    • plot_all
    • plot_costsrevs
    • plot_profit
    • plot_roi
  • scikitplot.nc
    • dot
  • scikitplot.preprocessing
    • GetDummies
  • scikitplot.snsx
    • aucplot
    • evalplot
    • decileplot
    • print_labels
  • 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_true",
    "cnt_resp_false",
    "cnt_resp_rndm_true",
    "cnt_resp_wiz_true",
    "rate_resp",  # (alias to decile_wise_response, decile_wise_gain)
    "rate_resp_pct",  # (alias to decile_wise_response, decile_wise_gain %)
    "overall_rate",
    "cum_resp_total",
    "cum_resp_total_pct",
    "cum_resp_true",  #  (alias to cumulative_gain)
    "cum_resp_true_pct",  #  (alias to cumulative_gain %)
    "cum_resp_false",
    "cum_resp_false_pct",
    "cum_resp_rndm_true",
    "cum_resp_rndm_true_pct",
    "cum_resp_wiz_true",
    "cum_resp_wiz_true_pct",
    "cumulative_lift",
    "decile_wise_lift",
    "KS",
]
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

decileplot

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 based on predicted probabilities (1 = highest probability). Critical: Ensure data is sorted descending by model score; top deciles should capture the majority of positives. Formula: Assign samples to k quantiles (e.g., 10 deciles) based on model score.",
  "prob_min": "Meaning: Minimum predicted probability within the decile. Critical: Indicates model calibration; values too close to prob_max suggest poor separation. Formula: min(score in decile).",
  "prob_max": "Meaning: Maximum predicted probability within the decile. Critical: Checks separation; overlap with lower deciles indicates poor discrimination. Formula: max(score in decile).",
  "prob_avg": "Meaning: Average predicted probability within the decile. Critical: Useful for calibration checks; should decrease monotonically across deciles. Formula: mean(score in decile).",
  "cnt_resp_true": "Meaning: Actual positives/responders in the decile. Critical: Should never exceed cnt_resp_wiz_true; flat counts across deciles indicate a weak or non-discriminative model. Formula: sum(y_true = 1 in decile).",
  "cnt_resp_false": "Meaning: Actual negatives/non-responders in the decile. Critical: Used in KS/statistical calculations; too many negatives in top deciles is a warning. Formula: cnt_resp_total - cnt_resp_true.",
  "cnt_resp_total": "Meaning: Total samples in the decile (positives + negatives). Critical: Denominator for rate_resp and cumulative % calculations; decile imbalance can distort lift/gain. Formula: count(samples in decile).",
  "cnt_resp_rndm_true": "Meaning: Expected positives in the decile under a random model. Critical: Baseline for lift/gain comparison; fatal if model barely exceeds random. Formula: total_positives / n_deciles.",
  "cnt_resp_wiz_true": "Meaning: Ideal/maximum possible positives if the model were perfect. Critical: Must always be ≥ cnt_resp_true; NaN or extremely low values indicate data issues. Formula: allocate top positives directly to highest scoring deciles.",
  "rate_resp": "Meaning: Decile-level response rate (alias: decile_wise_response, decile_wise_gain). Critical: Measures decile quality; early deciles should outperform later ones. Formula: rate_resp = cnt_resp_true / cnt_resp_total.",
  "overall_rate": "Meaning: Overall response rate across the dataset; serves as the baseline probability of a positive. Critical: Used as the denominator in decile-wise lift; essential to assess improvement vs random. Formula: overall_rate = sum(cnt_resp_true) / sum(cnt_resp_total) (fraction or %).",
  "cum_resp_true": "Meaning: Cumulative number of positives captured up to the current decile (alias: cumulative_gain). Critical: Should increase monotonically; maximum = total responders. Flat curve indicates weak model. Formula: Σ cnt_resp_true (≤ current decile).",
  "cum_resp_true_pct": "Meaning: Cumulative % of positives captured = cum_resp_true / total_responders * 100. Critical: Used for lift/gain curves; should always be ≥ model baseline. Formula: cum_resp_true / total_responders * 100.",
  "cum_resp_false": "Meaning: Cumulative number of negatives captured up to the current decile. Critical: Used for KS/statistical calculations; dominance in early deciles is undesirable. Formula: Σ cnt_resp_false (≤ current decile).",
  "cum_resp_false_pct": "Meaning: Cumulative % of negatives captured = cum_resp_false / total_nonresponders * 100. Critical: Should differ from cum_resp_true_pct; nearly equal curves indicate model failure. Formula: cum_resp_false / total_nonresponders * 100.",
  "cum_resp_total": "Meaning: Cumulative total samples up to the current decile. Critical: Tracks population coverage for lift/gain charts. Formula: Σ cnt_resp_total (≤ current decile).",
  "cum_resp_total_pct": "Meaning: Cumulative % of total population covered. Critical: X-axis for lift/gain curves; check decile balance. Formula: cum_resp_total / total_samples * 100.",
  "cum_resp_rndm_true": "Meaning: Cumulative expected positives if randomly assigned. Critical: Baseline for cumulative lift; fatal if model ≈ random curve. Formula: Σ cnt_resp_rndm_true (≤ current decile).",
  "cum_resp_rndm_true_pct": "Meaning: Cumulative % of expected positives under random = cum_resp_rndm_true / total_responders * 100. Critical: Baseline curve is linear from (0,0) to (100,100); model curve must exceed this. Formula: cum_resp_rndm_true / total_responders * 100.",
  "cum_resp_wiz_true": "Meaning: Cumulative ideal/maximum possible positives. Critical: Must always be ≥ model values; never NaN. Formula: Σ cnt_resp_wiz_true (≤ current decile).",
  "cum_resp_wiz_true_pct": "Meaning: % cumulative ideal positives = cum_resp_wiz_true / total_responders * 100. Critical: Wizard benchmark for lift/gain curves; gaps indicate model weakness. Formula: cum_resp_wiz_true / total_responders * 100.",
  "cumulative_lift": "Meaning: Empirical discriminative power; shows cumulative improvement vs random. Critical: Always cumulative; should exceed 1 (or ≥2 in top decile). Formula: cumulative_lift = cum_resp_true_pct / cum_resp_total_pct.",
  "decile_wise_lift": "Meaning: Improvement factor for individual deciles; shows how much better each decile performs vs random. Critical: Fatal if <1. Early deciles should show highest lift. Formula: decile_wise_lift = cnt_resp_true / cnt_resp_rndm_true.",
  "KS": "Meaning: Peak discriminative power (scalar) extracted from cumulative gain curves; maximum distance between cumulative distributions of positives and negatives. Range: 0-1 (fraction) or 0-100 (percent). Interpretation: - <0.2 → Poor discrimination - 0.2-0.4 → Fair - 0.4-0.6 → Good - ≥0.6 → Excellent - ≥0.7 → Suspiciously high (possible overfitting or leakage). Critical: Report across train/validation/test; ensure top deciles dominate appropriately. Formula: KS = max(cum_resp_true_pct - cum_resp_false_pct) (sorted descending by model score)."
}

previous

decileplot

next

scikitplot.stats

On this page
  • print_labels

This Page

  • Show Source

© Copyright 2024 - 2025 scikit-plots developers (BSD-3 Clause License) 0.5.dev0+git.20251029.e9b8268 2025-10-29T10:30Z.