Python API for OpenML
Project Links
Meta
Author: Jan van Rijn, Arlind Kadra, Pieter Gijsbers, Neeratyoy Mallik, Sahithya Ravi, Andreas Müller, Joaquin Vanschoren , Frank Hutter
Requires Python: >=3.8
Classifiers
Intended Audience
- Science/Research
- Developers
License
- OSI Approved :: BSD License
Programming Language
- Python :: 3
- Python :: 3.8
- Python :: 3.9
- Python :: 3.10
- Python :: 3.11
- Python :: 3.12
Topic
- Software Development
- Scientific/Engineering
Operating System
- POSIX
- Unix
- MacOS
OpenML-Python
The Python API for a World of Data and More :dizzy:
OpenML-Python provides an easy-to-use and straightforward Python interface for OpenML, an online platform for open science collaboration in machine learning. It can download or upload data from OpenML, such as datasets and machine learning experiment results.
:joystick: Minimal Example
Use the following code to get the credit-g dataset:
import openml
dataset = openml.datasets.get_dataset("credit-g") # or by ID get_dataset(31)
X, y, categorical_indicator, attribute_names = dataset.get_data(target="class")
Get a task for supervised classification on credit-g:
import openml
task = openml.tasks.get_task(31)
dataset = task.get_dataset()
X, y, categorical_indicator, attribute_names = dataset.get_data(target=task.target_name)
# get splits for the first fold of 10-fold cross-validation
train_indices, test_indices = task.get_train_test_split_indices(fold=0)
Use an OpenML benchmarking suite to get a curated list of machine-learning tasks:
import openml
suite = openml.study.get_suite("amlb-classification-all") # Get a curated list of tasks for classification
for task_id in suite.tasks:
task = openml.tasks.get_task(task_id)
:magic_wand: Installation
OpenML-Python is supported on Python 3.8 - 3.13 and is available on Linux, MacOS, and Windows.
You can install OpenML-Python with:
pip install openml
:page_facing_up: Citing OpenML-Python
If you use OpenML-Python in a scientific publication, we would appreciate a reference to the following paper:
Bibtex entry:
@article{JMLR:v22:19-920,
author = {Matthias Feurer and Jan N. van Rijn and Arlind Kadra and Pieter Gijsbers and Neeratyoy Mallik and Sahithya Ravi and Andreas Müller and Joaquin Vanschoren and Frank Hutter},
title = {OpenML-Python: an extensible Python API for OpenML},
journal = {Journal of Machine Learning Research},
year = {2021},
volume = {22},
number = {100},
pages = {1--5},
url = {http://jmlr.org/papers/v22/19-920.html}
}
0.15.1
Jan 25, 2025
0.15.0
Oct 05, 2024
0.14.2
Jan 18, 2024
0.14.1
Jul 20, 2023
0.14.0
Jul 05, 2023
0.13.1
Mar 22, 2023
0.13.0
Nov 25, 2022
0.12.2
May 20, 2021
0.12.1
Apr 14, 2021
0.12.0
Apr 08, 2021
0.11.0
Oct 25, 2020
0.10.2
Nov 07, 2019
0.10.1
Nov 05, 2019
0.9.0
Jun 05, 2019
0.8.0
Feb 15, 2019
0.7.0
Apr 24, 2018