@@ -760,7 +760,8 @@ def fit(self, X, y, sample_weight=None, coef_init=None, **params):
760
760
warnings .warn (
761
761
f"output_ids got { self .output_ids_ } , which does not "
762
762
f"contain all values from 0 to { self .n_outputs_ - 1 } ."
763
- "The predicted outputs for the missing values will be 0." ,
763
+ "The prediction for the missing outputs will be a constant"
764
+ "(i.e., intercept)." ,
764
765
UserWarning ,
765
766
)
766
767
@@ -783,6 +784,7 @@ def fit(self, X, y, sample_weight=None, coef_init=None, **params):
783
784
for i in range (self .n_outputs_ ):
784
785
output_i_mask = self .output_ids_ == i
785
786
if np .sum (output_i_mask ) == 0 :
787
+ intercept [i ] = np .mean (y_masked [:, i ])
786
788
continue
787
789
osa_narx .fit (
788
790
poly_terms_masked [:, output_i_mask ],
@@ -974,8 +976,8 @@ def _update_dydx(
974
976
dydx [k , y_ids , x_ids ] = terms
975
977
976
978
# Update dynamic terms of Jacobian
977
- cfd = np . zeros (( n_y , n_y , max_delay ), dtype = float )
978
- if max_delay > 0 :
979
+ if max_delay > 0 and grad_yyd_ids . size > 0 :
980
+ cfd = np . zeros (( n_y , n_y , max_delay ), dtype = float )
979
981
_update_cfd (
980
982
X ,
981
983
y_hat ,
0 commit comments