File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -859,7 +859,10 @@ def __init__(
859
859
860
860
def _check_params_vs_input (self , X ):
861
861
if self .perplexity >= X .shape [0 ]:
862
- raise ValueError ("perplexity must be less than n_samples" )
862
+ raise ValueError (
863
+ f"perplexity ({ self .perplexity } ) must be less "
864
+ f"than n_samples ({ X .shape [0 ]} )"
865
+ )
863
866
864
867
def _fit (self , X , skip_num_points = 0 ):
865
868
"""Private function to fit the model using X as training data."""
Original file line number Diff line number Diff line change
1
+ import re
1
2
import sys
2
3
from io import StringIO
3
4
@@ -1170,7 +1171,7 @@ def test_tsne_perplexity_validation(perplexity):
1170
1171
perplexity = perplexity ,
1171
1172
random_state = random_state ,
1172
1173
)
1173
- msg = "perplexity must be less than n_samples"
1174
+ msg = re . escape ( f "perplexity ( { perplexity } ) must be less than n_samples (20)" )
1174
1175
with pytest .raises (ValueError , match = msg ):
1175
1176
est .fit_transform (X )
1176
1177
You can’t perform that action at this time.
0 commit comments