coco_pipe.viz.interactive.decoding#

Interactive Plotly visualization helpers for decoding result tables.

Functions#

plot_confusion_matrix(result_or_matrix[, model, fold, ...])

Plot an aggregated confusion matrix interactively.

plot_roc_curve(result_or_curve[, model, fold, title, ...])

Plot receiver-operating-characteristic curves interactively.

plot_pr_curve(result_or_curve[, model, fold, title, ...])

Plot precision-recall curves interactively.

plot_calibration_curve(result_or_curve[, model, fold, ...])

Plot calibration reliability curves interactively.

plot_fold_score_dispersion(result_or_scores[, metric, ...])

Plot fold-level scalar score distributions by model and metric interactively.

plot_temporal_score_curve(result_or_scores[, metric, ...])

Plot mean temporal decoding score curves interactively.

plot_temporal_generalization_matrix(result_or_scores)

Plot a train-time by test-time temporal generalization matrix interactively.

plot_temporal_statistical_assessment(result_or_assessment)

Plot temporal statistical assessment results interactively.

plot_null_interval_summary(result_or_assessment[, ...])

Plot observed scalar scores against null interval summaries interactively.

plot_training_history(result_or_artifacts[, model, title])

Plot neural training-history artifacts interactively.

plot_decoding_scores(result[, metric, model, ...])

Plot aggregate scalar decoding scores by model and metric interactively.

plot_model_comparison(result[, metric, reference, ...])

Plot model-comparison score differences interactively.

plot_fit_diagnostics(result[, by, show_warnings, title])

Plot fit-time diagnostics by model or fold interactively.

plot_probability_diagnostics(result[, model, metric, ...])

Plot probability-quality diagnostics interactively.

plot_subject_diagnostics(result[, unit, metric, ...])

Plot per-unit prediction accuracy diagnostics interactively.

plot_group_summary(result[, group, metric, model, title])

Plot group-level prediction accuracy summaries interactively.

plot_regression_diagnostics(result[, model, fold, title])

Plot regression prediction diagnostics interactively.

plot_search_results(result[, model, top_n, title])

Plot compact hyperparameter-search results interactively.

plot_feature_stability(result[, model, top_n, title])

Plot feature-selection stability interactively.

plot_feature_scores(result[, model, top_n, title])

Plot univariate feature-selector scores interactively.

plot_feature_importance(result[, model, top_n, ...])

Plot ranked feature importances interactively.

Module Contents#

coco_pipe.viz.interactive.decoding.plot_confusion_matrix(result_or_matrix, model=None, fold=None, title=None)#

Plot an aggregated confusion matrix interactively.

Parameters:
  • result_or_matrix (Any) – Experiment result with get_confusion_matrices() or a tidy DataFrame containing TrueLabel, PredictedLabel, and Value.

  • model (str | None) – Optional model name used to filter rows before aggregation.

  • fold (int | None) – Optional fold index used to filter rows before aggregation.

  • title (str | None) – Optional figure title. Defaults to "Confusion Matrix".

Returns:

Interactive confusion matrix heatmap.

Return type:

plotly.graph_objects.Figure

See also

coco_pipe.viz.decoding.plot_confusion_matrix

Static Matplotlib version.

plot_probability_diagnostics

Probability quality diagnostics for classifier output.

plot_calibration_curve

Calibration reliability curve for probability estimates.

plot_roc_curve

ROC curve complementing confusion matrix analysis.

Examples

>>> import pandas as pd
>>> from coco_pipe.viz.interactive import decoding as viz
>>> df = pd.DataFrame(
...     {
...         "TrueLabel": ["A", "B", "A"],
...         "PredictedLabel": ["A", "B", "B"],
...         "Value": [5, 3, 2],
...     }
... )
>>> fig = viz.plot_confusion_matrix(df)
coco_pipe.viz.interactive.decoding.plot_roc_curve(result_or_curve, model=None, fold=None, title=None, mean_only=False)#

Plot receiver-operating-characteristic curves interactively.

Parameters:
  • result_or_curve (Any) – Experiment result with get_roc_curve() or a DataFrame containing Model, FPR, and TPR.

  • model (str | None) – Optional model name to display.

  • fold (int | None) – Optional fold index to display.

  • title (str | None) – Optional figure title. Defaults to "ROC Curve".

  • mean_only (bool) – If True, interpolate fold curves onto a common grid and draw the mean curve with a standard-deviation band.

