Skip to content

Commit aef9d91

Browse files
committed
Fixes after rebase
1 parent d0dc35c commit aef9d91

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/skmatter/decomposition/_pcovc.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class PCovC(LinearClassifierMixin, _BasePCov):
165165
n_components, or the lesser value of n_features and n_samples
166166
if n_components is None.
167167
168-
n_outputs : int
168+
n_outputs_ : int
169169
The number of outputs when ``fit`` is performed.
170170
171171
classifier : estimator object
@@ -280,7 +280,7 @@ def fit(self, X, Y, W=None):
280280

281281
check_classification_targets(Y)
282282
self.classes_ = np.unique(Y)
283-
self.n_outputs = 1 if Y.ndim == 1 else Y.shape[1]
283+
self.n_outputs_ = 1 if Y.ndim == 1 else Y.shape[1]
284284

285285
super()._set_fit_params(X)
286286

@@ -305,7 +305,7 @@ def fit(self, X, Y, W=None):
305305
", or `precomputed`"
306306
)
307307

308-
multioutput = self.n_outputs != 1
308+
multioutput = self.n_outputs_ != 1
309309
precomputed = self.classifier == "precomputed"
310310

311311
if self.classifier is None or precomputed:
@@ -468,7 +468,7 @@ def decision_function(self, X=None, T=None):
468468
if X is not None:
469469
X = validate_data(self, X, reset=False)
470470

471-
if self.n_outputs == 1:
471+
if self.n_outputs_ == 1:
472472
# Or self.classifier_.decision_function(X @ self.pxt_)
473473
return X @ self.pxz_ + self.classifier_.intercept_
474474
else:
@@ -479,7 +479,7 @@ def decision_function(self, X=None, T=None):
479479
else:
480480
T = check_array(T)
481481

482-
if self.n_outputs == 1:
482+
if self.n_outputs_ == 1:
483483
return T @ self.ptz_ + self.classifier_.intercept_
484484
else:
485485
return [

tests/test_kernel_pcovc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ def test_Z_shape_multioutput(self):
556556
# list of (n_samples, ) arrays when each column of Y is binary
557557
self.assertEqual(len(Z), Y_double.shape[1])
558558

559-
for est, z_slice in zip(kpcovc.z_classifier_.estimators_, Z):
559+
for z_slice in Z:
560560
with self.subTest(type="z_arrays"):
561561
# each array is shape (n_samples, ):
562562
self.assertEqual(self.X.shape[0], z_slice.shape[0])

0 commit comments

Comments
 (0)