Skip to content

Commit 384c37f

Browse files
committed
models_update
1 parent 2c39933 commit 384c37f

File tree

8 files changed

+7
-50
lines changed

8 files changed

+7
-50
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

fink_science/data/models/anomaly_detection/g_means.csv

Lines changed: 0 additions & 19 deletions
This file was deleted.

fink_science/data/models/anomaly_detection/r_means.csv

Lines changed: 0 additions & 19 deletions
This file was deleted.

fink_science/ztf/anomaly_detection/processor.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@
4949
"median_buffer_range_percentage_10",
5050
"skew",
5151
"stetson_K",
52+
'percent_amplitude',
53+
'linear_fit_reduced_chi2',
54+
'inter_percentile_range_10',
55+
'linear_trend',
56+
'standard_deviation',
57+
'weighted_mean',
58+
'mean',
5259
]
5360

5461
ANOMALY_MODELS = ["_beta", "_anais", "_emille", "_julien", "_maria", "_emille_30days"] # noqa
@@ -183,12 +190,6 @@ def get_key(x: dict, band: int):
183190
path = os.path.dirname(os.path.abspath(__file__))
184191
model_path = f"{path}/data/models/anomaly_detection"
185192

186-
r_means = pd.read_csv(
187-
f"{model_path}/r_means.csv", header=None, index_col=0, squeeze=True
188-
)
189-
g_means = pd.read_csv(
190-
f"{model_path}/g_means.csv", header=None, index_col=0, squeeze=True
191-
)
192193
data_r = lc_features.apply(lambda x: get_key(x, 1))[MODEL_COLUMNS]
193194
data_g = lc_features.apply(lambda x: get_key(x, 2))[MODEL_COLUMNS]
194195

@@ -200,12 +201,6 @@ def get_key(x: dict, band: int):
200201
else:
201202
model = ""
202203

203-
for col in data_r.columns[data_r.isna().any()]:
204-
data_r[col].fillna(r_means[col], inplace=True) # noqa: PD002
205-
206-
for col in data_g.columns[data_g.isna().any()]:
207-
data_g[col].fillna(g_means[col], inplace=True) # noqa: PD002
208-
209204
g_model_path_AAD = f"{model_path}/forest_g_AAD{model}.onnx"
210205
r_model_path_AAD = f"{model_path}/forest_r_AAD{model}.onnx"
211206
if not (os.path.exists(r_model_path_AAD) and os.path.exists(g_model_path_AAD)):

0 commit comments

Comments
 (0)