tributo-algorithms 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. tributo_algorithms-0.1.0.dist-info/METADATA +328 -0
  2. tributo_algorithms-0.1.0.dist-info/RECORD +110 -0
  3. tributo_algorithms-0.1.0.dist-info/WHEEL +4 -0
  4. tributo_algorithms-0.1.0.dist-info/entry_points.txt +57 -0
  5. tributo_algorithms-0.1.0.dist-info/licenses/LICENSE +202 -0
  6. tributo_algorithms_boosting/__init__.py +42 -0
  7. tributo_algorithms_boosting/algorithm.py +825 -0
  8. tributo_algorithms_boosting/checkpointing.py +441 -0
  9. tributo_algorithms_boosting/contracts.py +232 -0
  10. tributo_algorithms_boosting/data_config.py +59 -0
  11. tributo_algorithms_boosting/descriptor.py +124 -0
  12. tributo_algorithms_boosting/lightgbm.py +511 -0
  13. tributo_algorithms_boosting/lightgbm_contracts.py +186 -0
  14. tributo_algorithms_boosting/lightgbm_descriptor.py +112 -0
  15. tributo_algorithms_boosting/native.py +557 -0
  16. tributo_algorithms_boosting/stages.py +150 -0
  17. tributo_algorithms_catboost/__init__.py +5 -0
  18. tributo_algorithms_catboost/algorithm.py +379 -0
  19. tributo_algorithms_catboost/contracts.py +145 -0
  20. tributo_algorithms_catboost/descriptor.py +121 -0
  21. tributo_algorithms_catboost/exporter.py +106 -0
  22. tributo_algorithms_catboost/flavor.py +191 -0
  23. tributo_algorithms_causal_core/__init__.py +41 -0
  24. tributo_algorithms_causal_core/algorithm.py +1193 -0
  25. tributo_algorithms_causal_core/contracts.py +136 -0
  26. tributo_algorithms_causal_core/descriptor.py +270 -0
  27. tributo_algorithms_causal_core/exporter.py +52 -0
  28. tributo_algorithms_causal_discovery/__init__.py +23 -0
  29. tributo_algorithms_causal_discovery/algorithm.py +526 -0
  30. tributo_algorithms_causal_discovery/contracts.py +97 -0
  31. tributo_algorithms_causal_discovery/descriptor.py +130 -0
  32. tributo_algorithms_causal_discovery/exporter.py +43 -0
  33. tributo_algorithms_causal_dowhy/__init__.py +38 -0
  34. tributo_algorithms_causal_dowhy/algorithm.py +325 -0
  35. tributo_algorithms_causal_dowhy/contracts.py +209 -0
  36. tributo_algorithms_causal_dowhy/descriptor.py +106 -0
  37. tributo_algorithms_causal_dowhy/exporter.py +43 -0
  38. tributo_algorithms_causal_dowhy/gcm.py +634 -0
  39. tributo_algorithms_causal_dowhy/gcm_descriptor.py +110 -0
  40. tributo_algorithms_causal_dr/__init__.py +22 -0
  41. tributo_algorithms_causal_dr/algorithm.py +446 -0
  42. tributo_algorithms_causal_dr/contracts.py +94 -0
  43. tributo_algorithms_causal_dr/descriptor.py +104 -0
  44. tributo_algorithms_causal_xlearner/__init__.py +29 -0
  45. tributo_algorithms_causal_xlearner/algorithm.py +448 -0
  46. tributo_algorithms_causal_xlearner/contracts.py +97 -0
  47. tributo_algorithms_causal_xlearner/descriptor.py +120 -0
  48. tributo_algorithms_causal_xlearner/exporter.py +432 -0
  49. tributo_algorithms_causal_xlearner/flavor.py +120 -0
  50. tributo_algorithms_causal_xlearner/model.py +116 -0
  51. tributo_algorithms_classical/__init__.py +41 -0
  52. tributo_algorithms_classical/contracts.py +139 -0
  53. tributo_algorithms_classical/descriptors.py +370 -0
  54. tributo_algorithms_classical/exporter.py +166 -0
  55. tributo_algorithms_classical/isolation_forest.py +172 -0
  56. tributo_algorithms_classical/isolation_forest_descriptor.py +122 -0
  57. tributo_algorithms_classical/kmeans.py +315 -0
  58. tributo_algorithms_classical/kmeans_descriptor.py +147 -0
  59. tributo_algorithms_classical/linear_regression.py +206 -0
  60. tributo_algorithms_classical/logistic_regression.py +238 -0
  61. tributo_algorithms_classical/models.py +28 -0
  62. tributo_algorithms_classical/multinomial_nb.py +643 -0
  63. tributo_algorithms_classical/multinomial_nb_descriptor.py +183 -0
  64. tributo_algorithms_classical/pca.py +187 -0
  65. tributo_algorithms_classical/pca_descriptor.py +111 -0
  66. tributo_algorithms_classical/random_forest.py +304 -0
  67. tributo_algorithms_classical/sgd.py +331 -0
  68. tributo_algorithms_classical/sgd_contracts.py +121 -0
  69. tributo_algorithms_classical/sgd_descriptor.py +143 -0
  70. tributo_algorithms_classical/unsupervised_contracts.py +198 -0
  71. tributo_algorithms_classical/unsupervised_exporter.py +427 -0
  72. tributo_algorithms_classical/unsupervised_models.py +90 -0
  73. tributo_algorithms_graph_pyg/__init__.py +37 -0
  74. tributo_algorithms_graph_pyg/algorithm.py +883 -0
  75. tributo_algorithms_graph_pyg/contracts.py +260 -0
  76. tributo_algorithms_graph_pyg/descriptor.py +201 -0
  77. tributo_algorithms_multistage_torch/__init__.py +40 -0
  78. tributo_algorithms_multistage_torch/algorithm.py +532 -0
  79. tributo_algorithms_multistage_torch/contracts.py +220 -0
  80. tributo_algorithms_multistage_torch/descriptor.py +146 -0
  81. tributo_algorithms_multistage_torch/pretrain.py +570 -0
  82. tributo_algorithms_multistage_torch/pretrain_descriptor.py +153 -0
  83. tributo_algorithms_recsys_torch/__init__.py +35 -0
  84. tributo_algorithms_recsys_torch/contracts.py +295 -0
  85. tributo_algorithms_recsys_torch/descriptor.py +136 -0
  86. tributo_algorithms_recsys_torch/jagged.py +707 -0
  87. tributo_algorithms_recsys_torch/jagged_descriptor.py +130 -0
  88. tributo_algorithms_recsys_torch/recipe.py +192 -0
  89. tributo_algorithms_representation/__init__.py +20 -0
  90. tributo_algorithms_representation/contracts.py +117 -0
  91. tributo_algorithms_representation/descriptor.py +137 -0
  92. tributo_algorithms_representation/recipe.py +162 -0
  93. tributo_algorithms_tabular_torch/__init__.py +46 -0
  94. tributo_algorithms_tabular_torch/contracts.py +228 -0
  95. tributo_algorithms_tabular_torch/descriptor.py +223 -0
  96. tributo_algorithms_tabular_torch/priors.py +216 -0
  97. tributo_algorithms_tabular_torch/pu_metrics.py +269 -0
  98. tributo_algorithms_tabular_torch/pu_reducer.py +129 -0
  99. tributo_algorithms_tabular_torch/recipe.py +294 -0
  100. tributo_algorithms_timeseries/__init__.py +36 -0
  101. tributo_algorithms_timeseries/contracts.py +120 -0
  102. tributo_algorithms_timeseries/descriptor.py +137 -0
  103. tributo_algorithms_timeseries/recipe.py +195 -0
  104. tributo_algorithms_timeseries/rnn_contracts.py +170 -0
  105. tributo_algorithms_timeseries/rnn_descriptor.py +167 -0
  106. tributo_algorithms_timeseries/rnn_recipe.py +223 -0
  107. tributo_algorithms_transformers_nlp/__init__.py +20 -0
  108. tributo_algorithms_transformers_nlp/contracts.py +109 -0
  109. tributo_algorithms_transformers_nlp/descriptor.py +137 -0
  110. tributo_algorithms_transformers_nlp/recipe.py +235 -0
