vindy.libraries package

Submodules

vindy.libraries.base_library module

class BaseLibrary[source]

Bases: ABC

Abstract class for feature libraries.

abstract get_names(x)[source]

Construct the names of the features for the input x.

Parameters:

x (any) – Input data.

Returns:

Names of the features.

Return type:

list of str

vindy.libraries.exponential_library module

class ExponentialLibrary(coeff=[1])[source]

Bases: BaseLibrary

Library for exponential features.

get_names(x)[source]

Construct the names of the exponential features for the input x.

Parameters:

x (any) – Input data.

Returns:

Names of the exponential features.

Return type:

list of str

vindy.libraries.force_library module

class ForceLibrary(functions=[<function sin>, <function cos>])[source]

Bases: BaseLibrary

Library for force features.

get_names(x)[source]

Construct the names of the features for the input x.

Parameters:

x (array-like) – Input data.

Returns:

Names of the force features.

Return type:

list of str

vindy.libraries.fourier_library module

class FourierLibrary(freqs=[1])[source]

Bases: BaseLibrary

Library for Fourier features.

get_names(x)[source]

Construct the names of the features for the input x.

Parameters:

x (array-like) – Input data.

Returns:

Names of the trigonometric features.

Return type:

list of str

vindy.libraries.polynomial_library module

class PolynomialLibrary(degree=3, x_dim=2, interaction=True, include_bias=True)[source]

Bases: BaseLibrary

Library for polynomial features.

get_names(x)[source]

Construct the names of the features for the input x.

Parameters:

x (array-like of shape (n_samples, 2*reduce_order)) – Latent variable and its time derivative.

Returns:

Names of the polynomial features.

Return type:

list of str

loop_rec(x, x_i, i, n, d)[source]

Recursive helper function to compute polynomial features.

Parameters:
  • x (array-like) – Input data.

  • x_i (array-like) – Intermediate result.

  • i (int) – Current index.

  • n (int) – Total number of features.

  • d (int) – Current degree.

Returns:

Polynomial features.

Return type:

list of array-like

loop_rec_names(x, x_i, i, n, d, l: list)[source]

Recursive helper function to construct feature names.

Parameters:
  • x (array-like) – Input data.

  • x_i (sympy.Symbol) – Intermediate result.

  • i (int) – Current index.

  • n (int) – Total number of features.

  • d (int) – Current degree.

  • l (list of sympy.Symbol) – List of feature names.

Returns:

Feature names.

Return type:

list of sympy.Symbol

poly_higher_order(x)[source]

Compute polynomial features for higher dimensional input x.

Parameters:

x (array-like) – Input data.

Returns:

Polynomial features.

Return type:

array-like

Module contents