From 69767da850f900d3ebd6d3660b7d5527ff1e9f1e Mon Sep 17 00:00:00 2001 From: Ivan Usov Date: Mon, 1 Mar 2021 15:40:31 +0100 Subject: [PATCH] Use weights in fit --- pyzebra/ccl_process.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyzebra/ccl_process.py b/pyzebra/ccl_process.py index 2eec010..01a3bed 100644 --- a/pyzebra/ccl_process.py +++ b/pyzebra/ccl_process.py @@ -125,4 +125,5 @@ def fit_scan(scan, model_dict): else: model += _model - scan["fit"] = model.fit(y_fit, x=x_fit) + weights = [1 / np.sqrt(val) if val != 0 else 1 for val in y_fit] + scan["fit"] = model.fit(y_fit, x=x_fit, weights=weights)