pcntoolkit.math_functions.basis_function#
Classes#
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Fractional polynomial basis function for modelling smooth nonlinear |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
Functions#
|
Module Contents#
- class BasisFunction(basis_column: int = 0, **kwargs)#
Bases:
abc.ABCHelper class that provides a standard way to create an ABC using inheritance.
- fit(X: numpy.ndarray) None#
- classmethod from_args(name: str, args: dict) BasisFunction#
- classmethod from_dict(my_dict: dict, version: str | None = None) BasisFunction#
- transform(X: numpy.ndarray) numpy.ndarray#
- basis_column = 0#
- abstract property dimension#
- class BsplineBasisFunction(basis_column: int = 0, degree: int = 3, nknots: int = 5, left_expand: float = 0.05, right_expand: float = 0.05, knot_method: str = 'uniform', knots: numpy.ndarray | list = None, **kwargs)#
Bases:
BasisFunctionHelper class that provides a standard way to create an ABC using inheritance.
- basis_name = 'bspline'#
- degree = 3#
- property dimension#
- knot_method = 'uniform'#
- left_expand = 0.05#
- nknots = 5#
- right_expand = 0.05#
- class CompositeBasisFunction(parts)#
Bases:
BasisFunctionHelper class that provides a standard way to create an ABC using inheritance.
- fit(X)#
- to_dict()#
- transform(X)#
- property dimension#
- parts#
- class FractionalPolynomialBasisFunction(basis_column: int = 0, order: int = 3, powers: list | tuple | str | None = 'default', power_set: list | tuple | None = None, eps: float = 1e-08, **kwargs)#
Bases:
BasisFunctionFractional polynomial basis function for modelling smooth nonlinear effects.
The input must be strictly positive (do not standardize the covariates). Power convention:
p = 0 -> log(x) p != 0 -> x**p
- Repeated powers:
[p, p, p] -> x**p, x**p * log(x), x**p * log(x)**2
Initialise the fractional polynomial basis function.
- Parameters:
- AGE_FP_POWER_PRESETS#
- DEFAULT_POWER_SET#
- basis_name = 'fractional_polynomial'#
- eps#
- order = 3#
- power_set#
- class LinearBasisFunction(basis_column: int = 0, **kwargs)#
Bases:
BasisFunctionHelper class that provides a standard way to create an ABC using inheritance.
- basis_name = 'linear'#
- property dimension#