@@ -669,7 +669,7 @@ def fit(self, X, y, sample_weight=None, coef_init=None, **params):
669669
670670 Parameters
671671 ----------
672- X : {array-like, sparse matrix} of shape (n_samples, `n_features_in_`)
672+ X : {array-like, sparse matrix} of shape (n_samples, `n_features_in_`) or None
673673 Training data.
674674
675675 y : array-like of shape (n_samples,) or (n_samples, `n_outputs_`)
@@ -700,7 +700,9 @@ def fit(self, X, y, sample_weight=None, coef_init=None, **params):
700700 self : object
701701 Fitted Estimator.
702702 """
703- check_X_params = dict (dtype = float , order = "C" , ensure_all_finite = "allow-nan" )
703+ check_X_params = dict (
704+ dtype = float , order = "C" , ensure_all_finite = "allow-nan" , ensure_min_features = 0
705+ )
704706 check_y_params = dict (
705707 ensure_2d = False , dtype = float , order = "C" , ensure_all_finite = "allow-nan"
706708 )
@@ -717,7 +719,10 @@ def fit(self, X, y, sample_weight=None, coef_init=None, **params):
717719 n_samples , n_features = X .shape
718720
719721 if self .feat_ids is None :
720- feat_ids_ = make_poly_ids (n_features , 1 ) - 1
722+ if n_features == 0 :
723+ feat_ids_ = make_poly_ids (self .n_outputs_ , 1 ) - 1
724+ else :
725+ feat_ids_ = make_poly_ids (n_features , 1 ) - 1
721726 else :
722727 feat_ids_ = self .feat_ids
723728
@@ -1152,6 +1157,7 @@ def predict(self, X, y_init=None):
11521157 order = "C" ,
11531158 reset = False ,
11541159 ensure_all_finite = "allow-nan" ,
1160+ ensure_min_features = 0 ,
11551161 )
11561162 if y_init is None :
11571163 y_init = np .zeros ((self .max_delay_ , self .n_outputs_ ))
@@ -1419,7 +1425,13 @@ def make_narx(
14191425 | 0 | X[k-1,0]*X[k-3,0] | 2.000 |
14201426 | 0 | X[k-2,0]*X[k,1] | 1.528 |
14211427 """
1422- X = check_array (X , dtype = float , ensure_2d = True , ensure_all_finite = "allow-nan" )
1428+ X = check_array (
1429+ X ,
1430+ dtype = float ,
1431+ ensure_2d = True ,
1432+ ensure_all_finite = "allow-nan" ,
1433+ ensure_min_features = 0 ,
1434+ )
14231435 y = check_array (y , dtype = float , ensure_2d = False , ensure_all_finite = "allow-nan" )
14241436 check_consistent_length (X , y )
14251437 if y .ndim == 1 :
0 commit comments