Skip to main content

pydaltoolbox

PyPI version Python versions License: MIT

Python port of the R DAL Toolbox — leveraging Experiment Lines for Data Analytics.

pydaltoolbox organizes data analytics workflows (preprocessing, modeling, evaluation, tuning, extensibility) around a consistent Experiment Line style API. Its value is not reimplementing classic algorithms — it reuses scikit-learn, numpy and pandas — but a rigid, extensible interface that wraps them with a uniform fit / action / evaluate contract. Building a new method means subclassing a base and implementing two or three methods; sampling, evaluation and tuning come for free.

It is the foundation of the DAL Python family that also includes pytspredit (time series prediction) and pyharbinger (time series event detection).


Installation

Install the latest release from PyPI:

pip install pydaltoolbox

Beta: the v1 foundation is released and new features are landing incrementally (one release at a time) on the way to the 1.0.0 launch. The badge above always shows the latest version. Feedback and issues are very welcome.

The development version is available on GitHub:

pip install git+https://github.com/cefet-rj-dal/pydaltoolbox.git

For a local, editable clone (for contributing or running the examples):

git clone https://github.com/cefet-rj-dal/pydaltoolbox.git
cd pydaltoolbox
pip install -e ".[dev]"
pytest

First experiment

import pydaltoolbox as dal

iris = dal.datasets.iris()
slevels = list(iris["Species"].cat.categories)

split = dal.SampleRandom(seed=42).train_test(iris)
train, test = split["train"], split["test"]

model = dal.ClaDtree("Species", slevels, random_state=42).fit(train)

pred = model.predict(test.drop(columns="Species"))   # pass only the features
ev = model.evaluate(test["Species"], pred)
print(ev["metrics"])

Documentation

  • Processed examples — notebooks executed end to end, with real output embedded (the "processed documentation", analogous to the R package's examples/).
  • develop/planejamento.md — the migration roadmap (phases, scope, status).
  • develop/deploy.md — step-by-step guide to publish the package to PyPI.

The example sources live under notebooks/ (jupytext Markdown) and are rendered into examples/ by:

pip install -e ".[docs]"
python tools/build_examples.py

Status

Beta — the v1 foundation is complete and Cycle 1 is extending coverage toward 1.0.0 (see the roadmap for the live plan and version map). Implemented:

  • Core Experiment Line: DalBase, DalTransform, DalLearner, Predictor, set_params, and the adjust_* helpers.

  • Sampling: SampleRandom, SampleStratified (train_test, k_fold), train_test_from_folds.

  • Classification: Classification base + ClaDtree, ClaRpart, ClaKnn, ClaNb, ClaRf, ClaBagging, ClaBoosting, ClaSvm, ClaMlp, ClaGlm, ClaMultinom, ClaGlmnet, ClaMajority; ClaXgboost (gradient boosting) needs the optional [xgboost] extra (pip install pydaltoolbox[xgboost]) (0.13.0).

  • Regression: Regression base + RegLm, RegDtree, RegKnn, RegRf, RegSvm, RegMlp.

  • Clustering: Clusterer base + metrics + ClusterKmeans, ClusterDbscan, ClusterGmm, ClusterHclust, ClusterPam, ClusterCmeans (0.6.0).

  • Transformations:

    • normalization: MinMax, ZScore
    • cleaning: NaRemoval, ImputationSimple, OutliersBoxplot, OutliersGaussian
    • predictive imputation: ImputationPredictive, ImputationTree (0.3.0)
    • encoding / projection: CategMapping, DtPca
    • feature selection: FeatureSelectionCorr, Lasso, InfoGain, Fss, Stepwise, Relief
    • feature engineering: FeatureGeneration, Aggregation, HierarchyCut (0.4.0)
    • smoothing: SmoothingInter, SmoothingFreq, SmoothingQuantization, SmoothingCluster (0.2.0)
    • balancing: SampleBalance, BalSubsampling, BalOversampling
    • sampling: SampleSimple, SampleGroups (0.5.0)
    • curvature helpers: FitCurvatureMin, FitCurvatureMax
  • Pattern mining: PatternMiner base + PatUtils + PatApriori (frequent itemsets and association rules) (0.9.0); rule filters RuleFilter / RuleFilterNone / RuleFilterDara + the dara divergent-association ranking (0.10.0); RuleFilterInterest and support/confidence auto-estimation SupportThreshold / ConfidenceThreshold (0.11.0); PatPrefixSpan sequential pattern mining (native PrefixSpan) (0.12.0). PatApriori and the rule filters need the optional [patterns] extra (pip install pydaltoolbox[patterns], brings mlxtend); PatPrefixSpan is pure numpy/pandas.

  • Visualization: plot_* functions returning a matplotlib Axes; need the optional [viz] extra (pip install pydaltoolbox[viz], brings matplotlib).

    • distribution / comparison: plot_hist, plot_density, plot_density_class, plot_boxplot, plot_boxplot_class, plot_bar, plot_groupedbar, plot_stackedbar, plot_lollipop, plot_pieplot, plot_radar (0.14.0)
    • relation / temporal / structure: plot_scatter, plot_points, plot_correlation, plot_parallel, plot_pixel, plot_series, plot_ts, plot_ts_pred, plot_dendrogram (0.15.0)

    (The advanced/basic scatter matrices plot_pair / plot_pair_adv live as course extensions in the datamining repo, since the R originals relied on GGally; use pandas.plotting.scatter_matrix directly.)

  • Tuning: DalTune base + ClaTune, RegTune, CluTune.

  • Autoencoder bases: AutoencBaseE, AutoencBaseEd (identity, for extension).

  • Reference datasets: datasets.iris(), datasets.diabetes(), datasets.boston().

Wrappers are thin adapters over scikit-learn / numpy / pandas, each reproducing the R backend's default behavior (e.g. SVM standardizes inputs like e1071, trees pre-prune like tree/rpart). Pattern mining is complete (Cycle 1 done), ClaXgboost adds the [xgboost] extra, and the graphics family (21 plot_*, [viz]) is complete as of 0.15.0 (Cycle 2); see the roadmap. Next milestone: 1.0.0 stabilization.


License

MIT

Metadata

Release files for pydaltoolbox 0.23.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydaltoolbox 0.23.0
File Size Uploaded Provenance Actions
pydaltoolbox-0.23.0.tar.gz 85.0 kB Without provenance Details for pydaltoolbox-0.23.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pydaltoolbox 0.23.0
File Interpreter ABI Platform Actions
pydaltoolbox-0.23.0-py3-none-any.whl Python 3 none any Details for pydaltoolbox-0.23.0-py3-none-any.whl

Total release size: 204.3 kB

Release files / pydaltoolbox-0.23.0.tar.gz

Download URL pydaltoolbox-0.23.0.tar.gz
Size 85.0 kB
Tags Source
SHA-256 checksum
How to use checksums
400905af662d5d380b0223fb16bbd83407f34ecbba914b7b15f6e686e4e78a3c
BLAKE2b-256 checksum
How to use checksums
5e9cea087eded6c1a5ca6f299d247d98c77d4a51bea05a3f92c1834e9e99d597
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Release files / pydaltoolbox-0.23.0-py3-none-any.whl

Download URL pydaltoolbox-0.23.0-py3-none-any.whl
Size 119.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c137ba6de2965adf1ac406ca3275fda9e9973118907890a3fbe12fe53aa10c9c
BLAKE2b-256 checksum
How to use checksums
5aed985a02a3f25ab196f7160e1fa97b348e324a2ecbe709601200e07426b75a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Security for pydaltoolbox 0.23.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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