@@ -17,7 +17,7 @@ class TemplateEstimator(BaseEstimator):
17
17
A parameter used for demonstation of how to pass and store paramters.
18
18
"""
19
19
def __init__ (self , demo_param = 'demo_param' ):
20
- self .demo_param = ' demo_param'
20
+ self .demo_param = demo_param
21
21
22
22
def fit (self , X , y ):
23
23
"""A reference implementation of a fitting function
@@ -29,12 +29,14 @@ def fit(self, X, y):
29
29
y : array-like, shape = [n_samples] or [n_samples, n_outputs]
30
30
The target values (class labels in classification, real numbers in
31
31
regression).
32
+
32
33
Returns
33
34
-------
34
35
self : object
35
36
Returns self.
36
37
"""
37
38
X , y = check_X_y (X , y )
39
+ # Return the estimator
38
40
return self
39
41
40
42
def predict (self , X ):
@@ -81,6 +83,7 @@ def fit(self, X, y):
81
83
The training input samples.
82
84
y : array-like, shape = [n_samples]
83
85
The target values. An array of int.
86
+
84
87
Returns
85
88
-------
86
89
self : object
@@ -143,8 +146,10 @@ def fit(self, X, y=None):
143
146
----------
144
147
X : array-like or sparse matrix of shape = [n_samples, n_features]
145
148
The training input samples.
146
- y : array-like, shape = [n_samples]
147
- The target values. An array of int.
149
+ y : None
150
+ There is no need of a target in a transformer, yet the pipeline API
151
+ requires this parameter.
152
+
148
153
Returns
149
154
-------
150
155
self : object
@@ -154,7 +159,7 @@ def fit(self, X, y=None):
154
159
155
160
self .input_shape_ = X .shape
156
161
157
- # Return the classifier
162
+ # Return the transformer
158
163
return self
159
164
160
165
def transform (self , X ):
0 commit comments