Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a501ca1
CI Check review_request_removed
thomasjpfan Oct 9, 2020
0fb69d4
ENH Checks n_features_in_ in cluster module
thomasjpfan Oct 14, 2020
f48580a
Merge remote-tracking branch 'upstream/master' into master
thomasjpfan Oct 22, 2020
357f268
CI Fixes CI sync
thomasjpfan Oct 28, 2020
8360cfb
Merge remote-tracking branch 'upstream/master' into master
thomasjpfan Oct 28, 2020
fa74c44
Merge branch 'fix_ci_sync' into master
thomasjpfan Oct 28, 2020
4b8f634
Merge remote-tracking branch 'origin/master' into pr_branch
invalid-email-address Oct 28, 2020
0bc1f28
Merge remote-tracking branch 'upstream/master' into n_features_cluster
thomasjpfan Nov 2, 2020
ce54d6c
REV Reduces diff
thomasjpfan Nov 2, 2020
5596764
STY Formatting
thomasjpfan Nov 2, 2020
86bd36c
ENH Uses context manager to avoid finite check
thomasjpfan Nov 2, 2020
c53c97d
ENH Adds n_features_in_ checking in cross_decomposition
thomasjpfan Nov 2, 2020
83938db
Merge remote-tracking branch 'upstream/master' into n_features_cross_…
thomasjpfan Nov 2, 2020
50cfbba
REV Reduces diff
thomasjpfan Nov 3, 2020
2461bec
CLN Less diff
thomasjpfan Nov 3, 2020
2e9057a
TST Expands dimensions
thomasjpfan Nov 4, 2020
29b24f5
Merge remote-tracking branch 'upstream/master' into n_features_cross_…
thomasjpfan Nov 23, 2020
55e952e
Merge remote-tracking branch 'upstream/master' into n_features_cross_…
thomasjpfan Dec 4, 2020
5bce618
TST Bigger feature matrix
thomasjpfan Dec 4, 2020
564f566
Merge remote-tracking branch 'upstream/main' into n_features_cross_de…
thomasjpfan Jan 26, 2021
f4e508c
ENH Fixes test
thomasjpfan Jan 26, 2021
7880f02
ENH Adds fix for cross_decomposition
thomasjpfan Jan 27, 2021
5661b50
ENH Sets n_componenets for cross_decomposition
thomasjpfan Jan 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sklearn/cross_decomposition/_pls.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def transform(self, X, Y=None, copy=True):
`x_scores` if `Y` is not given, `(x_scores, y_scores)` otherwise.
"""
check_is_fitted(self)
X = check_array(X, copy=copy, dtype=FLOAT_DTYPES)
X = self._validate_data(X, copy=copy, dtype=FLOAT_DTYPES, reset=False)
# Normalize
X -= self._x_mean
X /= self._x_std
Expand Down Expand Up @@ -379,7 +379,7 @@ def predict(self, X, copy=True):
space.
"""
check_is_fitted(self)
X = check_array(X, copy=copy, dtype=FLOAT_DTYPES)
X = self._validate_data(X, copy=copy, dtype=FLOAT_DTYPES, reset=False)
# Normalize
X -= self._x_mean
X /= self._x_std
Expand Down Expand Up @@ -984,7 +984,7 @@ def transform(self, X, Y=None):
`(X_transformed, Y_transformed)` otherwise.
"""
check_is_fitted(self)
X = check_array(X, dtype=np.float64)
X = self._validate_data(X, dtype=np.float64, reset=False)
Xr = (X - self._x_mean) / self._x_std
x_scores = np.dot(Xr, self.x_weights_)
if Y is not None:
Expand Down
1 change: 0 additions & 1 deletion sklearn/tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ def test_search_cv(estimator, check, request):
'calibration',
'compose',
'covariance',
'cross_decomposition',
'discriminant_analysis',
'ensemble',
'feature_extraction',
Expand Down
11 changes: 8 additions & 3 deletions sklearn/utils/estimator_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
load_iris,
make_blobs,
make_multilabel_classification,
make_regression,
make_regression
)

REGRESSION_DATASET = None
Expand Down Expand Up @@ -646,6 +646,9 @@ def _set_checking_parameters(estimator):
if name == 'OneHotEncoder':
estimator.set_params(handle_unknown='ignore')

if name in CROSS_DECOMPOSITION:
estimator.set_params(n_components=1)


class _NotAnArray:
"""An object that is convertible to an array.
Expand Down Expand Up @@ -3122,9 +3125,11 @@ def check_n_features_in_after_fitting(name, estimator_orig):
if 'warm_start' in estimator.get_params():
estimator.set_params(warm_start=False)

n_samples = 100
X = rng.normal(loc=100, size=(n_samples, 2))
n_samples = 150
X = rng.normal(size=(n_samples, 8))
X = _enforce_estimator_tags_x(estimator, X)
X = _pairwise_estimator_convert_X(X, estimator)

if is_regressor(estimator):
y = rng.normal(size=n_samples)
else:
Expand Down