diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2022-01-05 15:56:24 +0100 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2022-01-05 15:56:24 +0100 |
commit | 6e2fa5f36deb9882e5bddb212695434c219c3d94 (patch) | |
tree | 0c47200b6112076d5ae2ce3e58a45a060783b0e2 /lib/functions.py | |
parent | 2c5bcd77f2c952cc5269ca3e4b6e0a7323ebd085 (diff) |
store decision tree attributes of xv models in dataref export
Diffstat (limited to 'lib/functions.py')
-rw-r--r-- | lib/functions.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/functions.py b/lib/functions.py index 320e8ed..5358d8e 100644 --- a/lib/functions.py +++ b/lib/functions.py @@ -339,6 +339,13 @@ class SplitFunction(ModelFunction): ret += 1 return ret + def get_max_depth(self): + ret = [0] + for v in self.child.values(): + if type(v) is SplitFunction: + ret.append(v.get_max_depth()) + return 1 + max(ret) + @classmethod def from_json(cls, data): assert data["type"] == "split" |