Skip to content

Planes2DΒΆ

2D Planes synthetic dataset.

This dataset is described in 1 and was adapted from 2. The features are generated using the following probabilities:

P(x1=βˆ’1)=P(x1=1)=12
P(xm=βˆ’1)=P(xm=0)=P(xm=1)=13,m=2,…,10

The target value is defined by the following rule:

if x1=1,y←3+3x2+2x3+x4+Ο΅
if x1=βˆ’1,yβ†βˆ’3+3x5+2x6+x7+Ο΅

In the expressions, ϡ∼N(0,1), is the noise.

ParametersΒΆ

  • seed (int) – defaults to None

    Random seed number used for reproducibility.

AttributesΒΆ

  • desc

    Return the description from the docstring.

ExamplesΒΆ

>>> from river.datasets import synth

>>> dataset = synth.Planes2D(seed=42)

>>> for x, y in dataset.take(5):
...     print(list(x.values()), y)
[-1, -1, 1, 0, -1, -1, -1, 1, -1, 1] -9.07
[1, -1, -1, -1, -1, -1, 1, 1, -1, 1] -4.25
[-1, 1, 1, 1, 1, 0, -1, 0, 1, 0] -0.95
[-1, 1, 0, 0, 0, -1, -1, 0, -1, -1] -6.10
[1, -1, 0, 0, 1, 0, -1, 1, 0, 1] 1.60

MethodsΒΆ

take

Iterate over the k samples.

Parameters

  • k (int)

ReferencesΒΆ


  1. 2DPlanes in LuΓ­s Torgo regression datasets β†©

  2. Breiman, L., Friedman, J., Stone, C.J. and Olshen, R.A., 1984. Classification and regression trees. CRC press. β†©