diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-07-19 17:10:45 +0200 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-07-19 17:10:45 +0200 |
commit | 40a612ba666f163748cde33009573832154b8117 (patch) | |
tree | 8d0d3300bc6a812f31c5695a70820d0c2015810c | |
parent | 06aba57eba8abbd761e35af81fa900e2fcf5167f (diff) |
Add DFATOOL_ULS_FUNCTIONS variable
-rw-r--r-- | .gitlab-ci.yml | 1 | ||||
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | lib/functions.py | 6 |
3 files changed, 8 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2ce19d1..d8e53cd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,6 +9,7 @@ run_tests: stage: test variables: GIT_SUBMODULE_STRATEGY: normal + DFATOOL_ULS_FUNCTIONS: linear,logarithmic,logarithmic1,exponential,square,inverse,sqrt script: - mkdir test-data - wget -qO test-data/20161221_123347_mmparam.tar https://ess.cs.uos.de/.private/dfatool/20161221_123347_mmparam.tar @@ -134,6 +134,7 @@ The following variables may be set to alter the behaviour of dfatool components. | `DFATOOL_LMT_MAX_BINS` | 10 .. **120** | Number of bins used to determine optimal split. LMT default: 25. | | `DFATOOL_LMT_CRITERION` | **mse**, rmse, mae, poisson | Error metric to use when selecting best split. | | `DFATOOL_ULS_ERROR_METRIC` | **ssr**, rmsd, mae, … | Error metric to use when selecting best-fitting function during unsupervised least squares (ULS) regression. Least squares regression itself minimzes root mean square deviation (rmsd), hence the equivalent (but partitioning-compatible) sum of squared residuals (ssr) is the default. Supports all metrics accepted by `--error-metric`. | +| `DFATOOL_ULS_FUNCTIONS` | a,b,… | List of function templates to use in ULS. Default: all supported functions. | | `DFATOOL_ULS_MIN_DISTINCT_VALUES` | 2 .. **3** .. *n* | Minimum number of unique values a parameter must take to be eligible for ULS | | `DFATOOL_ULS_SKIP_CODEPENDENT_CHECK` | **0**, 1 | Do not detect and remove co-dependent features in ULS. | | `DFATOOL_XGB_N_ESTIMATORS` | 1 .. **100** .. *n* | Number of estimators (i.e., trees) for XGBoost. | diff --git a/lib/functions.py b/lib/functions.py index 0a00f83..ae8283a 100644 --- a/lib/functions.py +++ b/lib/functions.py @@ -2197,6 +2197,12 @@ class analytic: if os.getenv("DFATOOL_RMT_SUBMODEL", "uls") == "fol": functions = {"linear": functions["linear"]} + elif allowed_functions := os.getenv("DFATOOL_ULS_FUNCTIONS", None): + allowed_functions = allowed_functions.split(",") + all_functions = list(functions.keys()) + for function_name in all_functions: + if function_name not in allowed_functions: + functions.pop(function_name) return functions |