Skip to content

Commit

Permalink
fixed failing doc test
Browse files Browse the repository at this point in the history
  • Loading branch information
pranmod01 committed Oct 23, 2024
1 parent 03b80db commit d85917a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/nemos/basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,19 +240,18 @@ def transform(self, X: FeatureMatrix, y=None) -> FeatureMatrix:
--------
>>> # Example input
>>> import numpy as np
>>> X, y = np.random.normal(size=(100, 2)), np.random.uniform(size=100)
>>> X, y = np.random.normal(size=(10000, 2)), np.random.uniform(size=100)
>>> # Define and fit tranformation basis
>>> from nemos.basis import MSplineBasis, TransformerBasis
>>> basis = MSplineBasis(10, mode="conv", window_size=200)
>>> transformer = TransformerBasis(basis)
>>> transformer_fitted = transformer.fit(X) # input must be a 2d array
>>> # Before calling `fit` the convolution kernel is not set
>>> transformer.kernel_
>>> transformer_fitted = transformer.fit(X) # input must be a 2d array
>>> # Now the convolution kernel is initialized and has shape (window_size, n_basis_funcs)
>>> transformer_fitted.kernel.shape
>>> transformer_fitted.kernel_.shape
(200, 10)
>>> # Transform basis
Expand Down

0 comments on commit d85917a

Please sign in to comment.