Ordinal classification for Python, scikit-learn compatible
Project description
skordinal
| Overview | |
|---|---|
| CI/CD | |
| Code |
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.9 or higher and is tested on Python 3.9, 3.10, 3.11, and 3.12.
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
-
Clone the repository:
git clone https://github.com/ayrna/skordinal cd skordinal
-
Install the framework:
pip install .
For development purposes, use editable installation:
pip install -e .
Optional dependencies for development:
pip install -e .[dev]
Note: The editable mode is required for running tests due to automatic dependency resolution.
Testing Installation
Test your installation with the provided example:
python config.py with skordinal/configurations/full_functionality_test.json
Quick Start
skordinal includes sample datasets with pre-partitioned train/test splits using a 30-holdout experimental design.
Basic experiment configuration:
{
"general_conf": {
"basedir": "skordinal/datasets/data",
"datasets": ["balance-scale", "contact-lenses", "tae"],
"hyperparam_cv_nfolds": 3,
"output_folder": "results/",
"metrics": ["ccr", "mae", "amae"],
"cv_metric": "mae"
},
"configurations": {
"SVM": {
"classifier": "SVC",
"parameters": {
"C": [0.001, 0.1, 1, 10, 100],
"gamma": [0.1, 1, 10]
}
},
"SVMOP": {
"classifier": "OrdinalDecomposition",
"parameters": {
"dtype": "ordered_partitions",
"decision_method": "frank_hall",
"base_classifier": "SVC",
"parameters": {
"C": [0.01, 0.1, 1, 10],
"gamma": [0.01, 0.1, 1, 10],
"probability": ["True"]
}
}
}
}
}
Run the experiment:
python config.py with my_experiment.json
Results are saved in results/ folder with performance metrics for each dataset-classifier combination. The framework automatically performs cross-validation, hyperparameter tuning, and evaluation on test sets.
Configuration Files
Experiments are defined using JSON configuration files with two main sections: general_conf for experiment settings and configurations for classifier definitions.
general-conf
Controls global experiment parameters.
Required parameters:
basedir: folder containing all dataset subfolders, it doesn't allow more than one folder at a time. It can be indicated using a full path, or a relative one to the framework folder.datasets: name of datasets that will be experimented with. A subfolder with the same name must exist insidebasedir.
Optional parameters:
hyperparam_cv_folds: number of folds used while cross-validating.jobs: number of jobs used for GridSearchCV during cross-validation.input_preprocessing: data preprocessing ("std"for standardization,"norm"for normalization,""for none)output_folder: name of the folder where all experiment results will be stored.metrics: name of the accuracy metrics to measure the train and test performance of the classifier.cv_metric: error measure used for GridSearchCV to find the best set of hyper-parameters.
configurations
Defines classifiers and their hyperparameters for GridSearchCV. Each configuration has a name and consists of:
classifier: scikit-learn or built-in skordinal classifierparameters: hyperparameters for grid search (nested for ensemble methods)
Running Experiments
Basic Usage
python config.py with experiment_file.json
Example Output
Results are stored in the specified output folder with detailed performance metrics and hyperparameter information for each dataset and configuration combination.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file skordinal-0.0.1.tar.gz.
File metadata
- Download URL: skordinal-0.0.1.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
974c7397c6f5dd95f8e28210271896988b647d67408d01248ecc2dfb06cdaf61
|
|
| MD5 |
03198b1f2240007f1e784fa81f2a15b9
|
|
| BLAKE2b-256 |
ce04734d83d501d0e35e87607753bdb70fd5afc71d37e8575331cb6c1b230b18
|
Provenance
The following attestation bundles were made for skordinal-0.0.1.tar.gz:
Publisher:
release.yml on ayrna/skordinal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
skordinal-0.0.1.tar.gz -
Subject digest:
974c7397c6f5dd95f8e28210271896988b647d67408d01248ecc2dfb06cdaf61 - Sigstore transparency entry: 1396997591
- Sigstore integration time:
-
Permalink:
ayrna/skordinal@4a2c55ccfcf5c61be7b242e17073cab2a5a0292d -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/ayrna
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4a2c55ccfcf5c61be7b242e17073cab2a5a0292d -
Trigger Event:
release
-
Statement type:
File details
Details for the file skordinal-0.0.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: skordinal-0.0.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.12, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14870c9cc13f942865059c85633423681dc933f4fe179fb3a066b5c2132b74ce
|
|
| MD5 |
014ccc536a4c1901504115307dd900be
|
|
| BLAKE2b-256 |
83920a861ac757f287b8160faabae969a538be40bce4fe8cfb079debbc26f876
|
Provenance
The following attestation bundles were made for skordinal-0.0.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
release.yml on ayrna/skordinal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
skordinal-0.0.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
14870c9cc13f942865059c85633423681dc933f4fe179fb3a066b5c2132b74ce - Sigstore transparency entry: 1396997623
- Sigstore integration time:
-
Permalink:
ayrna/skordinal@4a2c55ccfcf5c61be7b242e17073cab2a5a0292d -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/ayrna
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4a2c55ccfcf5c61be7b242e17073cab2a5a0292d -
Trigger Event:
release
-
Statement type:
File details
Details for the file skordinal-0.0.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: skordinal-0.0.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.11, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5d99353a88db7f16a029cd991e54cc881577b9aa3c85c8991970023c46777ca
|
|
| MD5 |
0043e87f0839063852cb3c26a933d34b
|
|
| BLAKE2b-256 |
79b5a9c949d64092d7040e53b7007fe76fee1ad1b74ed947b31c62bf18b7c073
|
Provenance
The following attestation bundles were made for skordinal-0.0.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
release.yml on ayrna/skordinal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
skordinal-0.0.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
b5d99353a88db7f16a029cd991e54cc881577b9aa3c85c8991970023c46777ca - Sigstore transparency entry: 1396997678
- Sigstore integration time:
-
Permalink:
ayrna/skordinal@4a2c55ccfcf5c61be7b242e17073cab2a5a0292d -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/ayrna
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4a2c55ccfcf5c61be7b242e17073cab2a5a0292d -
Trigger Event:
release
-
Statement type:
File details
Details for the file skordinal-0.0.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: skordinal-0.0.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.10, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d0e543bd3aa1dce33b02e008d984e22c962e89daca593ebc3237394fed26caf
|
|
| MD5 |
51332fe4d0e1179f2c2086f54163bf27
|
|
| BLAKE2b-256 |
ff65aa2b93728a361b7b7c106577eae41d3ffa4e5a9a71fcf8b1295cfc218804
|
Provenance
The following attestation bundles were made for skordinal-0.0.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
release.yml on ayrna/skordinal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
skordinal-0.0.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
8d0e543bd3aa1dce33b02e008d984e22c962e89daca593ebc3237394fed26caf - Sigstore transparency entry: 1396997654
- Sigstore integration time:
-
Permalink:
ayrna/skordinal@4a2c55ccfcf5c61be7b242e17073cab2a5a0292d -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/ayrna
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4a2c55ccfcf5c61be7b242e17073cab2a5a0292d -
Trigger Event:
release
-
Statement type:
File details
Details for the file skordinal-0.0.1-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: skordinal-0.0.1-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.9, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55fe47e327ec7b83264cf62bc25827fcfd26829f42a58afe5204169bbe0f722a
|
|
| MD5 |
a531fa3d7e0fa57665a22a3c31992c1e
|
|
| BLAKE2b-256 |
ea7bd4a9c3087d4a9d789d3c8e0acf1c6ae49e0f5d0d017dacfb73912750f41f
|
Provenance
The following attestation bundles were made for skordinal-0.0.1-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
release.yml on ayrna/skordinal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
skordinal-0.0.1-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
55fe47e327ec7b83264cf62bc25827fcfd26829f42a58afe5204169bbe0f722a - Sigstore transparency entry: 1396997706
- Sigstore integration time:
-
Permalink:
ayrna/skordinal@4a2c55ccfcf5c61be7b242e17073cab2a5a0292d -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/ayrna
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4a2c55ccfcf5c61be7b242e17073cab2a5a0292d -
Trigger Event:
release
-
Statement type: