scikitplot.api#

scikit-plots Functional API

User guide. See the Metric Perfomance section for further details.

Plot a PCA representation#

Visualizations for matrix decomposition algorithms.

The decomposition module includes plots built specifically for scikit-learn estimators that are used for dimensionality reduction e.g. PCA.

You can use your own estimators, but these plots assume specific properties shared by scikit-learn estimators. The specific requirements are documented per function.

User guide. See the Decomposition section for further details.

decomposition.plot_pca_2d_projection

Plots the 2-dimensional projection of PCA on a given dataset.

decomposition.plot_pca_component_variance

Plots PCA components' explained variance ratios.

Plot Estimators (model) object instances#

Visualizations for model’s decision-making process.

The estimators module includes plots for machine learning evaluation estimators e.g. regressor, cluster, etc.

User guide. See the Estimators section for further details.

estimators.plot_feature_importances

Generates a plot of a sklearn model's feature importances.

estimators.plot_learning_curve

Generates a plot of the train and test learning curves for a classifier.

estimators.plot_elbow

Plot the elbow curve for different values of K in KMeans clustering.

Plot model evaluation metrics#

Visualizations for model’s performance-score metrics.

The metrics module includes plots for machine learning evaluation metrics e.g. confusion matrix, silhouette scores, etc.

User guide. See the Metrics section for further details.

metrics.plot_residuals_distribution

Plot residuals and fit various distributions to assess their goodness of fit.

metrics.plot_classifier_eval

Generates various evaluation plots for a classifier, including confusion matrix, precision-recall curve, and ROC curve.

metrics.plot_confusion_matrix

Generates a confusion matrix plot from predictions and true labels.

metrics.plot_precision_recall

Generates the Precision-Recall AUC Curves from labels and predicted scores/probabilities.

metrics.plot_roc

Generates the ROC AUC curves from labels and predicted scores/probabilities.

metrics.plot_calibration

Plot calibration curves for a set of classifier probability estimates.

metrics.plot_silhouette

Plots silhouette analysis of clusters provided.

API Development Utilities#

Developer guide. See the Contribute section for further details.

_utils.validate_labels

Validates the labels passed into arguments such as true_labels or pred_labels in functions like plot_confusion_matrix.

_utils.cumulative_gain_curve

Generate the data points necessary to plot the Cumulative Gain curve for binary classification tasks.

_utils.binary_ks_curve

Generate the data points necessary to plot the Kolmogorov-Smirnov (KS) curve for binary classification tasks.

_utils.validate_plotting_kwargs

Validate the provided axes and figure or create new ones if needed.

_utils.save_figure

Combine multiple figures into a single image, save it (if specified), and return the combined figure.

_utils.save_plot

Save the current plot if the environment variable to save plots is enabled.