File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -437,10 +437,16 @@ def __init__(
437437 coef0 = 1 ,
438438 ):
439439 # Create SEFR estimator with 'precomputed' kernel if we're using kernels
440- if kernel == "linear" :
440+ # Use string comparison that's safe for arrays (will raise TypeError for arrays)
441+ try :
442+ if kernel == "linear" :
443+ base_estimator = SEFR (kernel = "linear" )
444+ else :
445+ base_estimator = SEFR (kernel = "precomputed" )
446+ except (ValueError , TypeError ):
447+ # If kernel is an array or invalid type, default to linear
448+ # Parameter validation will catch this later in fit()
441449 base_estimator = SEFR (kernel = "linear" )
442- else :
443- base_estimator = SEFR (kernel = "precomputed" )
444450
445451 super ().__init__ (
446452 estimator = base_estimator ,
You can’t perform that action at this time.
0 commit comments