Skip to main content

Poniard

Poniard logo

A poniard /ˈpɒnjərd/ or poignard (Fr.) is a long, lightweight thrusting knife (Wikipedia).

Poniard is a scikit-learn companion library that streamlines the process of fitting different machine learning models and comparing them.

It can be used to provide quick answers to questions like these:

  • What is the reasonable range of scores for this task?
  • Is a simple and explainable linear model enough or should I work with forests and gradient boosters?
  • Are the features good enough as is or should I work on feature engineering?
  • How much can hyperparameter tuning improve metrics?
  • Do I need to work on a custom preprocessing strategy?

This is not meant to be an end-to-end solution, and you should keep working on your models after you are done with Poniard.

Installation

pip install poniard

With plotting support:

pip install poniard[plot]

Quick start

from sklearn.datasets import make_classification
from poniard import PoniardClassifier

X, y = make_classification(n_samples=200, n_features=10, random_state=42)

clf = PoniardClassifier()
clf.setup(X, y)    # configure: type inference, preprocessing, pipelines
# optionally: clf.add_estimators(...), clf.reassign_types(...), etc.
clf.fit(X, y)      # cross-validate all estimators
clf.get_results()  # comparison table

Plotting

Plotting is a separate module (requires pip install poniard[plot]):

from poniard.plot import PoniardPlotFactory

plotter = PoniardPlotFactory(X, y, clf)
plotter.metrics()
plotter.roc_curve()
plotter.confusion_matrix("LogisticRegression")
plotter.permutation_importance("LogisticRegression")

Estimator naming

Each estimator gets a name automatically (its class name). You can override with tuple syntax:

# Single of each class → class names
clf = PoniardClassifier(estimators=[LogisticRegression(), SVC()])
# pipelines: {'LogisticRegression': ..., 'SVC': ..., 'DummyClassifier': ...}

# Duplicates → collision handling
clf = PoniardClassifier(estimators=[
    LogisticRegression(max_iter=1000),
    LogisticRegression(C=0.1),
])
# pipelines: {'LogisticRegression': ..., 'LogisticRegression_2': ..., 'DummyClassifier': ...}

# Tuple override
clf = PoniardClassifier(estimators=[('my_lr', LogisticRegression())])
# pipelines: {'my_lr': ..., 'DummyClassifier': ...}

Features

  • Automatic type inference: Detects numeric, categorical, and datetime features
  • Built-in preprocessing: Imputation, encoding, scaling via a configurable pipeline
  • Cross-validated comparison: Fits multiple estimators with cross-validation and collects results
  • Hyperparameter tuning: Grid, random, and halving search for any estimator
  • Ensemble building: Create ensembles from fitted estimators
  • Plotting: Metrics comparison, ROC curves, confusion matrices, feature importance (optional, requires plotly)

Python support

3.10, 3.11, 3.12, 3.13 — tested on Linux, macOS, and Windows.

Development

git clone https://github.com/rxavier/poniard.git
cd poniard
uv sync --dev
uv run pytest

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

poniard-0.6.0.tar.gz (139.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

poniard-0.6.0-py3-none-any.whl (39.6 kB view details)

Uploaded Python 3

File details

Details for the file poniard-0.6.0.tar.gz.

File metadata

  • Download URL: poniard-0.6.0.tar.gz
  • Upload date:
  • Size: 139.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for poniard-0.6.0.tar.gz
Algorithm Hash digest
SHA256 27f965bacfc1bd36df69f6ed32fe6f568f305ceecfd14cbfc87c3caa5229116c
MD5 2020442e97fc6359ffd5c4da36297254
BLAKE2b-256 3e354127e20a157c108d4ba79b10a0256c1a5999ac710802dbc28ac40537c8c6

See more details on using hashes here.

File details

Details for the file poniard-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: poniard-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 39.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for poniard-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 712b9f4744b0faa25132f8ddedde0e1fabb9a44a6b73ac216781b22c397dca83
MD5 a80dd20172d4c3a3a1dd5350d424e8d0
BLAKE2b-256 bb3283f8b7248e7ec53fe8d14e051df294cbd72829eb5ea559929135c4dc3882

See more details on using hashes here.

Release history Release notifications | RSS feed

0.7.1

2 files

0.7.0

2 files

This release

0.6.0 This release

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page