Spaces:
Running
Running
Sync from GitHub
Browse files- 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 |
-
#
|
| 333 |
-
|
| 334 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
|