Returns:

Interactive ROC curve figure.

Return type:

plotly.graph_objects.Figure

See also

coco_pipe.viz.decoding.plot_roc_curve

Static Matplotlib version.

plot_pr_curve

Precision-recall curve for imbalanced-class problems.

plot_calibration_curve

Calibration reliability curve.

plot_confusion_matrix

Confusion matrix at a fixed operating point.

Examples

>>> import pandas as pd
>>> from coco_pipe.viz.interactive import decoding as viz
>>> df = pd.DataFrame(
...     {"Model": ["SVM", "SVM"], "FPR": [0.0, 1.0], "TPR": [0.0, 1.0]}
... )
>>> fig = viz.plot_roc_curve(df)
coco_pipe.viz.interactive.decoding.plot_pr_curve(result_or_curve, model=None, fold=None, title=None, mean_only=False)#

Plot precision-recall curves interactively.

Parameters:
  • result_or_curve (Any) – Experiment result with get_pr_curve() or a DataFrame containing Model, Recall, and Precision.

  • model (str | None) – Optional model name to display.

  • fold (int | None) – Optional fold index to display.

  • title (str | None) – Optional figure title. Defaults to "Precision-Recall Curve".

  • mean_only (bool) – If True, draw the mean curve with a standard-deviation band.

Returns:

Interactive precision-recall curve figure.

Return type:

plotly.graph_objects.Figure

See also

coco_pipe.viz.decoding.plot_pr_curve

Static Matplotlib version.

plot_roc_curve

ROC curve for alternative threshold analysis.

plot_calibration_curve

Calibration reliability curve.

plot_fold_score_dispersion

Fold-level score variability.

Examples

>>> import pandas as pd
>>> from coco_pipe.viz.interactive import decoding as viz
>>> df = pd.DataFrame(
...     {"Model": ["SVM", "SVM"], "Recall": [0.0, 1.0], "Precision": [1.0, 0.5]}
... )
>>> fig = viz.plot_pr_curve(df)
coco_pipe.viz.interactive.decoding.plot_calibration_curve(result_or_curve, model=None, fold=None, title=None, mean_only=False)#

Plot calibration reliability curves interactively.

Parameters:
  • result_or_curve (Any) – Experiment result with get_calibration_curve() or a DataFrame containing Model, MeanPredictedProbability, and FractionPositive.

  • model (str | None) – Optional model name to display.

  • fold (int | None) – Optional fold index to display.

  • title (str | None) – Optional figure title. Defaults to "Calibration Curve".

  • mean_only (bool) – If True, draw the mean curve with a standard-deviation band.

Returns:

Interactive calibration curve figure.

Return type:

plotly.graph_objects.Figure

See also

coco_pipe.viz.decoding.plot_calibration_curve

Static Matplotlib version.

plot_roc_curve

ROC curve complementing calibration analysis.

plot_pr_curve

Precision-recall curve for classifier evaluation.

plot_probability_diagnostics

Scalar probability-quality metrics.

Examples

>>> import pandas as pd
>>> from coco_pipe.viz.interactive import decoding as viz
>>> df = pd.DataFrame(
...     {
...         "Model": ["LR", "LR"],
...         "MeanPredictedProbability": [0.2, 0.8],
...         "FractionPositive": [0.15, 0.85],
...     }
... )
>>> fig = viz.plot_calibration_curve(df)
coco_pipe.viz.interactive.decoding.plot_fold_score_dispersion(result_or_scores, metric=None, model=None, title=None)#

Plot fold-level scalar score distributions by model and metric interactively.

Parameters:
  • result_or_scores (Any) – Experiment result with get_detailed_scores() or a detailed score DataFrame containing scalar Value rows.

  • metric (str | None) – Optional metric name used to filter scores.

  • model (str | None) – Optional model name used to filter scores.

  • title (str | None) – Optional figure title. Defaults to "Fold Score Dispersion".

Returns:

Interactive fold score box plot.

Return type:

plotly.graph_objects.Figure

See also

coco_pipe.viz.decoding.plot_fold_score_dispersion

Static Matplotlib version.

plot_decoding_scores

Aggregate score bar chart with error bars.

plot_model_comparison

