Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
19 changes: 0 additions & 19 deletions fink_science/data/models/anomaly_detection/g_means.csv

This file was deleted.

19 changes: 0 additions & 19 deletions fink_science/data/models/anomaly_detection/r_means.csv

This file was deleted.

19 changes: 7 additions & 12 deletions fink_science/ztf/anomaly_detection/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@
"median_buffer_range_percentage_10",
"skew",
"stetson_K",
"percent_amplitude",
"linear_fit_reduced_chi2",
"inter_percentile_range_10",
"linear_trend",
"standard_deviation",
"weighted_mean",
"mean",
]

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

r_means = pd.read_csv(
f"{model_path}/r_means.csv", header=None, index_col=0, squeeze=True
)
g_means = pd.read_csv(
f"{model_path}/g_means.csv", header=None, index_col=0, squeeze=True
)
data_r = lc_features.apply(lambda x: get_key(x, 1))[MODEL_COLUMNS]
data_g = lc_features.apply(lambda x: get_key(x, 2))[MODEL_COLUMNS]

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

for col in data_r.columns[data_r.isna().any()]:
data_r[col].fillna(r_means[col], inplace=True) # noqa: PD002

for col in data_g.columns[data_g.isna().any()]:
data_g[col].fillna(g_means[col], inplace=True) # noqa: PD002

g_model_path_AAD = f"{model_path}/forest_g_AAD{model}.onnx"
r_model_path_AAD = f"{model_path}/forest_r_AAD{model}.onnx"
if not (os.path.exists(r_model_path_AAD) and os.path.exists(g_model_path_AAD)):
Expand Down