Skip to main content

skordinal

Overview
CI/CD Unit tests !python
Code Ruff License - BSD 3-Clause

What is skordinal?

skordinal is an experimental framework built on Python that integrates with scikit-learn to automate machine learning experiments through simple JSON configuration files. Initially designed for ordinal classification, it supports regular classification algorithms as long as they are compatible with scikit-learn, making it easy to run reproducible experiments across multiple datasets and classification methods.

Table of Contents

Installation

Requirements

skordinal requires Python 3.10 or higher and is tested on Python 3.10, 3.11, 3.12, 3.13, and 3.14.

All dependencies are managed through pyproject.toml and include:

  • numpy (>=1.21)
  • pandas (>=1.0.1)
  • scikit-learn (>=1.3.0)
  • scipy (>=1.7)

Setup

  1. Clone the repository:

    git clone https://github.com/ayrna/skordinal
    cd skordinal
    
  2. Install the framework:

    pip install .
    

    For development purposes, use editable installation:

    pip install -e .
    

    Optional dependencies for development:

    pip install -e .[dev]
    

Testing Installation

Test your installation with the provided example:

python examples/run_recipe.py examples/recipes/full_demo.py

Quick Start

skordinal includes sample datasets with pre-partitioned train/test splits using a 30-holdout experimental design.

Basic experiment configuration:

A recipe is a Python file that defines a top-level RECIPE dict whose keys map directly to Benchmark constructor parameters. The required keys are models, datasets, eval_metrics, and results_path; all other keys are optional and fall back to the Benchmark defaults.

from sklearn.calibration import CalibratedClassifierCV
from sklearn.svm import SVC

from skordinal.classifiers import OrdinalDecomposition
from skordinal.experiments import ModelConfig

RECIPE = {
    "datasets": ["balance_scale", "era", "esl"],
    "cv": 3,
    "n_jobs": 1,
    "input_preprocessing": "std",
    "results_path": "results/",
    "eval_metrics": [
        "accuracy_score",
        "mean_absolute_error",
        "average_mean_absolute_error",
        "mean_zero_one_error",
    ],
    "tuning_metric": "neg_mean_absolute_error",
    "models": {
        "SVM": ModelConfig(
            SVC(),
            param_grid={"C": [0.001, 0.1, 1, 10, 100], "gamma": [0.1, 1, 10]},
        ),
        "SVMOP": ModelConfig(
            OrdinalDecomposition(
                estimator=CalibratedClassifierCV(estimator=SVC(), ensemble=False),
                decomposition="ordered_partitions",
                decision_method="frank_hall",
            ),
            param_grid={
                "estimator__estimator__C": [0.01, 0.1, 1, 10],
                "estimator__estimator__gamma": [0.01, 0.1, 1, 10],
            },
        ),
    },
}

Run the experiment:

python examples/run_recipe.py my_experiment.py

Results are saved in the results/ folder with performance metrics for each dataset-classifier combination. The framework automatically performs cross-validation, hyperparameter tuning, and evaluation on test sets.

Each classifier-dataset pair gets its own directory holding a report.csv with per-resample metrics, a hyperparameter_configuration.csv recording the best hyperparameters chosen for each seed, and a predictions_by_seed/ folder grouping the outputs of every resample:

results/
└── <classifier>/
    └── <dataset>/
        ├── report.csv
        ├── hyperparameter_configuration.csv
        └── predictions_by_seed/
            └── seed_<N>/
                ├── train_predictions.csv
                ├── test_predictions.csv
                ├── train_confusion_matrix.txt
                └── test_confusion_matrix.txt

Each predictions CSV lists the Pattern ID, the zero-based Target class index, a Prediction probabilities column with the per-class probabilities (for estimators that support predict_proba), and the zero-based Prediction class index, which always records the estimator's own predict output, even when probabilities are present. Confusion matrices are written alongside as plain-text .txt files, the fitted estimator for each seed is stored under a models/ subfolder, and aggregated train_summary.csv and test_summary.csv files are produced across all runs.

Configuration Files

Experiments are defined as Python recipe files — a module that exposes a top-level RECIPE dict. Every key in RECIPE corresponds to a Benchmark constructor parameter. Recipes can be run from the command line or loaded programmatically via Benchmark.from_recipe("path/to/recipe.py").

settings

These keys control how the benchmark is executed.

Required:

  • datasets: list of dataset names. A loader or subfolder with each name must be available under data_home.
  • eval_metrics: list of metric names computed on train and test for every partition.
  • results_path: folder where result files are written.