Pairwise score-difference comparison.

Examples

>>> import pandas as pd
>>> from coco_pipe.viz.interactive import decoding as viz
>>> df = pd.DataFrame(
...     {
...         "Model": ["SVM"] * 4,
...         "Fold": [0, 1, 2, 3],
...         "Metric": ["accuracy"] * 4,
...         "Value": [0.8, 0.85, 0.82, 0.78],
...     }
... )
>>> fig = viz.plot_fold_score_dispersion(df)
coco_pipe.viz.interactive.decoding.plot_temporal_score_curve(result_or_scores, metric=None, model=None, title=None, colors=None, smooth_window=None)#

Plot mean temporal decoding score curves interactively.

Parameters:
  • result_or_scores (Any) – Experiment result with get_temporal_score_summary() or a DataFrame containing Model, Metric, Time, and Mean.

  • metric (str | None) – Optional metric name used to filter temporal scores.

  • model (str | None) – Optional model name used to filter temporal scores.

  • title (str | None) – Optional figure title. Defaults to "Temporal Decoding Value".

  • colors (dict | None) – Optional dict mapping model names to CSS color strings.

  • smooth_window (int | None) – Optional integer window size for smoothing the curves using a centered moving average.

Returns:

Interactive temporal score curve figure.

Return type:

plotly.graph_objects.Figure

See also

coco_pipe.viz.decoding.plot_temporal_score_curve

Static Matplotlib version.

plot_temporal_generalization_matrix

Train-time by test-time generalization matrix.

plot_temporal_statistical_assessment

Statistical significance overlay on temporal curves.

plot_null_interval_summary

Null permutation interval for scalar score comparison.

Examples

>>> import pandas as pd
>>> from coco_pipe.viz.interactive import decoding as viz
>>> df = pd.DataFrame(
...     {
...         "Model": ["SVM"] * 3,
...         "Metric": ["accuracy"] * 3,
...         "Time": [0.1, 0.2, 0.3],
...         "Mean": [0.6, 0.75, 0.7],
...     }
... )
>>> fig = viz.plot_temporal_score_curve(df)
coco_pipe.viz.interactive.decoding.plot_temporal_generalization_matrix(result_or_scores, metric=None, model=None, title=None)#

Plot a train-time by test-time temporal generalization matrix interactively.

Parameters:
  • result_or_scores (Any) – Experiment result with get_temporal_score_summary() or a DataFrame containing Model, Metric, TrainTime, TestTime, and Mean.

  • metric (str | None) – Optional metric name.

  • model (str | None) – Optional model name.

  • title (str | None) – Optional figure title. Defaults to "<model> / <metric>".

Returns:

Interactive generalization matrix heatmap.

Return type:

plotly.graph_objects.Figure

See also

coco_pipe.viz.decoding.plot_temporal_generalization_matrix

Static Matplotlib version.

plot_temporal_score_curve

Mean temporal score curve across time.

plot_temporal_statistical_assessment

Statistical assessment of temporal decoding.

plot_null_interval_summary

Null permutation interval summary.

Examples

>>> import pandas as pd
>>> from coco_pipe.viz.interactive import decoding as viz
>>> df = pd.DataFrame(
...     {
...         "Model": ["SVM"] * 4,
...         "Metric": ["accuracy"] * 4,
...         "TrainTime": [0.1, 0.1, 0.2, 0.2],
...         "TestTime": [0.1, 0.2, 0.1, 0.2],
...         "Mean": [0.8, 0.6, 0.65, 0.82],
...     }
... )
>>> fig = viz.plot_temporal_generalization_matrix(df)
coco_pipe.viz.interactive.decoding.plot_temporal_statistical_assessment(result_or_assessment, metric=None, model=None, title=None)#

Plot temporal statistical assessment results interactively.

Parameters:
  • result_or_assessment (Any) – Experiment result with get_statistical_assessment() or a DataFrame containing Model, Metric, Observed, and Time.

  • metric (str | None) – Optional metric name.

  • model (str | None) – Optional model name.

  • title (str | None) – Optional figure title.

Returns:

Interactive temporal statistical assessment figure.

Return type:

plotly.graph_objects.Figure

See also

coco_pipe.viz.decoding.plot_temporal_statistical_assessment

Static Matplotlib version.

plot_temporal_score_curve

