Coverage for tadkit/catalog/learners/_confiance_components/_tdaad_wrapper.py: 14%
14 statements
« prev ^ index » next coverage.py v7.10.6, created at 2025-09-04 15:09 +0000
« prev ^ index » next coverage.py v7.10.6, created at 2025-09-04 15:09 +0000
1def get_wrapped_topolad_pp():
2 """Returns the TADlearner wrapped from the TopologicalAnomalyDetector method of the tdaad framework.
4 The function is intended for use if the dependency is available.
5 This plus plus version is meant to remove the explicit heritage (through factory).
6 """
8 from tdaad.anomaly_detectors import TopologicalAnomalyDetector
10 # We look at constraints and infer distribution as basis for inquiry.
11 params_description = {
12 param: description[0]
13 for param, description in TopologicalAnomalyDetector._parameter_constraints.items()
14 }
15 params_description.pop("store_precision")
16 params_description.pop("assume_centered")
17 params_description.pop("random_state")
18 params_description.pop("contamination")
19 params_description["support_fraction"] = {
20 "description": "Support fraction for the MinCovDet estimation"
21 + ":"
22 + str(params_description["support_fraction"]),
23 "value_type": "real_range",
24 "start": 0.01,
25 "stop": 1.0,
26 "step": 0.1,
27 "default": 0.5,
28 }
29 params_description["window_size"] = {
30 "description": "Window size for the time-delay embedding"
31 + ":"
32 + str(params_description["window_size"]),
33 "value_type": "range",
34 "start": 10,
35 "stop": 1000,
36 "step": 10,
37 "default": 100,
38 }
39 params_description["step"] = {
40 "description": "Step size for the time-delay embedding"
41 + ":"
42 + str(params_description["step"]),
43 "value_type": "range",
44 "start": 10,
45 "stop": 100,
46 "step": 10,
47 "default": 10,
48 }
49 params_description["tda_max_dim"] = {
50 "description": "Compute persistence in all homology dimension including this tda_max_dim"
51 + ":"
52 + str(params_description["tda_max_dim"]),
53 "value_type": "range",
54 "start": 0,
55 "stop": 3,
56 "step": 1,
57 "default": 1,
58 }
59 params_description["n_centers_by_dim"] = {
60 "description": "Size of the vectorization per homology dimension"
61 + ":"
62 + str(params_description["n_centers_by_dim"]),
63 "value_type": "range",
64 "start": 2,
65 "stop": 20,
66 "step": 1,
67 "default": 2,
68 }
69 TopologicalAnomalyDetector.params_description = params_description
71 return TopologicalAnomalyDetector