Registry / ai-ml / pmlb
library1.0.1.post3pypypi✓ verified 84d ago

A Python wrapper for the Penn Machine Learning Benchmark (PMLB) data repository, which provides curated datasets for evaluating classification and regression algorithms. Current version is 1.0.1.post3, with low release cadence.

pip install pmlb
INSTALL
IMPORT
SIG · PMLB
P
pmlb
ai-mlpythonv1.0.1.post3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

fetch_data
from pmlb import fetch_data
from pmlb.pmlb import fetch_data
Old import path no longer works.
dataset_names
from pmlb import dataset_names
from pmlb.datasets import dataset_names
Use top-level import.

Load the iris dataset as a DataFrame or as (X, y) arrays.

from pmlb import fetch_data, dataset_names # List all available datasets print(len(dataset_names)) # Fetch a dataset as a pandas DataFrame df = fetch_data('iris') print(df.head()) # Fetch with 'return_X_y=True' for sklearn-style split X, y = fetch_data('iris', return_X_y=True) print(X.shape, y.shape)
Debug
Known issues
deprecatedThe function `pmlb.classification_dataset_names` and `pmlb.regression_dataset_names` are deprecated as of version 1.0.0. Use `dataset_names` instead.
fix
Use `from pmlb import dataset_names` and filter manually if needed.
affects: <1.0.0
gotchaDatasets are loaded into memory entirely as pandas DataFrames. Some datasets can be large (e.g., 'adult' with ~48k rows), which may cause memory issues on low-RAM systems.
fix
Use `return_X_y=True` to get NumPy arrays (still in memory). Consider subsampling if necessary.
affects: all
gotchaSome datasets contain missing values represented as '?' or other sentinel values. They are not automatically cleaned.
fix
Check dataset metadata or manually handle missing values after loading.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pmlb'
Library not installed or installed in a different environment.
fix
Run `pip install pmlb` in the correct Python environment.
AttributeError: module 'pmlb' has no attribute 'fetch_ucirepo'
Confusion with another library (e.g., ucimlrepo) or outdated code expecting a different function name.
fix
Use `fetch_data` from pmlb, not `fetch_ucirepo`.
ValueError: Unknown dataset: 'adult_original'
The requested dataset name does not exist in PMLB (e.g., it may be named 'adult' instead).
fix
Check available datasets with `pmlb.dataset_names`.
Upgrade
Version history
1.0.1.post3latest on PyPI · released Sep 10, 2020
Audit
Dependencies
pandasrequiredData handling; returned datasets are DataFrames.
scikit-learnoptionalOptional for downstream ML tasks; not required for fetching data.
Agent activity
9 hits · last 30 days
node
8
Resources
pmlb — pip install pmlb · libregistry