Mean temporal decoding score curve.

plot_null_interval_summary

Scalar null interval summary across models.

plot_temporal_generalization_matrix

Full train-by-test generalization matrix.

Examples

>>> import pandas as pd
>>> from coco_pipe.viz.interactive import decoding as viz
>>> df = pd.DataFrame(
...     {
...         "Model": ["SVM"] * 3,
...         "Metric": ["accuracy"] * 3,
...         "Observed": [0.6, 0.75, 0.7],
...         "Time": [0.1, 0.2, 0.3],
...     }
... )
>>> fig = viz.plot_temporal_statistical_assessment(df)
coco_pipe.viz.interactive.decoding.plot_null_interval_summary(result_or_assessment, metric=None, model=None, title=None)#

Plot observed scalar scores against null interval summaries interactively.

Parameters:
  • result_or_assessment (Any) – Experiment result with get_statistical_assessment() or a DataFrame containing Model, Metric, and Observed.

  • metric (str | None) – Optional metric name used to filter assessment rows.

  • model (str | None) – Optional model name used to filter assessment rows.

  • title (str | None) – Optional figure title. Defaults to "Null Interval Summary".

Returns:

Interactive null interval summary figure.

Return type:

plotly.graph_objects.Figure

See also

coco_pipe.viz.decoding.plot_null_interval_summary

Static Matplotlib version.

plot_temporal_statistical_assessment

Temporal null band overlaid on the score curve.

plot_temporal_score_curve

Mean temporal decoding score curve.

plot_decoding_scores

Aggregate score bar chart without null bands.

Examples

>>> import pandas as pd
>>> from coco_pipe.viz.interactive import decoding as viz
>>> df = pd.DataFrame(
...     {
...         "Model": ["SVM", "LDA"],
...         "Metric": ["accuracy", "accuracy"],
...         "Observed": [0.82, 0.74],
...     }
... )
>>> fig = viz.plot_null_interval_summary(df)
coco_pipe.viz.interactive.decoding.plot_training_history(result_or_artifacts, model=None, title=None)#

Plot neural training-history artifacts interactively.

Parameters:
  • result_or_artifacts (Any) – Experiment result with get_model_artifacts() or an artifact DataFrame containing Model, Key, ArtifactType, and Value.

  • model (str | None) – Optional model name used to filter artifacts.

  • title (str | None) – Optional figure title. Defaults to "Training History".

Returns:

Interactive training history line chart.

Return type:

plotly.graph_objects.Figure

See also

coco_pipe.viz.decoding.plot_training_history

Static Matplotlib version.

plot_fit_diagnostics

Fit-time diagnostics including total training time.

plot_decoding_scores

Final evaluation scores after training.

Examples

>>> import pandas as pd
>>> from coco_pipe.viz.interactive import decoding as viz
>>> df = pd.DataFrame(
...     {
...         "Model": ["CNN"],
...         "Key": ["training"],
...         "ArtifactType": ["history"],
...         "Value": [[{"epoch": 0, "loss": 1.0}, {"epoch": 1, "loss": 0.5}]],
...     }
... )
>>> fig = viz.plot_training_history(df)
coco_pipe.viz.interactive.decoding.plot_decoding_scores(result, metric=None, model=None, aggregate='mean', title=None)#

Plot aggregate scalar decoding scores by model and metric interactively.

Parameters:
  • result (Any) – Experiment result with get_detailed_scores() or a detailed score DataFrame containing scalar Value rows.

  • metric (str | None) – Optional metric name used to filter scores.

  • model (str | None) – Optional model name used to filter scores.

  • aggregate (Literal['mean', 'median']) – Summary statistic: "mean" or "median".

  • title (str | None) – Optional figure title. Defaults to "Decoding Scores".

Returns:

Interactive decoding score bar chart with error bars.

Return type:

plotly.graph_objects.Figure

See also

coco_pipe.viz.decoding.plot_decoding_scores

Static Matplotlib version.

plot_fold_score_dispersion

Per-fold score distribution box plot.

plot_model_comparison

Pairwise model score-difference figure.

plot_null_interval_summary

Observed scores against null permutation intervals.

Examples

