Metadata-Version: 2.5
Name: pydaltoolbox
Version: 1.0.717
Summary: Leveraging Experiment Lines for Data Analytics (Python port of the R daltoolbox framework)
Project-URL: Homepage, https://github.com/cefet-rj-dal/pydaltoolbox
Project-URL: Repository, https://github.com/cefet-rj-dal/pydaltoolbox
Project-URL: Bug Tracker, https://github.com/cefet-rj-dal/pydaltoolbox/issues
Author: Benjamin Sperl
Author-email: Eduardo Ogasawara <eogasawara@ieee.org>, Rafaelli Coutinho <rafaelli.coutinho@cefet-rj.br>, Diego Carvalho <d.carvalho@ieee.org>, Jorge Soares <jorge.soares@cefet-rj.br>
Maintainer-email: Eduardo Ogasawara <eogasawara@ieee.org>
License: MIT
License-File: LICENSE
Keywords: data analytics,experiment line,machine learning,pipeline,scikit-learn
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Requires-Dist: numpy>=1.23
Requires-Dist: pandas>=1.5
Requires-Dist: scikit-learn>=1.2
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: pytest>=7; extra == 'dev'
Requires-Dist: ruff>=0.1; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Provides-Extra: docs
Requires-Dist: ipykernel>=6; extra == 'docs'
Requires-Dist: jupytext>=1.16; extra == 'docs'
Requires-Dist: nbclient>=0.9; extra == 'docs'
Requires-Dist: nbconvert>=7; extra == 'docs'
Provides-Extra: patterns
Requires-Dist: mlxtend>=0.21; extra == 'patterns'
Provides-Extra: viz
Requires-Dist: matplotlib>=3.6; extra == 'viz'
Provides-Extra: xgboost
Requires-Dist: xgboost>=1.7; extra == 'xgboost'
Description-Content-Type: text/markdown

# pydaltoolbox

