Skip to content

Commit 151fa88

Browse files
committed
Reduce rank and noise in doctest scenario.
This makes it easier for TensorLy to find the correct decomposition, which should make the test more robust.
1 parent 12c9b19 commit 151fa88

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tlviz/model_evaluation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,15 +334,15 @@ def predictive_power(cp_tensor, y, sklearn_estimator, mode=0, metric=None, axis=
334334
>>> from tlviz.data import simulated_random_cp_tensor
335335
>>> import numpy as np
336336
>>> rng = np.random.default_rng(0)
337-
>>> cp_tensor, X = simulated_random_cp_tensor((30, 10, 10), 5, noise_level=0.3, seed=rng)
337+
>>> cp_tensor, X = simulated_random_cp_tensor((30, 10, 10), 3, noise_level=0.1, seed=rng)
338338
>>> weights, (A, B, C) = cp_tensor
339-
>>> regression_coefficients = rng.standard_normal((5, 1))
339+
>>> regression_coefficients = rng.standard_normal((3, 1))
340340
>>> Y = A @ regression_coefficients
341341
342342
Next, we fit a PARAFAC model to this data
343343
344344
>>> from tensorly.decomposition import parafac
345-
>>> est_cp_tensor = parafac(X, 5)
345+
>>> est_cp_tensor = parafac(X, 3)
346346
347347
Finally, we see how well the estimated decomposition can describe our target variable, ``Y``.
348348
This will use the :math:`R^2`-coefficient for scoring, as that is the default scoring method

0 commit comments

Comments
 (0)