Optional:

  • tuning_metric (default "neg_mean_absolute_error"): scoring criterion passed to GridSearchCV to select the best hyperparameters.
  • cv (default 3): number of cross-validation folds.
  • n_jobs (default 1): parallel jobs for GridSearchCV.
  • input_preprocessing (default None): "std" for standardisation, "norm" for normalisation, None for no scaling.
  • resamples (default 30): number of train/test resamples per dataset.
  • test_size (default 0.3): fraction of samples held out for testing when partitions are generated rather than read from a masks file.
  • data_home (default None): base directory for dataset files; None uses the bundled datasets.
  • random_state (default None): integer seed for reproducibility.
  • verbose (default True): print progress during the run.

models

Required. A dict mapping a label (str) to a ModelConfig instance. ModelConfig binds a scikit-learn-compatible estimator to an optional param_grid.

  • ModelConfig(estimator, param_grid=None): wraps any estimator that implements the scikit-learn estimator interface. param_grid is a dict of hyperparameter name → list of values for GridSearchCV. For meta-estimators (e.g. OrdinalDecomposition) use the double-underscore syntax ("estimator__C") to target nested parameters.

Running Experiments

Basic Usage

python examples/run_recipe.py experiment_file.py

Example Output

Results are stored in the specified output folder with detailed performance metrics and hyperparameter information for each dataset and configuration combination.

License

BSD 3


Go to Top

Metadata

Release files for skordinal 0.1.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 skordinal 0.1.0
File Size Uploaded Provenance
skordinal-0.1.0.tar.gz 253.8 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for skordinal 0.1.0
File
skordinal-0.1.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
skordinal-0.1.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
skordinal-0.1.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
skordinal-0.1.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 Details
skordinal-0.1.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 Details

Total release size: 13.3 MB

Release files / skordinal-0.1.0.tar.gz

Download URL skordinal-0.1.0.tar.gz
Size 253.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d4ab1582103c40d8ed6338ec1ec9991451dffb65dd8176d25d7b3377bdbd26a2
BLAKE2b-256 checksum
How to use checksums
e7eff822856c4204514184a288ca57ad853517b3de717995036e8013c78be3a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 31, 2026.

Transparency log

Release files / skordinal-0.1.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL skordinal-0.1.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 2.6 MB
Tags CPython 3.14 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
83cec87fac1a64031fb1e1443cb7097cac1bfae68f1c55a05815dfbc8e6d11c5
BLAKE2b-256 checksum
How to use checksums
be06ebd8b0fab886556a99fdb619711ef270eb46c8b2d074479d9b765a879424
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 31, 2026.

Transparency log

Release files / skordinal-0.1.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL skordinal-0.1.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 2.6 MB
Tags CPython 3.13 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
bbbcc290a10cb57347581753e825bbef34110b71c5e701aa58db0777b443da80
BLAKE2b-256 checksum
How to use checksums
e4a658153d4b120793490d3bed4722f0af12b9cca2f2d0f0ad0efd2d8723e382
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 31, 2026.

Transparency log

Release files / skordinal-0.1.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL skordinal-0.1.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 2.6 MB
Tags CPython 3.12 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
4503d16e23117a1011eea25223869f410f20b01249b17b1f1630348a7d4ddd5a
BLAKE2b-256 checksum
How to use checksums
4a980791e3ee58027ce34328b8fe688182ace1b560b5d4e4e4838bdf5828b095
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 31, 2026.

Transparency log

Release files / skordinal-0.1.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL skordinal-0.1.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 2.6 MB
Tags CPython 3.11 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
b0c3d8295c002b2dacc76330fb30392dd1b97af21aac9d01766a3e0e8f6e6e6b
BLAKE2b-256 checksum
How to use checksums
3facd7b17ab8e7a038c9d7807838f348d6487a9d6125abc17342b4e51f67142e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 31, 2026.

Transparency log

Release files / skordinal-0.1.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL skordinal-0.1.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 2.6 MB
Tags CPython 3.10 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d918affddcc9bd4bb7aa149e072cdc9b40503ac4506ba6475bfc0bcf6721ef78
BLAKE2b-256 checksum
How to use checksums
54ff1e42b140f69143174cc1857d12e744cacf91091701b2bf39b760ca50981b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 31, 2026.

Transparency log

Security for skordinal 0.1.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.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for skordinal-0.1.0.tar.gz

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 Aug 31, 2026.

Transparency log

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