>>> import pandas as pd
>>> from coco_pipe.viz.interactive import decoding as viz
>>> df = pd.DataFrame(
...     {
...         "Model": ["SVM"] * 3,
...         "Fold": [0, 1, 2],
...         "Metric": ["accuracy"] * 3,
...         "Value": [0.8, 0.85, 0.82],
...     }
... )
>>> fig = viz.plot_decoding_scores(df)
coco_pipe.viz.interactive.decoding.plot_model_comparison(result, metric='accuracy', reference=None, paired=True, title=None)#

Plot model-comparison score differences interactively.

Parameters:
  • result (Any) – Experiment result or a comparison DataFrame with a Difference column. Optional ModelA, ModelB, CILower, CIUpper columns are also used when present.

  • metric (str) – Metric used when computing comparisons.

  • reference (str | None) – Optional reference model for paired comparisons.

  • paired (bool) – If True and reference is provided, use compare_models_paired.

  • title (str | None) – Optional figure title.

Returns:

Interactive model comparison scatter figure.

Return type:

plotly.graph_objects.Figure

See also

coco_pipe.viz.decoding.plot_model_comparison

Static Matplotlib version.

plot_decoding_scores

Aggregate score bar chart per model.

plot_fold_score_dispersion

Per-fold score variability.

Examples

>>> import pandas as pd
>>> from coco_pipe.viz.interactive import decoding as viz
>>> df = pd.DataFrame({"Difference": [0.05, -0.02, 0.08]})
>>> fig = viz.plot_model_comparison(df)
coco_pipe.viz.interactive.decoding.plot_fit_diagnostics(result, by='Model', show_warnings=True, title=None)#

Plot fit-time diagnostics by model or fold interactively.

Parameters:
  • result (Any) – Experiment result with get_fit_diagnostics() or a diagnostics DataFrame containing TotalTime plus the selected by column.

  • by (Literal['Model', 'Fold']) – Column used for grouping, usually "Model" or "Fold".

  • show_warnings (bool) – If True, annotate the figure with the warning count when present.

  • title (str | None) – Optional figure title. Defaults to "Fit Diagnostics".

Returns:

Interactive fit diagnostics bar chart.

Return type:

plotly.graph_objects.Figure

See also

coco_pipe.viz.decoding.plot_fit_diagnostics

Static Matplotlib version.

plot_training_history

Epoch-level training metrics for neural models.

plot_search_results

Hyperparameter-search results sorted by rank.

Examples

>>> import pandas as pd
>>> from coco_pipe.viz.interactive import decoding as viz
>>> df = pd.DataFrame(
...     {"Model": ["SVM", "LDA"], "Fold": [0, 0], "TotalTime": [1.2, 0.4]}
... )
>>> fig = viz.plot_fit_diagnostics(df)
coco_pipe.viz.interactive.decoding.plot_probability_diagnostics(result, model=None, metric=None, title=None)#

Plot probability-quality diagnostics interactively.

Parameters:
  • result (Any) – Experiment result with get_probability_diagnostics() or a DataFrame containing Model, Metric, and Value.

  • model (str | None) – Optional model name used to filter diagnostics.

  • metric (str | None) – Optional diagnostic metric used to filter rows.

  • title (str | None) – Optional figure title. Defaults to "Probability Diagnostics".

Returns:

Interactive probability diagnostics bar chart.

Return type:

plotly.graph_objects.Figure

See also

coco_pipe.viz.decoding.plot_probability_diagnostics

Static Matplotlib version.

plot_confusion_matrix

Confusion matrix for a complementary classifier view.

plot_calibration_curve

Reliability curve for probability estimates.

Examples

>>> import pandas as pd
>>> from coco_pipe.viz.interactive import decoding as viz
>>> df = pd.DataFrame(
...     {
...         "Model": ["LR", "LR"],
...         "Metric": ["brier_score", "log_loss"],
...         "Value": [0.12, 0.35],
...     }
... )
>>> fig = viz.plot_probability_diagnostics(df)
coco_pipe.viz.interactive.decoding.plot_subject_diagnostics(result, unit='Subject', metric='accuracy', model=None, title=None)#

Plot per-unit prediction accuracy diagnostics interactively.

Parameters:
  • result (Any) – Experiment result with get_predictions() or a prediction DataFrame containing Model, y_true, y_pred, and the selected unit column.

  • unit (str) – Metadata column used as the unit of aggregation.

  • metric (str) – Metric to compute. Currently only "accuracy" is supported.

  • model (str | None) – Optional model name used to filter predictions.

  • title (str | None) – Optional figure title. Defaults to "<unit> Diagnostics".