@@ -0,0 +1,166 @@
1
+ """ONNX Bundle exporter shared by official sklearn algorithms."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ from collections.abc import Mapping
7
+
8
+ from tributo.algorithms.api import (
9
+ AlgorithmConfigurationError,
10
+ AlgorithmExecutionError,
11
+ AlgorithmExecutionResult,
12
+ ArtifactDraft,
13
+ ResolvedAlgorithmPlan,
14
+ )
15
+ from tributo.util.annotations import PublicAPI
16
+
17
+ from tributo_algorithms_classical.models import SklearnModel
18
+
19
+
20
+ @PublicAPI(stability="alpha")
21
+ def export_sklearn_model(
22
+ *,
23
+ model: SklearnModel,
24
+ plan: ResolvedAlgorithmPlan,
25
+ run_id: str | None = None,
26
+ ) -> AlgorithmExecutionResult:
27
+ """Export a fitted sklearn model through Tributo's existing Bundle service."""
28
+ from skl2onnx import convert_sklearn
29
+ from skl2onnx.common.data_types import FloatTensorType
30
+ from sklearn import __version__ as sklearn_version
31
+
32
+ if not isinstance(model, SklearnModel):
33
+ raise AlgorithmExecutionError("classical exporter received an invalid model")
34
+ try:
35
+ converted = convert_sklearn(
36
+ model.estimator,
37
+ initial_types=[
38
+ ("float_input", FloatTensorType([None, len(model.feature_names)]))
39
+ ],
40
+ options=(
41
+ {id(model.estimator): {"zipmap": False}}
42
+ if model.task == "classification"
43
+ else None
44
+ ),
45
+ target_opset=18,
46
+ )
47
+ converted.graph.name = f"tributo-{plan.resolution.algorithm}"
48
+ converted.doc_string = ""
49
+ for node in converted.graph.node:
50
+ node.doc_string = ""
51
+ for name, value in sorted(
52
+ {
53
+ "feature_names": json.dumps(model.feature_names),
54
+ "distribution_spec_digest": plan.runtime.distribution_digest or "",
55
+ }.items()
56
+ ):
57
+ item = converted.metadata_props.add()
58
+ item.key = name
59
+ item.value = value
60
+ payload = converted.SerializeToString()
61
+ except Exception as exc:
62
+ raise AlgorithmExecutionError(
63
+ f"classical ONNX export failed: {type(exc).__name__}"
64
+ ) from exc
65
+ artifact = ArtifactDraft.from_payload(
66
+ name="model",
67
+ kind="model",
68
+ format="application/onnx",
69
+ payload=payload,
70
+ )
71
+ output = plan.algorithm_config.get("output")
72
+ if not isinstance(output, Mapping):
73
+ raise AlgorithmConfigurationError("classical fit requires output config")
74
+ bundle_uri = output.get("bundle_uri")
75
+ if not isinstance(bundle_uri, str) or not bundle_uri:
76
+ raise AlgorithmConfigurationError("output.bundle_uri must be non-empty")
77
+ from tributo.exporting.models import (
78
+ BundleOutputConfig,
79
+ CheckpointField,
80
+ ExportCheckpointV1,
81
+ ExportSource,
82
+ ExportTarget,
83
+ )
84
+ from tributo.exporting.service import BundleExportService
85
+
86
+ class_count = len(getattr(model.estimator, "classes_", ()))
87
+ if model.task == "classification" and class_count < 2:
88
+ raise AlgorithmExecutionError(
89
+ "classification estimator must expose at least two classes"
90
+ )
91
+
92
+ source = ExportSource(
93
+ source_kind="prebuilt_onnx",
94
+ model_object=payload,
95
+ feature_schema={"feature_names": list(model.feature_names)},
96
+ metadata={
97
+ "framework": "sklearn",
98
+ "framework_versions": {"scikit-learn": sklearn_version},
99
+ "task_type": model.task,
100
+ "producer_distribution": "tributo-algorithms",
101
+ },
102
+ source_fingerprint=artifact.sha256,
103
+ checkpoint_contract=ExportCheckpointV1(
104
+ trainer_type="sklearn",
105
+ architecture_id=plan.resolution.algorithm,
106
+ input_schema=(
107
+ CheckpointField(
108
+ name="float_input",
109
+ dtype="float32",
110
+ shape=("batch", len(model.feature_names)),
111
+ ),
112
+ ),
113
+ output_schema=(
114
+ CheckpointField(
115
+ name=("label" if model.task == "classification" else "variable"),
116
+ dtype=("int64" if model.task == "classification" else "float32"),
117
+ shape=("batch", 1)
118
+ if model.task != "classification"
119
+ else ("batch",),
120
+ ),
121
+ *(
122
+ (
123
+ CheckpointField(
124
+ name="probabilities",
125
+ dtype="float32",
126
+ shape=("batch", class_count),
127
+ ),
128
+ )
129
+ if model.task == "classification"
130
+ else ()
131
+ ),
132
+ ),
133
+ task_type=model.task,
134
+ framework="sklearn",
135
+ framework_version=sklearn_version,
136
+ ),
137
+ )
138
+ bundle = BundleExportService().export_bundle(
139
+ source,
140
+ BundleOutputConfig(
141
+ bundle_uri=bundle_uri,
142
+ request_id=run_id,
143
+ run_id=run_id,
144
+ targets=[
145
+ ExportTarget(
146
+ name="onnx-model",
147
+ format="onnx",
148
+ exporter_id="prebuilt-onnx-v1",
149
+ )
150
+ ],
151
+ roles={"inference": "onnx-model"},
152
+ ),
153
+ )
154
+ return AlgorithmExecutionResult(
155
+ status="succeeded",
156
+ outputs={
157
+ "bundle_id": bundle.bundle_id,
158
+ "bundle_uri": bundle.canonical_uri,
159
+ "execution_id": bundle.execution_id,
160
+ "manifest_sha256": bundle.manifest_sha256,
161
+ },
162
+ artifacts=(artifact,),
163
+ )
164
+
165
+
166
+ __all__ = ["export_sklearn_model"]
@@ -0,0 +1,172 @@
1
+ """Conditional distributed Isolation Forest parallel-ensemble algorithm."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import pickle
6
+ from collections.abc import Mapping
7
+ from typing import Any, cast
8
+
9
+ import numpy as np
10
+ from tributo.algorithms import EnsembleUnitSpec, ParallelEnsembleAlgorithm
11
+ from tributo.algorithms.api import (
12
+ AlgorithmConfigurationError,
13
+ AlgorithmExecutionError,
14
+ AlgorithmInputError,
15
+ ResolvedAlgorithmPlan,
16
+ )
17
+ from tributo.algorithms.spi import (
18
+ AlgorithmExecutionContext,
19
+ MaterializedTabularInputView,
20
+ )
21
+
22
+ from tributo_algorithms_classical.unsupervised_models import IsolationForestModel
23
+
24
+
25
+ class _CheckpointCodec:
26
+ def dumps(self, value: object) -> bytes:
27
+ return pickle.dumps(value, protocol=5)
28
+
29
+ def loads(self, payload: bytes) -> object:
30
+ return pickle.loads(payload)
31
+
32
+
33
+ def _arrays(inputs: Mapping[str, object]) -> tuple[np.ndarray, tuple[str, ...]]:
34
+ view = cast(MaterializedTabularInputView, inputs["train"])
35
+ columns = view.columns()
36
+ values = np.column_stack(
37
+ [np.asarray(columns[name], dtype=np.float64) for name in view.feature_names]
38
+ )
39
+ if not values.shape[0] or not np.isfinite(values).all():
40
+ raise AlgorithmInputError("Isolation Forest input must contain finite rows")
41
+ return values, tuple(view.feature_names)
42
+
43
+
44
+ class IsolationForestEnsemble(
45
+ ParallelEnsembleAlgorithm[IsolationForestModel, IsolationForestModel]
46
+ ):
47
+ """Train independent one-tree forests and combine them conditionally."""
48
+
49
+ def __init__(self, plan: ResolvedAlgorithmPlan) -> None:
50
+ self._plan = plan
51
+ self._feature_names = plan.primary_input_binding.feature_names
52
+
53
+ def plan_units(
54
+ self,
55
+ config: Mapping[str, Any],
56
+ input_descriptor: object,
57
+ seed: int,
58
+ ) -> tuple[EnsembleUnitSpec, ...]:
59
+ del input_descriptor
60
+ count = int(config.get("unit_count", config.get("n_estimators", 100)))
61
+ if count < 1:
62
+ raise AlgorithmConfigurationError(
63
+ "Isolation Forest n_estimators must be positive"
64
+ )
65
+ return tuple(
66
+ EnsembleUnitSpec(
67
+ unit_id=f"isolation-tree-{index}",
68
+ seed=seed + index,
69
+ payload={},
70
+ )
71
+ for index in range(count)
72
+ )
73
+
74
+ def fit_unit(
75
+ self,
76
+ unit: EnsembleUnitSpec,
77
+ inputs: Mapping[str, object],
78
+ context: AlgorithmExecutionContext,
79
+ ) -> IsolationForestModel:
80
+ del context
81
+ from sklearn.ensemble import IsolationForest
82
+
83
+ values, feature_names = _arrays(inputs)
84
+ config = self._plan.algorithm_config
85
+ estimator = IsolationForest(
86
+ n_estimators=1,
87
+ max_samples=config.get("max_samples", "auto"),
88
+ contamination=config.get("contamination", "auto"),
89
+ random_state=unit.seed,
90
+ n_jobs=1,
91
+ )
92
+ estimator.fit(values)
93
+ training_values = values if unit.unit_id == "isolation-tree-0" else None
94
+ return IsolationForestModel(
95
+ estimator,
96
+ feature_names,
97
+ training_values,
98
+ )
99
+
100
+ def merge_units(self, ordered_units: tuple[IsolationForestModel, ...]) -> object:
101
+ return ordered_units
102
+
103
+ def finalize_ensemble(self, merged: object) -> IsolationForestModel:
104
+ units = cast(tuple[IsolationForestModel, ...], merged)
105
+ if not units:
106
+ raise AlgorithmExecutionError("Isolation Forest requires fitted units")
107
+ first = units[0]
108
+ if any(unit.feature_names != first.feature_names for unit in units):
109
+ raise AlgorithmExecutionError(
110
+ "Isolation Forest unit metadata is inconsistent"
111
+ )
112
+ from sklearn.ensemble import IsolationForest
113
+
114
+ model = IsolationForest(
115
+ n_estimators=len(units),
116
+ contamination=cast(Any, first.estimator).contamination,
117
+ n_jobs=1,
118
+ )
119
+ estimators = [cast(Any, unit.estimator).estimators_[0] for unit in units]
120
+ model.estimators_ = estimators
121
+ model.estimators_features_ = [
122
+ np.arange(len(first.feature_names)) for _ in estimators
123
+ ]
124
+ model.max_samples_ = int(cast(Any, first.estimator).max_samples_)
125
+ model._max_samples = model.max_samples_
126
+ model.n_features_in_ = len(first.feature_names)
127
+ model._max_features = len(first.feature_names)
128
+ model._decision_path_lengths = tuple(
129
+ cast(Any, unit.estimator)._decision_path_lengths[0] for unit in units
130
+ )
131
+ model._average_path_length_per_tree = tuple(
132
+ cast(Any, unit.estimator)._average_path_length_per_tree[0] for unit in units
133
+ )
134
+ model.offset_ = float(cast(Any, first.estimator).offset_)
135
+ contamination = cast(Any, first.estimator).contamination
136
+ if contamination != "auto":
137
+ training_values = first.training_values
138
+ if training_values is None:
139
+ raise AlgorithmExecutionError(
140
+ "Isolation Forest threshold calibration data is missing"
141
+ )
142
+ scores = model.score_samples(training_values)
143
+ model.offset_ = float(np.quantile(scores, float(contamination)))
144
+ model.n_estimators = len(estimators)
145
+ model.max_samples = cast(Any, first.estimator).max_samples
146
+ return IsolationForestModel(model, first.feature_names)
147
+
148
+ def unit_schema(self) -> Mapping[str, object]:
149
+ return {
150
+ "estimator": "sklearn.ensemble.IsolationForest",
151
+ "feature_names": "tuple[str]",
152
+ }
153
+
154
+ @property
155
+ def retry_safe(self) -> bool:
156
+ return True
157
+
158
+
159
+ def create_algorithm(
160
+ *,
161
+ plan: ResolvedAlgorithmPlan,
162
+ implementation: object,
163
+ artifacts: tuple[object, ...],
164
+ ) -> IsolationForestEnsemble:
165
+ """Construct the descriptor-selected Isolation Forest implementation."""
166
+ del artifacts
167
+ if implementation is not IsolationForestEnsemble:
168
+ raise AlgorithmConfigurationError("Isolation Forest implementation drifted")
169
+ return IsolationForestEnsemble(plan)
170
+
171
+
172
+ __all__ = ["IsolationForestEnsemble", "create_algorithm"]
@@ -0,0 +1,122 @@
1
+ """Descriptor for the official distributed Isolation Forest."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from tributo.algorithms import AlgorithmBuilder
6
+ from tributo.algorithms.api import (
7
+ ContractBinding,
8
+ ContractBindingSet,
9
+ DistributedExactness,
10
+ DistributionStrategy,
11
+ EnvironmentSpec,
12
+ ExecutionMode,
13
+ ExecutionProfile,
14
+ ParallelEnsemblePolicy,
15
+ QualifiedReference,
16
+ WorkerRange,
17
+ WorkerResources,
18
+ )
19
+ from tributo.training.algorithm_spec import (
20
+ AlgorithmSpec,
21
+ Capability,
22
+ DataLoadingMode,
23
+ ProblemType,
24
+ )
25
+
26
+ _PACKAGE = "tributo-algorithms"
27
+ _VERSION = "0.1.0"
28
+ _INPUT = "tributo.official.tabular.unlabeled_dense.v1"
29
+ _OUTPUT = "tributo.official.unsupervised.isolation_forest.anomaly.v1"
30
+
31
+
32
+ def _binding(contract_id: str, digest: str, validator: str) -> ContractBinding:
33
+ return ContractBinding(
34
+ contract_id=contract_id,
35
+ schema_version=1,
36
+ schema_digest=digest * 64,
37
+ validator_ref=QualifiedReference.parse(
38
+ f"tributo_algorithms_classical.unsupervised_contracts:{validator}"
39
+ ),
40
+ )
41
+
42
+
43
+ _SPEC = AlgorithmSpec(
44
+ name="isolation_forest",
45
+ trainer_cls=None,
46
+ version="1.0.0",
47
+ default_config={"n_estimators": 100, "contamination": "auto"},
48
+ supported_tasks=("fit",),
49
+ operations=("fit",),
50
+ data_loading=DataLoadingMode.CANONICAL_DRIVER,
51
+ problem_types=(ProblemType.ANOMALY_DETECTION,),
52
+ capabilities=(Capability.DISTRIBUTED, Capability.EXPORTABLE, Capability.TUNABLE),
53
+ learning_paradigm="unsupervised",
54
+ model_family="isolation_forest",
55
+ data_modalities=("tabular",),
56
+ lifecycle_kind="batch_fit",
57
+ allowed_execution_modes=(ExecutionMode.PARALLEL_ENSEMBLE.value,),
58
+ config_contract_ref="tributo.official.unsupervised.isolation_forest.config.v1",
59
+ input_contract_ref=_INPUT,
60
+ output_contract_ref=_OUTPUT,
61
+ )
62
+
63
+ ISOLATION_FOREST_DESCRIPTOR = AlgorithmBuilder.from_distributed_algorithm(
64
+ spec=_SPEC,
65
+ implementation_id="tributo.official.classical.isolation_forest.parallel_ensemble",
66
+ implementation_version="1.0.0",
67
+ implementation="tributo_algorithms_classical.isolation_forest:IsolationForestEnsemble",
68
+ executable_factory="tributo_algorithms_classical.isolation_forest:create_algorithm",
69
+ distribution=_PACKAGE,
70
+ framework="sklearn",
71
+ environment=EnvironmentSpec(
72
+ environment_id="tributo.official.classical.unsupervised.v1",
73
+ dependencies=(
74
+ "numpy>=2,<3",
75
+ "onnx>=1.16",
76
+ "onnxruntime>=1.20",
77
+ "scikit-learn>=1.4,<2",
78
+ "skl2onnx>=1.17",
79
+ "tributo>=1.1",
80
+ f"tributo-algorithms[classical]=={_VERSION}",
81
+ ),
82
+ ),
83
+ allowed_config_keys=(
84
+ "contamination",
85
+ "max_samples",
86
+ "n_estimators",
87
+ "output",
88
+ "runtime",
89
+ "seed",
90
+ "unit_count",
91
+ ),
92
+ strategy=DistributionStrategy.RAY_PARALLEL_ENSEMBLE,
93
+ supported_worker_range=WorkerRange(2, 256),
94
+ supported_execution_profiles=(ExecutionProfile.LOCAL, ExecutionProfile.CLUSTER),
95
+ resources_per_worker=WorkerResources(num_cpus=1),
96
+ policy=ParallelEnsemblePolicy(
97
+ max_units=4096,
98
+ max_retries=1,
99
+ exactness=DistributedExactness.CONDITIONAL,
100
+ ),
101
+ package_name=_PACKAGE,
102
+ package_version=_VERSION,
103
+ tributo_version_spec=">=1.1",
104
+ exporter="tributo_algorithms_classical.unsupervised_exporter:export_isolation_forest_model",
105
+ flavor_id="onnx-runtime-v1",
106
+ contract_bindings=ContractBindingSet(
107
+ config=_binding(
108
+ _SPEC.config_contract_ref or "", "6", "UnsupervisedConfigValidator"
109
+ ),
110
+ input=_binding(_INPUT, "7", "UnlabeledDenseInputValidator"),
111
+ output=_binding(_OUTPUT, "b", "IsolationForestOutputValidator"),
112
+ coverage=_binding(
113
+ "tributo.official.distributed.coverage.v1",
114
+ "a",
115
+ "UnsupervisedCoverageValidator",
116
+ ),
117
+ ),
118
+ descriptor_api_version=2,
119
+ is_default=True,
120
+ )
121
+
122
+ __all__ = ["ISOLATION_FOREST_DESCRIPTOR"]