Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Online ml River Datasets ImageSegments

From Leeroopedia


Knowledge Sources
Domains Online_Learning, Datasets, Multi_Class_Classification, Computer_Vision
Last Updated 2026-02-08 16:00 GMT

Overview

Concrete dataset for multi-class classification provided by the River library.

Description

Image segments classification. This dataset contains features that describe image segments into 7 classes: brickface, sky, foliage, cement, window, path, and grass.

This dataset contains 2,310 samples with 18 features and 7 classes for multi-class classification tasks.

Usage

This dataset is useful for:

  • Image segmentation and classification
  • Computer vision applications
  • Multi-class classification benchmarking
  • Feature-based image analysis

Code Reference

Source Location

Signature

class ImageSegments(base.FileDataset):
    def __init__(self):
        super().__init__(
            n_samples=2_310,
            n_classes=7,
            n_features=18,
            task=base.MULTI_CLF,
            filename="segment.csv.zip",
        )

    def __iter__(self):
        return stream.iter_csv(
            self.path,
            target="category",
            converters={
                "region-centroid-col": int,
                "region-centroid-row": int,
                "short-line-density-5": float,
                "short-line-density-2": float,
                "vedge-mean": float,
                "vegde-sd": float,
                "hedge-mean": float,
                "hedge-sd": float,
                "intensity-mean": float,
                "rawred-mean": float,
                "rawblue-mean": float,
                "rawgreen-mean": float,
                "exred-mean": float,
                "exblue-mean": float,
                "exgreen-mean": float,
                "value-mean": float,
                "saturation-mean": float,
                "hue-mean": float,
            },
        )

Import

from river import datasets
dataset = datasets.ImageSegments()

I/O Contract

Inputs

Name Type Required Description
(none) No parameters needed

Outputs

Name Type Description
iter() tuple(dict, str) Yields (features_dict, target) pairs where target is the image segment class

Dataset Properties

Property Value
Number of samples 2,310
Number of features 18
Number of classes 7
Task Multi-class classification
Format CSV (compressed)

Classes

The dataset classifies image segments into 7 categories:

  • brickface
  • sky
  • foliage
  • cement
  • window
  • path
  • grass

Features

The dataset includes 18 features describing image segments:

  • region-centroid-col, region-centroid-row: Region centroid position (integer)
  • short-line-density-5, short-line-density-2: Line density measures (float)
  • vedge-mean, vegde-sd: Vertical edge statistics (float)
  • hedge-mean, hedge-sd: Horizontal edge statistics (float)
  • intensity-mean: Average intensity (float)
  • rawred-mean, rawblue-mean, rawgreen-mean: Raw color channel means (float)
  • exred-mean, exblue-mean, exgreen-mean: Excess color channel means (float)
  • value-mean, saturation-mean, hue-mean: HSV color space statistics (float)

Usage Examples

from river import datasets

dataset = datasets.ImageSegments()
for x, y in dataset:
    print(x, y)
    break

References

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment