ifieryarrows commited on
Commit
0218a42
·
verified ·
1 Parent(s): 3c5bd91

Sync from GitHub

Browse files
Files changed (1) hide show
  1. app/features.py +7 -3
app/features.py CHANGED
@@ -329,9 +329,13 @@ def build_feature_matrix(
329
  X = X[valid_mask]
330
  y = y[valid_mask]
331
 
332
- # Drop any remaining NaN features
333
- X = X.dropna()
334
- y = y.loc[X.index]
 
 
 
 
335
 
336
  logger.info(f"Feature matrix: {X.shape[0]} samples, {X.shape[1]} features")
337
 
 
329
  X = X[valid_mask]
330
  y = y[valid_mask]
331
 
332
+ # Fill remaining NaN features with 0 (instead of dropping rows)
333
+ # This is important for new symbols that may have missing data
334
+ nan_count_before = X.isna().sum().sum()
335
+ X = X.fillna(0)
336
+
337
+ if nan_count_before > 0:
338
+ logger.info(f"Filled {nan_count_before} NaN values in features with 0")
339
 
340
  logger.info(f"Feature matrix: {X.shape[0]} samples, {X.shape[1]} features")
341