[![PyPI version](https://img.shields.io/pypi/v/pydaltoolbox.svg)](https://pypi.org/project/pydaltoolbox/)
[![Python versions](https://img.shields.io/pypi/pyversions/pydaltoolbox.svg)](https://pypi.org/project/pydaltoolbox/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/cefet-rj-dal/pydaltoolbox/blob/main/LICENSE)

Python port of the R [DAL Toolbox](https://github.com/cefet-rj-dal/daltoolbox) —
*leveraging Experiment Lines for Data Analytics*.

`pydaltoolbox` organizes data analytics workflows (preprocessing, modeling, evaluation,
tuning, pattern mining, visualization, and extensibility) around a consistent **Experiment
Line** API (`fit` → `transform` / `predict` → `evaluate`), reusing classic Python libraries
(scikit-learn, numpy, pandas) through thin adapters and self-contained native
implementations.

It is the foundation of the DAL Python family:

- Powers **[pytspredit](https://github.com/cefet-rj-dal/pytspredit)** (time series prediction)
  and **[pyharbinger](https://github.com/cefet-rj-dal/pyharbinger)** (time series event detection).

## Installation

```bash
pip install pydaltoolbox
```

Optional extras for pattern mining (`mlxtend`), gradient boosting (`xgboost`), and plotting
(`matplotlib`):

```bash
pip install "pydaltoolbox[patterns,xgboost,viz]"
```

## Quickstart

```python
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"))
ev = model.evaluate(test["Species"], pred)
print(ev["metrics"])
```

## What's included

Every component extends the Experiment Line base classes (`DalBase`, `DalTransform`,
`DalLearner`, `Predictor`) so preprocessing, modeling, sampling, evaluation, and tuning
compose uniformly.

| Group | Classes & Functions |
|---|---|
| **Core Experiment Line** | `DalBase`, `DalTransform`, `DalLearner`, `Predictor`, `adjust_dataframe`, `adjust_matrix`, `adjust_factor`, `adjust_class_label` |
| **Sampling** | `DataSample`, `SampleRandom`, `SampleStratified`, `SampleSimple`, `SampleGroups`, `train_test_from_folds` |
| **Transformations** | `MinMax`, `ZScore`, `NaRemoval`, `ImputationSimple`, `ImputationPredictive`, `ImputationTree`, `OutliersBoxplot`, `OutliersGaussian`, `CategMapping`, `DtPca`, `FeatureSelectionCorr`, `FeatureSelectionLasso`, `FeatureSelectionInfoGain`, `FeatureSelectionFss`, `FeatureSelectionStepwise`, `FeatureSelectionRelief`, `FeatureGeneration`, `Aggregation`, `HierarchyCut`, `Smoothing`, `SmoothingInter`, `SmoothingFreq`, `SmoothingQuantization`, `SmoothingCluster`, `SampleBalance`, `BalSubsampling`, `BalOversampling`, `FitCurvatureMin`, `FitCurvatureMax` |
| **Classification** | `Classification`, `ClaDtree`, `ClaRpart`, `ClaKnn`, `ClaNb`, `ClaRf`, `ClaBagging`, `ClaBoosting`, `ClaSvm`, `ClaMlp`, `ClaGlm`, `ClaMultinom`, `ClaGlmnet`, `ClaMajority`, `ClaXgboost` (`[xgboost]`) |
| **Regression** | `Regression`, `RegLm`, `RegDtree`, `RegKnn`, `RegRf`, `RegSvm`, `RegMlp` |
| **Clustering** | `Clusterer`, `ClusterKmeans`, `ClusterDbscan`, `ClusterGmm`, `ClusterHclust`, `ClusterPam`, `ClusterCmeans` |
| **Pattern mining** | `PatternMiner`, `PatUtils`, `PatApriori` (`[patterns]`), `PatPrefixSpan` (native), `RuleFilter`, `RuleFilterNone`, `RuleFilterDara`, `RuleFilterInterest`, `dara`, `dara_score`, `SupportThreshold`, `ConfidenceThreshold`, `pat_rules_tidy` |
| **Tuning** | `DalTune`, `ClaTune`, `RegTune`, `CluTune` |
| **Autoencoder bases** | `AutoencBaseE`, `AutoencBaseEd` (for extension) |
| **Visualization** (`[viz]`) | `plot_hist`, `plot_density`, `plot_density_class`, `plot_boxplot`, `plot_boxplot_class`, `plot_bar`, `plot_groupedbar`, `plot_stackedbar`, `plot_lollipop`, `plot_pieplot`, `plot_radar`, `plot_scatter`, `plot_points`, `plot_correlation`, `plot_parallel`, `plot_pixel`, `plot_dendrogram` |
| **Datasets** | `datasets.iris()`, `datasets.diabetes()`, `datasets.boston()` |

## Guided Tutorial Track

If you are new to `pydaltoolbox`, start with the guided tutorials in the
[GitHub examples collection](https://github.com/cefet-rj-dal/pydaltoolbox/blob/main/examples/README.md):

- [Tutorials](https://github.com/cefet-rj-dal/pydaltoolbox/blob/main/examples/tutorial/README.md) — a
  structured learning path with semantic numbering blocks covering Experiment Line
  foundations, classification workflows, workflow transfer across tasks, and custom
  extensions.

## Thematic Example Collections

If you already know the basic Experiment Line workflow, jump directly to any thematic
example collection on GitHub:

- [Transformations](https://github.com/cefet-rj-dal/pydaltoolbox/blob/main/examples/transf/README.md) — sampling, cleaning, imputation, scaling, encoding, smoothing, balancing, feature selection, aggregation, and dimensionality reduction.
- [Classification](https://github.com/cefet-rj-dal/pydaltoolbox/blob/main/examples/classification/README.md) — foundations, linear models, kNN, probabilistic models, SVM, neural networks, ensembles, and model selection.
- [Regression](https://github.com/cefet-rj-dal/pydaltoolbox/blob/main/examples/regression/README.md) — linear models, flexible and nonlinear learners, ensembles, and hyperparameter tuning.
- [Clustering](https://github.com/cefet-rj-dal/pydaltoolbox/blob/main/examples/clustering/README.md) — partitional, density-based, hierarchical, fuzzy, and Gaussian mixture clustering, plus cluster tuning.
- [Pattern mining](https://github.com/cefet-rj-dal/pydaltoolbox/blob/main/examples/patterns/README.md) — frequent itemsets, association rules (`PatApriori`), rule filtering (`RuleFilterDara`, `RuleFilterInterest`), threshold estimation, and sequential pattern mining (`PatPrefixSpan`).
- [Graphics](https://github.com/cefet-rj-dal/pydaltoolbox/blob/main/examples/graphics/README.md) — distribution, comparison, relationship, and structure visualizations with matplotlib.
- [Custom extensions](https://github.com/cefet-rj-dal/pydaltoolbox/blob/main/examples/custom/README.md) — adding custom transformations and learners while preserving the DAL Experiment Line contract.

## Main Capabilities

- **Unified Experiment Line abstractions** for data transformations, learners, predictors, samplers, evaluators, and hyperparameter tuners.
- **Comprehensive data preprocessing** covering scaling, outlier removal, simple and predictive imputation, categorical encoding, PCA, smoothing, class balancing, aggregation, and feature selection.
- **Supervised and unsupervised modeling** spanning 14+ classifiers, 6 regressors, and 6 clustering algorithms with consistent evaluation metrics and tuning (`ClaTune`, `RegTune`, `CluTune`).
- **Pattern mining** supporting frequent itemsets, association rule mining, divergent-association ranking (`dara`), automatic threshold estimation, and native sequential pattern mining (`PatPrefixSpan`).
- **Visualization and extensibility** with 17 matplotlib plotting utilities (`[viz]`) and clean base classes (`DalTransform`, `Classification`, `Regression`, `Clusterer`, `AutoencBaseE`/`AutoencBaseEd`) for custom extensions.

## Related DAL projects

- [pytspredit](https://github.com/cefet-rj-dal/pytspredit) — time series prediction (Python)
- [pyharbinger](https://github.com/cefet-rj-dal/pyharbinger) — time series event detection (Python)
- [daltoolbox](https://github.com/cefet-rj-dal/daltoolbox) / [tspredit](https://github.com/cefet-rj-dal/tspredit) / [harbinger](https://github.com/cefet-rj-dal/harbinger) — R originals
- [Data Analytics Lab](https://eic.cefet-rj.br/~dal/)

## License

MIT
