eqdisco.knowledge.ShapeConstraint#

class eqdisco.knowledge.ShapeConstraint(kind, variable=None, lower=None, upper=None, domain=None)[source]#

Bases: object

A constraint on the model or on one of its partial derivatives.

Parameters:
kind{“increasing”, “decreasing”, “convex”, “concave”, “nonnegative”, “nonpositive”, “bounded”}

increasing: \(\partial f/\partial x_j\ge 0\); convex: \(\partial^2 f/\partial x_j^2\ge0\); nonnegative: \(f\ge 0\); bounded: lower \(\le f\le\) upper.

variablestr or int, optional

The variable of the derivative (not needed for value constraints).

lower, upperfloat, optional

Bounds of bounded.

domaintuple of arrays, optional

(lower_corner, upper_corner) of the box on which the constraint must hold; default: the range of the training data.

Examples using eqdisco.knowledge.ShapeConstraint#

Shape constraints for safe extrapolation

Shape constraints for safe extrapolation