Project for Automated Learning MAchine
This library aims at providing tools for an automatic machine learning approach.
As many tools already exist to establish one or the other component of an AutoML
approach, the idea of this library is to provide a structure rather than to
implement a complete service.
In this library, a broad definition of AutoML is used : it covers the
optimization of hyperparameters, the historization of models, the analysis
of performances etc. In short, any element that can be replicated and that must,
in most cases, be included in the analysis results of the models.
Also, thanks to the use of components, this
library is designed to be modular and allows the user to add his own
analyses.
It therefore contains the following elements
-
A vanilla approach described below (in basic usage section) and in the notebooks classification and regression. In this approach, the users define a
Project, which can then be passed to either aModelSelectorto find the best model for this project, or to aModelEvaluationto study more in depth the behavior of a given model on this project. -
A collection of components that can be added to enrich analysis.
Install it with
python -m pip install palma
Documentation
Access the full documentation here.
Basic usage
- Start your project
To start using the library, use the project class
import pandas as pd
from sklearn.datasets import make_classification
from sklearn.model_selection import ShuffleSplit
from palma import Project
X, y = make_classification(n_informative=2, n_features=100)
X, y = pd.DataFrame(X), pd.Series(y).astype(bool)
project = Project(problem="classification", project_name="default")
project.start(
X, y,
splitter=ShuffleSplit(n_splits=10, random_state=42),
)
The instantiation defines the type of problem and the start method will set
what is needed to carry out ML project :
- A testing strategy (argument
splitter). That will define train and test instances. Note that we use cross validator from sklearn to do that. In the optimisation of hyper-parameters, a train test split will be operated, in this case, the first split will be used. This implies for instance that if you want 80/20 splitting method that shuffle the dataset, you should use
splitter = model_selection.ShuffleSplit(n_splits=5, random_state=42)
- Training data
Xand targety
This initialization is done in two steps to allow user to add optional
Components to the project before its start.
- Run hyper-optimisation
The hyper-optimisation process will look for the best model in pool of models that tend to perform well on various problem. For this specific task we make use of FLAML module. After hyper parametrisation, the metric to track can be computed
from palma import ModelSelector
ms = ModelSelector(engine="FlamlOptimizer",
engine_parameters=dict(time_budget=30))
ms.start(project)
print(ms.best_model_)
- Tailoring and analysing your estimator
from palma import ModelEvaluation
from sklearn.ensemble import RandomForestClassifier
# Use your own
model = ModelEvaluation(estimator=RandomForestClassifier())
model.fit(project)
# Get the optimized estimator
model = ModelEvaluation(estimator=ms.best_model_)
model.fit(project)
Contributing
You are very welcome to contribute to the project, by requesting features, pointing out new tools that can be added as component, by identifying issues and creating new features. Development guidelines will be detailed in near future.
- Fork the repository
- Clone your forked repository
git clone https://github.com/$USER/palma.git - Test using pytest
pip install pytest; pytest tests/ - Submit you work with a pull request.
Authors
Eurobios Mews Labs
Metadata
Release files for palma 2025.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| palma-2025.1.5.tar.gz | 57.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| palma-2025.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 126.7 kB
Release files / palma-2025.1.5.tar.gz
| Download URL | palma-2025.1.5.tar.gz |
|---|---|
| Size | 57.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be8a1ea7ccd048bbff8b54741617f61b754539ea163feb61b8f8dabf397218c5
|
|
BLAKE2b-256 checksum How to use checksums |
1bca92a611b33a94f8c2958e02903bb033da9c70b168e9c7677f7a320c8089f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 21, 2025.
Transparency logRelease files / palma-2025.1.5-py3-none-any.whl
| Download URL | palma-2025.1.5-py3-none-any.whl |
|---|---|
| Size | 69.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
01137ee42d22bb6062ea141844fa7ab57da3b71e4837997d788cf4e41265a8b0
|
|
BLAKE2b-256 checksum How to use checksums |
fc2902ec20b8721553318599785398151be31e15a145686be745745d57201f26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 21, 2025.
Transparency log