Thibaut Forest Claude Opus 5 (1M context) commited on
Commit ·
534abdd
1
Parent(s): 43761b5
Silence the benign all-NaN-imputer warning at source (tau_projected before the curve exists); message-targeted so real warnings stay visible
Browse files
batteryswap_example/models_cv.py
CHANGED
|
@@ -30,6 +30,15 @@ import warnings
|
|
| 30 |
import numpy as np
|
| 31 |
import pandas as pd
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
from sklearn.impute import SimpleImputer
|
| 34 |
from sklearn.preprocessing import StandardScaler
|
| 35 |
from sklearn.pipeline import make_pipeline
|
|
|
|
| 30 |
import numpy as np
|
| 31 |
import pandas as pd
|
| 32 |
|
| 33 |
+
# Benign and expected: tau_projected (and occasionally other physics columns)
|
| 34 |
+
# is all-NaN at the earliest origins, before the master curve exists; the
|
| 35 |
+
# imputer skips the column, which has been the accepted behavior since the
|
| 36 |
+
# feature was added (phase 6). One fit per origin per fold prints it, so an
|
| 37 |
+
# all48oof run emits it ~290 times - silence THIS message only, so real
|
| 38 |
+
# warnings stay visible.
|
| 39 |
+
warnings.filterwarnings(
|
| 40 |
+
'ignore', message='Skipping features without any observed values')
|
| 41 |
+
|
| 42 |
from sklearn.impute import SimpleImputer
|
| 43 |
from sklearn.preprocessing import StandardScaler
|
| 44 |
from sklearn.pipeline import make_pipeline
|