@@ -1190,22 +1190,14 @@ def _fit_stage(self, i, X, y, y_pred, sample_weight, sample_mask,
1190
1190
# no inplace multiplication!
1191
1191
sample_weight = sample_weight * sample_mask .astype (np .float64 )
1192
1192
1193
- if X_csc is not None :
1194
- tree .fit (X_csc , residual , sample_weight = sample_weight ,
1195
- check_input = False , X_idx_sorted = X_idx_sorted )
1196
- else :
1197
- tree .fit (X , residual , sample_weight = sample_weight ,
1198
- check_input = False , X_idx_sorted = X_idx_sorted )
1193
+ X = X_csr if X_csr is not None else X
1194
+ tree .fit (X , residual , sample_weight = sample_weight ,
1195
+ check_input = False , X_idx_sorted = X_idx_sorted )
1199
1196
1200
1197
# update tree leaves
1201
- if X_csr is not None :
1202
- loss .update_terminal_regions (tree .tree_ , X_csr , y , residual , y_pred ,
1203
- sample_weight , sample_mask ,
1204
- self .learning_rate , k = k )
1205
- else :
1206
- loss .update_terminal_regions (tree .tree_ , X , y , residual , y_pred ,
1207
- sample_weight , sample_mask ,
1208
- self .learning_rate , k = k )
1198
+ loss .update_terminal_regions (tree .tree_ , X , y , residual , y_pred ,
1199
+ sample_weight , sample_mask ,
1200
+ self .learning_rate , k = k )
1209
1201
1210
1202
# add tree to ensemble
1211
1203
self .estimators_ [i , k ] = tree
0 commit comments