Returns:

Interactive subject diagnostics horizontal bar chart.

Return type:

plotly.graph_objects.Figure

See also

coco_pipe.viz.decoding.plot_subject_diagnostics

Static Matplotlib version.

plot_group_summary

Group-level accuracy summary with fold-level box plots.

plot_regression_diagnostics

Observed vs predicted scatter for regression models.

plot_fit_diagnostics

Per-model or per-fold timing diagnostics.

Examples

>>> import pandas as pd
>>> from coco_pipe.viz.interactive import decoding as viz
>>> df = pd.DataFrame(
...     {
...         "Model": ["SVM"] * 4,
...         "Subject": ["S1", "S1", "S2", "S2"],
...         "y_true": ["A", "B", "A", "B"],
...         "y_pred": ["A", "B", "A", "A"],
...     }
... )
>>> fig = viz.plot_subject_diagnostics(df)
coco_pipe.viz.interactive.decoding.plot_group_summary(result, group='Group', metric='accuracy', model=None, title=None)#

Plot group-level prediction accuracy summaries interactively.

Parameters:
  • result (Any) – Experiment result with get_predictions() or a prediction DataFrame containing Model, Fold, y_true, y_pred, and the selected grouping column.

  • group (str) – Prediction metadata column used to define groups.

  • metric (str) – Metric to compute. Currently only "accuracy" is supported.

  • model (str | None) – Optional model name used to filter predictions.

  • title (str | None) – Optional figure title. Defaults to "Group Summary".

Returns:

Interactive group summary box plot.

Return type:

plotly.graph_objects.Figure

See also

coco_pipe.viz.decoding.plot_group_summary

Static Matplotlib version.

plot_subject_diagnostics

Per-subject accuracy horizontal bar chart.

plot_regression_diagnostics

Observed vs predicted for regression outputs.

plot_fold_score_dispersion

Fold-level score variability per model.

Examples

>>> import pandas as pd
>>> from coco_pipe.viz.interactive import decoding as viz
>>> df = pd.DataFrame(
...     {
...         "Model": ["SVM"] * 4,
...         "Group": ["G1", "G1", "G2", "G2"],
...         "Fold": [0, 1, 0, 1],
...         "y_true": ["A", "B", "A", "B"],
...         "y_pred": ["A", "A", "A", "B"],
...     }
... )
>>> fig = viz.plot_group_summary(df)
coco_pipe.viz.interactive.decoding.plot_regression_diagnostics(result, model=None, fold=None, title=None)#

Plot regression prediction diagnostics interactively.

Parameters:
  • result (Any) – Experiment result with get_predictions() or a prediction DataFrame containing numeric y_true and y_pred columns.

  • model (str | None) – Optional model name used to filter predictions.

  • fold (int | None) – Optional fold index used to filter predictions.

  • title (str | None) – Optional figure title. Defaults to "Regression Diagnostics".

Returns:

Interactive observed vs predicted scatter figure.

Return type:

plotly.graph_objects.Figure

See also

coco_pipe.viz.decoding.plot_regression_diagnostics

Static Matplotlib version.

plot_subject_diagnostics

Per-subject accuracy for classification models.

plot_group_summary

Group-level accuracy with fold-level variability.

plot_fit_diagnostics

Fit-time and warning diagnostics.

Examples

>>> import pandas as pd
>>> from coco_pipe.viz.interactive import decoding as viz
>>> df = pd.DataFrame(
...     {"y_true": [1.0, 2.0, 3.0, 4.0], "y_pred": [1.1, 1.9, 3.2, 3.8]}
... )
>>> fig = viz.plot_regression_diagnostics(df)
coco_pipe.viz.interactive.decoding.plot_search_results(result, model=None, top_n=None, title=None)#

Plot compact hyperparameter-search results interactively.

Parameters:
  • result (Any) – Experiment result with get_search_results() or a search-results DataFrame containing Model, Rank, and MeanTestScore.

  • model (str | None) – Optional model name used to filter search rows.

  • top_n (int | None) – Optional positive number of top-ranked candidates to keep per model.

  • title (str | None) – Optional figure title. Defaults to "Search Results".

