def __init__(self, feature, n_splines=20, spline_order=3, lam=0.6,
                 penalties='auto', constraints=None, dtype='numerical',
                 basis='ps', by=None, edge_knots=None, verbose=False):
        """creates an instance of a SplineTerm

        Parameters
        ----------
        feature : int
            Index of the feature to use for the feature function.

        n_splines : int
            Number of splines to use for the feature function.
            Must be non-negative.

        spline_order : int
            Order of spline to use for the feature function.
            Must be non-negative.

        lam :  float or iterable of floats
            Strength of smoothing penalty. Must be a positive float.
            Larger values enforce stronger smoothing.

            If single value is passed, it will be repeated for every penalty.

            If iterable is passed, the length of `lam` must be equal to the
            length of `penalties`

        penalties : {'auto', 'derivative', 'l2', None} or callable or iterable
            Type of smoothing penalty to apply to the term.

            If an iterable is used, multiple penalties are applied to the term.
            The length of the iterable must match the length of `lam`.

            If 'auto', then 2nd derivative smoothing for 'numerical' dtypes,
            and L2/ridge smoothing for 'categorical' dtypes.

            Custom penalties can be passed as a callable.

        constraints : {None, 'convex', 'concave', 'monotonic_inc', 'monotonic_dec'}
            or callable or iterable

            Type of constraint to apply to the term.

            If an iterable is used, multiple penalties are applied to the term.

        dtype : {'numerical', 'categorical'}
            String describing the data-type of the feature.

        basis : {'ps', 'cp'}
            Type of basis function to use in the term.

            'ps' : p-spline basis
            
            'cp' : cyclic p-spline basis, useful for building periodic functions.
                   by default, the maximum and minimum of the feature values
                   are used to determine the function's period.

                   to specify a custom period use argument `edge_knots`

        edge_knots : optional, array-like of floats of length 2

            these values specify minimum and maximum domain of the spline function.

            in the case that `spline_basis="cp"`, `edge_knots` determines
            the period of the cyclic function.

            when `edge_knots=None` these values are inferred from the data.

            default: None

        by : int, optional
            Feature to use as a by-variable in the term.

            For example, if `feature` = 2 `by` = 0, then the term will produce:
            x0 * f(x2)

        Attributes
        ----------
        n_coefs : int
            Number of coefficients contributed by the term to the model

        istensor : bool
            whether the term is a tensor product of sub-terms

        isintercept : bool
            whether the term is an intercept

        hasconstraint : bool
            whether the term has any constraints

        info : dict
            contains dict with the sufficient information to duplicate the term
        """
        self.basis = basis
        self.n_splines = n_splines
        self.spline_order = spline_order
        self.by = by
        self._name = 'spline_term'
        self._minimal_name = 's'

        if edge_knots is not None:
            self.edge_knots_ = edge_knots

        super(SplineTerm, self).__init__(feature=feature,
                                         lam=lam,
                                         penalties=penalties,
                                         constraints=constraints,
                                         fit_linear=False,
                                         fit_splines=True,
                                         dtype=dtype,
                                         verbose=verbose)

        self._exclude += ['fit_linear', 'fit_splines']
def __init__ ( self , feature , n_splines = 20 , spline_order = 3 , lam = 0.6 , penalties = 'auto' , constraints = None , dtype = 'numerical' , basis = 'ps' , by = None , edge_knots = None , verbose = False ) : self . basis = basis self . n_splines = n_splines self . spline_order = spline_order self . by = by self . _name = 'spline_term' self . _minimal_name = 's' if edge_knots is not None : self . edge_knots_ = edge_knots super ( SplineTerm , self ) . __init__ ( feature = feature , lam = lam , penalties = penalties , constraints = constraints , fit_linear = False , fit_splines = True , dtype = dtype , verbose = verbose ) self . _exclude += [ 'fit_linear' , 'fit_splines' ]
creates an instance of a SplineTerm

        Parameters
        ----------
        feature : int
            Index of the feature to use for the feature function.

        n_splines : int
            Number of splines to use for the feature function.
            Must be non-negative.

        spline_order : int
            Order of spline to use for the feature function.
            Must be non-negative.

        lam :  float or iterable of floats
            Strength of smoothing penalty. Must be a positive float.
            Larger values enforce stronger smoothing.

            If single value is passed, it will be repeated for every penalty.

            If iterable is passed, the length of `lam` must be equal to the
            length of `penalties`

        penalties : {'auto', 'derivative', 'l2', None} or callable or iterable
            Type of smoothing penalty to apply to the term.

            If an iterable is used, multiple penalties are applied to the term.
            The length of the iterable must match the length of `lam`.

            If 'auto', then 2nd derivative smoothing for 'numerical' dtypes,
            and L2/ridge smoothing for 'categorical' dtypes.

            Custom penalties can be passed as a callable.

        constraints : {None, 'convex', 'concave', 'monotonic_inc', 'monotonic_dec'}
            or callable or iterable

            Type of constraint to apply to the term.

            If an iterable is used, multiple penalties are applied to the term.

        dtype : {'numerical', 'categorical'}
            String describing the data-type of the feature.

        basis : {'ps', 'cp'}
            Type of basis function to use in the term.

            'ps' : p-spline basis
            
            'cp' : cyclic p-spline basis, useful for building periodic functions.
                   by default, the maximum and minimum of the feature values
                   are used to determine the function's period.

                   to specify a custom period use argument `edge_knots`

        edge_knots : optional, array-like of floats of length 2

            these values specify minimum and maximum domain of the spline function.

            in the case that `spline_basis="cp"`, `edge_knots` determines
            the period of the cyclic function.

            when `edge_knots=None` these values are inferred from the data.

            default: None

        by : int, optional
            Feature to use as a by-variable in the term.

            For example, if `feature` = 2 `by` = 0, then the term will produce:
            x0 * f(x2)

        Attributes
        ----------
        n_coefs : int
            Number of coefficients contributed by the term to the model

        istensor : bool
            whether the term is a tensor product of sub-terms

        isintercept : bool
            whether the term is an intercept

        hasconstraint : bool
            whether the term has any constraints

        info : dict
            contains dict with the sufficient information to duplicate the term