summaryrefslogtreecommitdiff
path: root/lib/functions.py
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2021-11-03 13:57:08 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2021-11-03 13:57:08 +0100
commit177a7e332dfc33d06b04b6c596c47d8427dbea94 (patch)
tree718026d53822c2661dd8ab7ea9cbeeedb9d0bcbd /lib/functions.py
parent3a351ccaae5d497f5c6e6b6288620f88cc0c6e33 (diff)
Set DFATOOL_FIT_LINEAR_ONLY=1 to omit non-linear functions from regression
Diffstat (limited to 'lib/functions.py')
-rw-r--r--lib/functions.py40
1 files changed, 22 insertions, 18 deletions
diff --git a/lib/functions.py b/lib/functions.py
index 86025dc..7cd06c0 100644
--- a/lib/functions.py
+++ b/lib/functions.py
@@ -8,6 +8,7 @@ regression and general handling of model functions.
from itertools import chain, combinations
import logging
import numpy as np
+import os
import re
from scipy import optimize
from .utils import is_numeric
@@ -719,24 +720,24 @@ class analytic:
lambda model_param: model_param >= 0,
2,
),
- "num0_8": ParamFunction(
- lambda reg_param, model_param: reg_param[0]
- + reg_param[1] * analytic._num0_8(model_param),
- lambda model_param: True,
- 2,
- ),
- "num0_16": ParamFunction(
- lambda reg_param, model_param: reg_param[0]
- + reg_param[1] * analytic._num0_16(model_param),
- lambda model_param: True,
- 2,
- ),
- "num1": ParamFunction(
- lambda reg_param, model_param: reg_param[0]
- + reg_param[1] * analytic._num1(model_param),
- lambda model_param: True,
- 2,
- ),
+ # "num0_8": ParamFunction(
+ # lambda reg_param, model_param: reg_param[0]
+ # + reg_param[1] * analytic._num0_8(model_param),
+ # lambda model_param: True,
+ # 2,
+ # ),
+ # "num0_16": ParamFunction(
+ # lambda reg_param, model_param: reg_param[0]
+ # + reg_param[1] * analytic._num0_16(model_param),
+ # lambda model_param: True,
+ # 2,
+ # ),
+ # "num1": ParamFunction(
+ # lambda reg_param, model_param: reg_param[0]
+ # + reg_param[1] * analytic._num1(model_param),
+ # lambda model_param: True,
+ # 2,
+ # ),
}
if safe_functions_enabled:
@@ -759,6 +760,9 @@ class analytic:
2,
)
+ if bool(int(os.getenv("DFATOOL_FIT_LINEAR_ONLY", "0"))):
+ functions = {"linear": functions["linear"]}
+
return functions
@staticmethod