Returns:

Interactive search results bar chart.

Return type:

plotly.graph_objects.Figure

See also

coco_pipe.viz.decoding.plot_search_results

Static Matplotlib version.

plot_fit_diagnostics

Fit-time diagnostics complementing search analysis.

plot_decoding_scores

Final evaluation scores after hyperparameter selection.

Examples

>>> import pandas as pd
>>> from coco_pipe.viz.interactive import decoding as viz
>>> df = pd.DataFrame(
...     {
...         "Model": ["SVM"] * 3,
...         "Rank": [1, 2, 3],
...         "MeanTestScore": [0.88, 0.85, 0.82],
...     }
... )
>>> fig = viz.plot_search_results(df)
coco_pipe.viz.interactive.decoding.plot_feature_stability(result, model=None, top_n=25, title=None)#

Plot feature-selection stability interactively.

Parameters:
  • result (Any) – Experiment result with get_feature_stability() or a DataFrame containing FeatureName and SelectionFrequency.

  • model (str | None) – Optional model name used to filter feature rows.

  • top_n (int | None) – Optional number of most stable features to display.

  • title (str | None) – Optional figure title. Defaults to "Feature Stability".

Returns:

Interactive feature stability horizontal bar chart.

Return type:

plotly.graph_objects.Figure

See also

coco_pipe.viz.decoding.plot_feature_stability

Static Matplotlib version.

plot_feature_scores

Univariate feature-selector scores.

Examples

>>> import pandas as pd
>>> from coco_pipe.viz.interactive import decoding as viz
>>> df = pd.DataFrame(
...     {"FeatureName": ["F1", "F2", "F3"], "SelectionFrequency": [0.9, 0.6, 0.3]}
... )
>>> fig = viz.plot_feature_stability(df)
coco_pipe.viz.interactive.decoding.plot_feature_scores(result, model=None, top_n=25, title=None)#

Plot univariate feature-selector scores interactively.

Parameters:
  • result (Any) – Experiment result with get_feature_scores() or a feature-score DataFrame containing FeatureName and Score.

  • model (str | None) – Optional model name used to filter feature scores.

  • top_n (int | None) – Optional positive number of highest-scoring features to display.

  • title (str | None) – Optional figure title. Defaults to "Feature Scores".

Returns:

Interactive feature scores horizontal bar chart.

Return type:

plotly.graph_objects.Figure

See also

coco_pipe.viz.decoding.plot_feature_scores

Static Matplotlib version.

plot_feature_stability

Feature-selection stability across folds.

Examples

>>> import pandas as pd
>>> from coco_pipe.viz.interactive import decoding as viz
>>> df = pd.DataFrame(
...     {"FeatureName": ["F1", "F2", "F3"], "Score": [0.72, 0.55, 0.31]}
... )
>>> fig = viz.plot_feature_scores(df)
coco_pipe.viz.interactive.decoding.plot_feature_importance(result, model=None, top_n=25, signed=False, absolute=False, title=None)#

Plot ranked feature importances interactively.

Parameters:
  • result (Any) – Experiment result with get_feature_importances(), a feature importance DataFrame, or a mapping/sequence coercible to a numeric Series. Non-numeric sequences are delegated to the dimensionality reduction feature-importance plot.

  • model (str | None) – Optional model name used to filter importances.

  • top_n (int | None) – Optional number of highest-magnitude features to display.

  • signed (bool) – If True, color bars by sign (diverging) instead of a single color.

  • absolute (bool) – If True, rank and display absolute importance values.

  • title (str | None) – Optional figure title. Defaults to "Feature Importance".

Returns:

Interactive feature-importance horizontal bar chart.

Return type:

plotly.graph_objects.Figure

See also

coco_pipe.viz.decoding.plot_feature_importance

Static Matplotlib version.

plot_feature_stability

Feature-selection stability across folds.

plot_feature_scores

Univariate feature-selector scores.

Examples

>>> import pandas as pd
>>> from coco_pipe.viz.interactive import decoding as viz
>>> df = pd.DataFrame(
...     {
...         "Model": ["SVM"] * 3,
...         "FeatureName": ["f1", "f2", "f3"],
...         "Mean": [0.5, 0.3, 0.1],
...     }
... )
>>> fig = viz.plot_feature_importance(df)