Implementation:Online ml River Datasets Higgs
| Knowledge Sources | |
|---|---|
| Domains | Online_Learning, Datasets, Binary_Classification, Physics |
| Last Updated | 2026-02-08 16:00 GMT |
Overview
Concrete dataset for binary classification provided by the River library.
Description
The Higgs dataset contains data produced using Monte Carlo simulations for particle physics research. The first 21 features (columns 2-22) are kinematic properties measured by the particle detectors in the accelerator. The last seven features are functions of the first 21 features; these are high-level features derived by physicists to help discriminate between the two classes.
This dataset contains 11,000,000 samples with 28 features for binary classification tasks.
Usage
This dataset is useful for:
- Large-scale binary classification problems
- Evaluating streaming algorithms on high-volume data
- Physics-based machine learning applications
- Benchmarking classifier performance on real scientific data
Code Reference
Source Location
- Repository: Online_ml_River
- File: river/datasets/higgs.py
Signature
class Higgs(base.RemoteDataset):
def __init__(self):
super().__init__(
n_samples=11_000_000,
n_features=28,
task=base.BINARY_CLF,
url="https://archive.ics.uci.edu/ml/machine-learning-databases/00280/HIGGS.csv.gz",
size=2_816_407_858,
unpack=False,
)
def _iter(self):
features = [
"lepton pT", "lepton eta", "lepton phi",
"missing energy magnitude", "missing energy phi",
"jet 1 pt", "jet 1 eta", "jet 1 phi", "jet 1 b-tag",
"jet 2 pt", "jet 2 eta", "jet 2 phi", "jet 2 b-tag",
"jet 3 pt", "jet 3 eta", "jet 3 phi", "jet 3 b-tag",
"jet 4 pt", "jet 4 eta", "jet 4 phi", "jet 4 b-tag",
"m_jj", "m_jjj", "m_lv", "m_jlv", "m_bb", "m_wbb", "m_wwbb",
]
return stream.iter_csv(
self.path,
fieldnames=["is_signal", *features],
target="is_signal",
converters={
"is_signal": lambda x: x.startswith("1"),
**{f: float for f in features},
},
)
Import
from river import datasets
dataset = datasets.Higgs()
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (none) | — | — | No parameters needed |
Outputs
| Name | Type | Description |
|---|---|---|
| iter() | tuple(dict, bool) | Yields (features_dict, target) pairs where target indicates signal vs background |
Dataset Properties
| Property | Value |
|---|---|
| Number of samples | 11,000,000 |
| Number of features | 28 |
| Task | Binary classification |
| Format | CSV (compressed) |
| Size | 2,816,407,858 bytes |
Features
The dataset includes 28 features:
- Low-level features (21): Kinematic properties measured by particle detectors (lepton properties, missing energy, jet properties)
- High-level features (7): Derived features computed by physicists (m_jj, m_jjj, m_lv, m_jlv, m_bb, m_wbb, m_wwbb)
Usage Examples
from river import datasets
dataset = datasets.Higgs()
for x, y in dataset:
print(x, y)
break