Reusable visualizations for inspecting, comparing, and explaining trained machine-learning models.
ML VizKit provides high-level Python functions for common machine-learning visualizations. It works with trained models, predictions, and experiment results produced by libraries such as scikit-learn.
The package does not train models, select features, choose algorithms, or make analytical decisions.
- Accept already-trained models, predictions, or completed experiment results.
- Reuse established visualization primitives from scikit-learn when they exist.
- Add small higher-level visualizations where the underlying libraries do not.
- Return Matplotlib
Axesobjects. - Never call
plt.show(). - Keep analytical choices visible to the caller.
- Keep the implementation readable and replaceable.
uv add ml-vizkitfrom ml_vizkit import show_confusion_matrix
ax = show_confusion_matrix(y_test, y_pred)
ax.set_title("Penguin Species Classification")The caller controls display and composition. In a script, for example:
import matplotlib.pyplot as plt
ax = show_confusion_matrix(y_test, y_pred)
plt.show()Classification:
show_decision_boundary()show_confusion_matrix()show_prediction_errors()show_class_distribution()
Regression:
show_actual_vs_predicted()show_residuals()
Model inspection:
show_feature_importance()
Experiment inspection:
show_train_test_split()compare_splits()compare_models()
Output:
save_chart()
from ml_vizkit import show_confusion_matrix
ax = show_confusion_matrix(
y_test,
y_pred,
)from ml_vizkit import show_actual_vs_predicted
ax = show_actual_vs_predicted(
y_test,
y_pred,
)from ml_vizkit import show_feature_importance
ax = show_feature_importance(
model,
feature_names,
)from ml_vizkit import save_chart, show_confusion_matrix
ax = show_confusion_matrix(
y_test,
y_pred,
)
save_chart(
ax,
"docs/images/confusion-matrix.png",
)import matplotlib.pyplot as plt
plt.show()Show command reference
Open a machine terminal where you want the project:
git clone https://github.com/analytics-toolworks/ml-vizkit
cd ml-vizkit
code .uv self update
uv python pin 3.14
uv python install
uv lock --upgrade
uv sync
uv run pre-commit install
uv run pre-commit autoupdate
git add -A
uv run pre-commit run --all-files
# repeat if changes were made
uv run pre-commit run --all-files
# types, tests, docs
uv run ty check
uv run python -m pytest
uv run python -m zensical build
# save progress
git add -A
git commit -m "update"
git push -u origin main