openml/openml-python

OpenML's Python API for a World of Data and More 💫

OpenML‑Python – What It Is

OpenML‑Python is a client library that lets you talk to the OpenML platform from Python. OpenML is an online repository where researchers share datasets, machine‑learning tasks (e.g., predefined train‑test splits), and the results of experiments. The library provides a thin, Pythonic wrapper around the OpenML REST API so you can download data, fetch benchmark suites, and upload your own runs without leaving your code.


Core Features (as described in the README)

Feature What It Does
Dataset access openml.datasets.get_dataset(id_or_name) returns a Dataset object; get_data() gives you X, y, … ready for scikit‑learn or other tools.
Task handling openml.tasks.get_task(id) fetches a predefined task (e.g., a classification problem with a specific train‑test split). You can retrieve the underlying dataset and the split indices.
Benchmark suites openml.study.get_suite(name) returns a curated list of task IDs (e.g., amlb-classification-all). Loop over the suite to run large‑scale benchmarking experiments.
Upload / download runs Although not shown in the snippet, the library also supports posting your experiment results back to OpenML so they become part of the public benchmark.
Cross‑platform, recent Python Works on Python 3.10‑3.14 and on Linux, macOS, Windows.
Installation Simple pip install openml.
Citation support Provides a ready‑to‑copy BibTeX entry for the JMLR paper describing the library.

Typical Use‑Case Workflow

  1. Pick a dataset or task – either by name ("credit-g") or numeric ID.
  2. Load the data – X, y = dataset.get_data(target="class") gives you features and labels.
  3. If you need a specific split – retrieve it from a task object (task.get_train_test_split_indices).
  4. Run your model – train any scikit‑learn / PyTorch / etc. model on the training indices, evaluate on the test indices.
  5. (Optional) Upload results – use the OpenML API to publish your run so others can compare.
  6. Scale up – fetch a whole suite of tasks and repeat the process automatically for large‑scale benchmarking.

Who Might Use This?

  • Researchers who want reproducible benchmarks across many datasets without manually downloading each CSV.
  • Students learning about model evaluation; the predefined tasks guarantee identical train‑test splits.
  • Tool builders that need a programmatic way to query OpenML for meta‑learning or automated ML pipelines.

Getting Started

pip install openml
import openml
# Example from the README
dataset = openml.datasets.get_dataset("credit-g")
X, y, _, _ = dataset.get_data(target="class")

The official docs (linked in the badge) contain more details on authentication, uploading runs, and advanced query options.


Community & Contribution

The project welcomes contributions of any level. New contributors are encouraged to start with issues tagged "good first issue", and a full contribution guide lives in the repo.


In short: OpenML‑Python is a genuine, actively‑maintained Python client for the OpenML data‑science platform, aimed at making dataset and benchmark access trivial for anyone doing machine‑learning research.

Related

  • Project
  • Project
  • Project
  • Project
  • Project