Skip to content

Commit 9e3e064

Browse files
committed
added warning to align function when n_features exceeds n_samples
1 parent f57af0b commit 9e3e064

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

hypertools/tools/align.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from .procrustes import procrustes
2626
import numpy as np
2727
from .._shared.helpers import format_data
28+
from warnings import warn
2829

2930
##MAIN FUNCTION##
3031
def align(data, method='hyper'):
@@ -63,6 +64,11 @@ def align(data, method='hyper'):
6364

6465
data = format_data(data)
6566

67+
if data[0].shape[1]>=data[0].shape[0]:
68+
warn('The number of features exceeds number of samples. This can lead \
69+
to overfitting. We recommend reducing the dimensionality to be \
70+
less than the number of samples prior to hyperalignment.')
71+
6672
if method=='hyper':
6773

6874
##STEP 0: STANDARDIZE SIZE AND SHAPE##

0 commit comments

Comments
 (0)