GitHunt
SI

SimonBlanke/openml-python

OpenML's Python API for a World of Data and More ๐Ÿ’ซ

    OpenML Logo

    OpenML-Python

    Python Logo

The Python API for a World of Data and More ๐Ÿ’ซ

Latest Release
Python Versions
Downloads
License

Installation | Documentation | Contribution guidelines

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.

๐Ÿ•น๏ธ 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)

๐Ÿช„ 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

๐Ÿ“„ Citing OpenML-Python

If you use OpenML-Python in a scientific publication, we would appreciate a reference to the following paper:

Matthias Feurer, Jan N. van Rijn, Arlind Kadra, Pieter Gijsbers, Neeratyoy Mallik, Sahithya Ravi, Andreas Mรผller, Joaquin Vanschoren, Frank Hutter

OpenML-Python: an extensible Python API for OpenML

Journal of Machine Learning Research, 22(100):1โˆ’5, 2021

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}
}

Languages

Python99.5%Shell0.4%Dockerfile0.1%Makefile0.1%
Other
Created December 3, 2025
Updated December 3, 2025