fuzzyclust.models.make_piecewise_linear#

fuzzyclust.models.make_piecewise_linear(n_samples=400, noise=0.05, random_state=None)[source]#

A continuous piecewise-linear function of two variables (sum of two hinges).

\[y = \max(x_1 + x_2,\; 0.5 - x_1 + 0.5 x_2) + \max(0,\; x_2 - 0.5 x_1 - 0.5)\]

on \([-2, 2]^2\), i.e. two hinging-hyperplane functions whose hinges cross. The surface has four affine pieces and is the natural test case for HingingHyperplaneTree.

Returns:
Xndarray of shape (n_samples, 2)
yndarray of shape (n_samples,)

Examples using fuzzyclust.models.make_piecewise_linear#

Hinging-hyperplane regression tree identified by fuzzy c-regression

Hinging-hyperplane regression tree identified by fuzzy c-regression