DOC Fix model parameter not added to self in GaussianNoise
@@ -696,6 +696,7 @@ The following example should make this clear::
def __init__(self, n_components=100, random_state=None):
self.random_state = random_state
+ self.n_components = n_components
# the arguments are ignored anyway, so we make them optional
def fit(self, X=None, y=None):
@@ -703,7 +704,7 @@ The following example should make this clear::
def transform(self, X):
n_samples = X.shape[0]
- return self.random_state_.randn(n_samples, n_components)
+ return self.random_state_.randn(n_samples, self.n_components)
The reason for this setup is reproducibility:
when an estimator is ``fit`` twice to the same data,
