endgame-ml 1.0.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.
- endgame/__init__.py +95 -0
- endgame/anomaly/__init__.py +58 -0
- endgame/anomaly/gritbot.py +752 -0
- endgame/anomaly/isolation_forest.py +446 -0
- endgame/anomaly/lof.py +221 -0
- endgame/anomaly/pyod_wrapper.py +388 -0
- endgame/audio/__init__.py +16 -0
- endgame/audio/augmentation.py +239 -0
- endgame/audio/features.py +295 -0
- endgame/audio/pretrained.py +564 -0
- endgame/audio/sed.py +958 -0
- endgame/audio/spectrogram.py +268 -0
- endgame/automl/DEVELOPMENT.md +436 -0
- endgame/automl/__init__.py +176 -0
- endgame/automl/_safe_dim_reduce.py +40 -0
- endgame/automl/audio.py +872 -0
- endgame/automl/base.py +754 -0
- endgame/automl/display.py +393 -0
- endgame/automl/executors/__init__.py +22 -0
- endgame/automl/executors/constraint_check.py +249 -0
- endgame/automl/executors/explainability.py +296 -0
- endgame/automl/executors/hpo.py +215 -0
- endgame/automl/executors/persistence.py +187 -0
- endgame/automl/executors/threshold_opt.py +132 -0
- endgame/automl/guardrails.py +377 -0
- endgame/automl/model_registry.py +1686 -0
- endgame/automl/multimodal.py +1325 -0
- endgame/automl/orchestrator.py +4238 -0
- endgame/automl/predictor.py +610 -0
- endgame/automl/preprocessing/__init__.py +14 -0
- endgame/automl/preprocessing/auto_preprocessor.py +575 -0
- endgame/automl/preprocessing_registry.py +731 -0
- endgame/automl/presets.py +514 -0
- endgame/automl/report.py +468 -0
- endgame/automl/search/__init__.py +47 -0
- endgame/automl/search/adaptive.py +205 -0
- endgame/automl/search/bandit.py +625 -0
- endgame/automl/search/base.py +358 -0
- endgame/automl/search/bayesian.py +610 -0
- endgame/automl/search/genetic.py +959 -0
- endgame/automl/search/heuristic.py +499 -0
- endgame/automl/search/portfolio.py +775 -0
- endgame/automl/search/random.py +385 -0
- endgame/automl/stacker.py +650 -0
- endgame/automl/tabular.py +1670 -0
- endgame/automl/text.py +871 -0
- endgame/automl/time_manager.py +495 -0
- endgame/automl/timeseries.py +759 -0
- endgame/automl/utils/__init__.py +19 -0
- endgame/automl/utils/data_loader.py +509 -0
- endgame/automl/vision.py +1022 -0
- endgame/benchmark/__init__.py +130 -0
- endgame/benchmark/analyzer.py +750 -0
- endgame/benchmark/learning_curve.py +786 -0
- endgame/benchmark/loader.py +573 -0
- endgame/benchmark/metalearner.py +769 -0
- endgame/benchmark/profiler.py +607 -0
- endgame/benchmark/report.py +1217 -0
- endgame/benchmark/runner.py +949 -0
- endgame/benchmark/synthetic.py +519 -0
- endgame/benchmark/tracker.py +911 -0
- endgame/calibration/__init__.py +48 -0
- endgame/calibration/analysis.py +656 -0
- endgame/calibration/conformal.py +1214 -0
- endgame/calibration/scaling.py +554 -0
- endgame/calibration/venn_abers.py +417 -0
- endgame/clustering/__init__.py +99 -0
- endgame/clustering/auto.py +275 -0
- endgame/clustering/centroid.py +424 -0
- endgame/clustering/density.py +436 -0
- endgame/clustering/distribution.py +299 -0
- endgame/clustering/graph.py +184 -0
- endgame/clustering/hierarchical.py +190 -0
- endgame/clustering/scalable.py +261 -0
- endgame/core/__init__.py +55 -0
- endgame/core/base.py +474 -0
- endgame/core/config.py +284 -0
- endgame/core/polars_ops.py +364 -0
- endgame/core/types.py +182 -0
- endgame/dimensionality_reduction/__init__.py +68 -0
- endgame/dimensionality_reduction/linear.py +549 -0
- endgame/dimensionality_reduction/manifold.py +883 -0
- endgame/dimensionality_reduction/vae.py +627 -0
- endgame/ensemble/__init__.py +69 -0
- endgame/ensemble/bagging.py +390 -0
- endgame/ensemble/bayesian_averaging.py +220 -0
- endgame/ensemble/blending.py +690 -0
- endgame/ensemble/boosting.py +385 -0
- endgame/ensemble/cascade.py +244 -0
- endgame/ensemble/distillation.py +355 -0
- endgame/ensemble/hill_climbing.py +310 -0
- endgame/ensemble/multi_output.py +892 -0
- endgame/ensemble/negative_correlation.py +196 -0
- endgame/ensemble/snapshot.py +166 -0
- endgame/ensemble/stacking.py +357 -0
- endgame/ensemble/super_learner.py +290 -0
- endgame/ensemble/threshold.py +307 -0
- endgame/ensemble/voting.py +302 -0
- endgame/explain/__init__.py +172 -0
- endgame/explain/_base.py +349 -0
- endgame/explain/counterfactual.py +271 -0
- endgame/explain/interaction.py +351 -0
- endgame/explain/lime_explainer.py +247 -0
- endgame/explain/pdp.py +251 -0
- endgame/explain/shap_explainer.py +344 -0
- endgame/fairness/__init__.py +57 -0
- endgame/fairness/metrics.py +471 -0
- endgame/fairness/mitigation.py +743 -0
- endgame/fairness/report.py +433 -0
- endgame/feature_selection/__init__.py +100 -0
- endgame/feature_selection/filter/__init__.py +21 -0
- endgame/feature_selection/filter/correlation.py +192 -0
- endgame/feature_selection/filter/mrmr.py +245 -0
- endgame/feature_selection/filter/relief.py +299 -0
- endgame/feature_selection/filter/univariate.py +337 -0
- endgame/feature_selection/importance/__init__.py +11 -0
- endgame/feature_selection/importance/permutation.py +227 -0
- endgame/feature_selection/importance/shap_importance.py +275 -0
- endgame/feature_selection/importance/tree.py +210 -0
- endgame/feature_selection/knockoff.py +322 -0
- endgame/feature_selection/stability.py +253 -0
- endgame/feature_selection/wrapper/__init__.py +13 -0
- endgame/feature_selection/wrapper/boruta.py +311 -0
- endgame/feature_selection/wrapper/genetic.py +350 -0
- endgame/feature_selection/wrapper/rfe.py +195 -0
- endgame/feature_selection/wrapper/sequential.py +255 -0
- endgame/kaggle/__init__.py +71 -0
- endgame/kaggle/client.py +853 -0
- endgame/kaggle/competition.py +675 -0
- endgame/kaggle/project.py +685 -0
- endgame/mcp/__init__.py +19 -0
- endgame/mcp/__main__.py +21 -0
- endgame/mcp/codegen.py +188 -0
- endgame/mcp/resources.py +178 -0
- endgame/mcp/server.py +110 -0
- endgame/mcp/session.py +208 -0
- endgame/mcp/tools/__init__.py +1 -0
- endgame/mcp/tools/_encoding.py +137 -0
- endgame/mcp/tools/_timeout.py +70 -0
- endgame/mcp/tools/advanced.py +304 -0
- endgame/mcp/tools/data.py +275 -0
- endgame/mcp/tools/discover.py +158 -0
- endgame/mcp/tools/evaluate.py +221 -0
- endgame/mcp/tools/export.py +75 -0
- endgame/mcp/tools/predict.py +63 -0
- endgame/mcp/tools/preprocess.py +216 -0
- endgame/mcp/tools/train.py +279 -0
- endgame/mcp/tools/visualize.py +325 -0
- endgame/models/__init__.py +339 -0
- endgame/models/baselines/__init__.py +48 -0
- endgame/models/baselines/discriminant.py +523 -0
- endgame/models/baselines/elm.py +459 -0
- endgame/models/baselines/knn.py +392 -0
- endgame/models/baselines/linear.py +414 -0
- endgame/models/baselines/naive_bayes.py +308 -0
- endgame/models/bayesian/__init__.py +116 -0
- endgame/models/bayesian/base.py +795 -0
- endgame/models/bayesian/classic/__init__.py +12 -0
- endgame/models/bayesian/classic/ebmc.py +538 -0
- endgame/models/bayesian/classic/eskdb.py +698 -0
- endgame/models/bayesian/classic/tan.py +353 -0
- endgame/models/bayesian/neural/__init__.py +14 -0
- endgame/models/bayesian/neural/embeddings.py +392 -0
- endgame/models/bayesian/neural/neural_kdb.py +623 -0
- endgame/models/bayesian/structure/__init__.py +33 -0
- endgame/models/bayesian/structure/autosle.py +577 -0
- endgame/models/bayesian/structure/learning.py +720 -0
- endgame/models/bayesian/structure/scores.py +411 -0
- endgame/models/ebm.py +953 -0
- endgame/models/interpretable/__init__.py +45 -0
- endgame/models/interpretable/corels.py +692 -0
- endgame/models/interpretable/gam.py +637 -0
- endgame/models/interpretable/gami_net.py +1063 -0
- endgame/models/interpretable/gosdt.py +511 -0
- endgame/models/interpretable/node_gam.py +933 -0
- endgame/models/interpretable/slim.py +774 -0
- endgame/models/kernel/__init__.py +25 -0
- endgame/models/kernel/gaussian_process.py +470 -0
- endgame/models/kernel/svm.py +426 -0
- endgame/models/linear/__init__.py +8 -0
- endgame/models/linear/basis.py +343 -0
- endgame/models/linear/mars.py +1374 -0
- endgame/models/linear/tests/__init__.py +1 -0
- endgame/models/linear/tests/test_mars.py +674 -0
- endgame/models/neural/__init__.py +39 -0
- endgame/models/neural/embedding_mlp.py +1001 -0
- endgame/models/neural/mlp.py +798 -0
- endgame/models/neural/tabnet.py +665 -0
- endgame/models/neuroevolution/__init__.py +14 -0
- endgame/models/neuroevolution/neat.py +407 -0
- endgame/models/neuroevolution/tensor_neat.py +346 -0
- endgame/models/ngboost.py +849 -0
- endgame/models/ordinal/__init__.py +19 -0
- endgame/models/ordinal/ordinal.py +536 -0
- endgame/models/probabilistic/__init__.py +8 -0
- endgame/models/probabilistic/bart.py +557 -0
- endgame/models/rules/__init__.py +31 -0
- endgame/models/rules/extraction.py +206 -0
- endgame/models/rules/furia.py +747 -0
- endgame/models/rules/rule.py +392 -0
- endgame/models/rules/rulefit.py +1310 -0
- endgame/models/rules/rulefit_plus.py +1380 -0
- endgame/models/rules/tests/__init__.py +1 -0
- endgame/models/rules/tests/test_rulefit.py +830 -0
- endgame/models/subgroup/__init__.py +21 -0
- endgame/models/subgroup/prim.py +813 -0
- endgame/models/symbolic/__init__.py +18 -0
- endgame/models/symbolic/_constant_optimizer.py +238 -0
- endgame/models/symbolic/_expression.py +323 -0
- endgame/models/symbolic/_operators.py +310 -0
- endgame/models/symbolic/_pareto.py +112 -0
- endgame/models/symbolic/_population.py +352 -0
- endgame/models/symbolic/symbolic_classifier.py +226 -0
- endgame/models/symbolic/symbolic_regressor.py +551 -0
- endgame/models/tabular/__init__.py +258 -0
- endgame/models/tabular/ft_transformer.py +1006 -0
- endgame/models/tabular/gandalf.py +873 -0
- endgame/models/tabular/grande.py +720 -0
- endgame/models/tabular/modern_nca.py +498 -0
- endgame/models/tabular/nam.py +1275 -0
- endgame/models/tabular/node.py +719 -0
- endgame/models/tabular/realmlp.py +1159 -0
- endgame/models/tabular/saint.py +873 -0
- endgame/models/tabular/tab_transformer.py +601 -0
- endgame/models/tabular/tabdpt.py +547 -0
- endgame/models/tabular/tabm.py +1082 -0
- endgame/models/tabular/tabpfn.py +1663 -0
- endgame/models/tabular/tabr.py +1177 -0
- endgame/models/tabular/tabular_resnet.py +565 -0
- endgame/models/tabular/xrfm.py +631 -0
- endgame/models/trees/__init__.py +98 -0
- endgame/models/trees/adtree.py +1665 -0
- endgame/models/trees/c50.py +1057 -0
- endgame/models/trees/c50_rust/Cargo.lock +572 -0
- endgame/models/trees/c50_rust/Cargo.toml +39 -0
- endgame/models/trees/c50_rust/__init__.py +8 -0
- endgame/models/trees/c50_rust/pyproject.toml +13 -0
- endgame/models/trees/c50_rust/src/boost.rs +304 -0
- endgame/models/trees/c50_rust/src/classify.rs +305 -0
- endgame/models/trees/c50_rust/src/info.rs +289 -0
- endgame/models/trees/c50_rust/src/lib.rs +380 -0
- endgame/models/trees/c50_rust/src/prune.rs +387 -0
- endgame/models/trees/c50_rust/src/split.rs +632 -0
- endgame/models/trees/c50_rust/src/tree.rs +355 -0
- endgame/models/trees/c50_rust/src/types.rs +388 -0
- endgame/models/trees/cubist.py +375 -0
- endgame/models/trees/cubist_rust/Cargo.lock +572 -0
- endgame/models/trees/cubist_rust/Cargo.toml +39 -0
- endgame/models/trees/cubist_rust/pyproject.toml +13 -0
- endgame/models/trees/cubist_rust/src/lib.rs +330 -0
- endgame/models/trees/cubist_rust/src/predict.rs +246 -0
- endgame/models/trees/cubist_rust/src/regress.rs +421 -0
- endgame/models/trees/cubist_rust/src/rules.rs +361 -0
- endgame/models/trees/cubist_rust/src/split.rs +400 -0
- endgame/models/trees/cubist_rust/src/tree.rs +363 -0
- endgame/models/trees/cubist_rust/src/types.rs +585 -0
- endgame/models/trees/evtree/__init__.py +11 -0
- endgame/models/trees/evtree/evtree.py +1419 -0
- endgame/models/trees/oblique_forest.py +835 -0
- endgame/models/trees/oblique_splits.py +1105 -0
- endgame/models/trees/oblique_tree.py +964 -0
- endgame/models/trees/quantile_forest.py +807 -0
- endgame/models/trees/rotation_forest.py +455 -0
- endgame/models/wrappers.py +698 -0
- endgame/nlp/__init__.py +99 -0
- endgame/nlp/dapt.py +154 -0
- endgame/nlp/llm.py +758 -0
- endgame/nlp/metrics.py +459 -0
- endgame/nlp/postprocessing.py +530 -0
- endgame/nlp/preprocessing.py +501 -0
- endgame/nlp/pseudo_label.py +191 -0
- endgame/nlp/tokenizer.py +431 -0
- endgame/nlp/transformers.py +339 -0
- endgame/nlp/translation.py +652 -0
- endgame/persistence/__init__.py +30 -0
- endgame/persistence/_backends.py +244 -0
- endgame/persistence/_core.py +125 -0
- endgame/persistence/_detection.py +108 -0
- endgame/persistence/_metadata.py +200 -0
- endgame/persistence/_onnx.py +596 -0
- endgame/persistence/_server.py +302 -0
- endgame/preprocessing/__init__.py +212 -0
- endgame/preprocessing/aggregation.py +470 -0
- endgame/preprocessing/dae.py +590 -0
- endgame/preprocessing/discretize.py +487 -0
- endgame/preprocessing/encoding.py +699 -0
- endgame/preprocessing/imbalance.py +1487 -0
- endgame/preprocessing/imbalance_generative.py +1001 -0
- endgame/preprocessing/imbalance_geometric.py +744 -0
- endgame/preprocessing/imbalance_llm.py +314 -0
- endgame/preprocessing/imputation.py +1020 -0
- endgame/preprocessing/noise_detection.py +520 -0
- endgame/preprocessing/selection.py +415 -0
- endgame/preprocessing/target_transform.py +666 -0
- endgame/preprocessing/temporal.py +434 -0
- endgame/py.typed +0 -0
- endgame/quick/__init__.py +44 -0
- endgame/quick/api.py +769 -0
- endgame/semi_supervised/__init__.py +11 -0
- endgame/semi_supervised/self_training.py +836 -0
- endgame/signal/__init__.py +245 -0
- endgame/signal/base.py +353 -0
- endgame/signal/complexity.py +750 -0
- endgame/signal/connectivity.py +766 -0
- endgame/signal/entropy.py +715 -0
- endgame/signal/features.py +761 -0
- endgame/signal/filtering.py +628 -0
- endgame/signal/spatial.py +683 -0
- endgame/signal/spectral.py +988 -0
- endgame/signal/wavelets.py +784 -0
- endgame/timeseries/__init__.py +166 -0
- endgame/timeseries/base.py +612 -0
- endgame/timeseries/baselines.py +1193 -0
- endgame/timeseries/features.py +573 -0
- endgame/timeseries/neural.py +816 -0
- endgame/timeseries/rocket.py +1033 -0
- endgame/timeseries/statistical.py +684 -0
- endgame/timeseries/validation.py +532 -0
- endgame/tracking/__init__.py +65 -0
- endgame/tracking/base.py +112 -0
- endgame/tracking/console_logger.py +150 -0
- endgame/tracking/mlflow_logger.py +173 -0
- endgame/tune/__init__.py +17 -0
- endgame/tune/optuna.py +349 -0
- endgame/tune/spaces.py +240 -0
- endgame/utils/__init__.py +48 -0
- endgame/utils/metrics.py +315 -0
- endgame/utils/reproducibility.py +214 -0
- endgame/utils/sharpe.py +716 -0
- endgame/utils/submission.py +316 -0
- endgame/validation/__init__.py +34 -0
- endgame/validation/adversarial.py +357 -0
- endgame/validation/cv_utils.py +375 -0
- endgame/validation/nested_cv.py +301 -0
- endgame/validation/splitters.py +916 -0
- endgame/vision/__init__.py +16 -0
- endgame/vision/augmentation.py +515 -0
- endgame/vision/backbone.py +249 -0
- endgame/vision/segmentation.py +539 -0
- endgame/vision/tta.py +225 -0
- endgame/vision/wbf.py +308 -0
- endgame/visualization/__init__.py +133 -0
- endgame/visualization/_base.py +249 -0
- endgame/visualization/_html_template.py +459 -0
- endgame/visualization/_palettes.py +213 -0
- endgame/visualization/_report_template.py +248 -0
- endgame/visualization/arc_diagram.py +237 -0
- endgame/visualization/bar_chart.py +323 -0
- endgame/visualization/box_violin.py +388 -0
- endgame/visualization/bump_chart.py +224 -0
- endgame/visualization/calibration_plot.py +376 -0
- endgame/visualization/chord_diagram.py +241 -0
- endgame/visualization/classification_report.py +865 -0
- endgame/visualization/confusion_matrix.py +306 -0
- endgame/visualization/donut_chart.py +207 -0
- endgame/visualization/dot_matrix.py +171 -0
- endgame/visualization/dumbbell_chart.py +235 -0
- endgame/visualization/error_bars.py +222 -0
- endgame/visualization/flow_chart.py +278 -0
- endgame/visualization/funnel_chart.py +194 -0
- endgame/visualization/gauge_chart.py +275 -0
- endgame/visualization/heatmap.py +281 -0
- endgame/visualization/histogram.py +331 -0
- endgame/visualization/lift_chart.py +287 -0
- endgame/visualization/line_chart.py +322 -0
- endgame/visualization/lollipop_chart.py +258 -0
- endgame/visualization/network_diagram.py +575 -0
- endgame/visualization/nightingale_rose.py +220 -0
- endgame/visualization/parallel_coordinates.py +269 -0
- endgame/visualization/pdp_plot.py +551 -0
- endgame/visualization/pr_curve.py +295 -0
- endgame/visualization/radar_chart.py +209 -0
- endgame/visualization/radial_bar.py +193 -0
- endgame/visualization/regression_report.py +621 -0
- endgame/visualization/ridgeline_plot.py +311 -0
- endgame/visualization/roc_curve.py +307 -0
- endgame/visualization/sankey.py +208 -0
- endgame/visualization/scatterplot.py +304 -0
- endgame/visualization/spiral_plot.py +212 -0
- endgame/visualization/stream_graph.py +231 -0
- endgame/visualization/tree_visualizer.py +1542 -0
- endgame/visualization/treemap.py +392 -0
- endgame/visualization/venn.py +162 -0
- endgame/visualization/waterfall_chart.py +329 -0
- endgame/visualization/word_cloud.py +199 -0
- endgame_ml-1.0.0.dist-info/METADATA +894 -0
- endgame_ml-1.0.0.dist-info/RECORD +389 -0
- endgame_ml-1.0.0.dist-info/WHEEL +4 -0
- endgame_ml-1.0.0.dist-info/licenses/LICENSE +191 -0
endgame/__init__.py
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Endgame: The Competitive Machine Learning Framework
|
|
3
|
+
|
|
4
|
+
Sklearn-Native, Polars-Powered, Victory-Driven.
|
|
5
|
+
|
|
6
|
+
Usage:
|
|
7
|
+
import endgame as eg
|
|
8
|
+
|
|
9
|
+
# Check for train/test drift
|
|
10
|
+
av = eg.validation.AdversarialValidator()
|
|
11
|
+
result = av.check_drift(X_train, X_test)
|
|
12
|
+
|
|
13
|
+
# Feature engineering
|
|
14
|
+
encoder = eg.preprocessing.SafeTargetEncoder()
|
|
15
|
+
X_encoded = encoder.fit_transform(X, y)
|
|
16
|
+
|
|
17
|
+
# Train models
|
|
18
|
+
model = eg.models.LGBMWrapper(preset='endgame')
|
|
19
|
+
model.fit(X_train, y_train)
|
|
20
|
+
|
|
21
|
+
# Ensemble
|
|
22
|
+
ensemble = eg.ensemble.HillClimbingEnsemble(metric='roc_auc')
|
|
23
|
+
ensemble.fit(oof_predictions, y_train)
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
__version__ = "1.0.0"
|
|
27
|
+
|
|
28
|
+
# Note: models imported lazily for heavyweight optional dependencies
|
|
29
|
+
# from endgame import models
|
|
30
|
+
from endgame import (
|
|
31
|
+
anomaly,
|
|
32
|
+
calibration,
|
|
33
|
+
clustering,
|
|
34
|
+
ensemble,
|
|
35
|
+
fairness,
|
|
36
|
+
preprocessing,
|
|
37
|
+
semi_supervised,
|
|
38
|
+
tune,
|
|
39
|
+
utils,
|
|
40
|
+
validation,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
# Lazy imports for heavy modules
|
|
45
|
+
def __getattr__(name: str):
|
|
46
|
+
import importlib
|
|
47
|
+
|
|
48
|
+
# Models and other heavy modules imported lazily for optional dependencies
|
|
49
|
+
if name in ("models", "vision", "nlp", "audio", "benchmark", "kaggle", "quick", "visualization", "persistence", "explain", "tracking", "timeseries", "signal", "automl", "dimensionality_reduction", "feature_selection"):
|
|
50
|
+
module = importlib.import_module(f"endgame.{name}")
|
|
51
|
+
globals()[name] = module
|
|
52
|
+
return module
|
|
53
|
+
if name == "save":
|
|
54
|
+
from endgame.persistence import save
|
|
55
|
+
return save
|
|
56
|
+
if name == "load":
|
|
57
|
+
from endgame.persistence import load
|
|
58
|
+
return load
|
|
59
|
+
if name == "export_onnx":
|
|
60
|
+
from endgame.persistence import export_onnx
|
|
61
|
+
return export_onnx
|
|
62
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
63
|
+
|
|
64
|
+
__all__ = [
|
|
65
|
+
"__version__",
|
|
66
|
+
"validation",
|
|
67
|
+
"preprocessing",
|
|
68
|
+
"models",
|
|
69
|
+
"ensemble",
|
|
70
|
+
"tune",
|
|
71
|
+
"calibration",
|
|
72
|
+
"semi_supervised",
|
|
73
|
+
"anomaly",
|
|
74
|
+
"fairness",
|
|
75
|
+
"clustering",
|
|
76
|
+
"benchmark",
|
|
77
|
+
"vision",
|
|
78
|
+
"nlp",
|
|
79
|
+
"audio",
|
|
80
|
+
"kaggle",
|
|
81
|
+
"utils",
|
|
82
|
+
"quick",
|
|
83
|
+
"visualization",
|
|
84
|
+
"persistence",
|
|
85
|
+
"tracking",
|
|
86
|
+
"timeseries",
|
|
87
|
+
"signal",
|
|
88
|
+
"automl",
|
|
89
|
+
"dimensionality_reduction",
|
|
90
|
+
"feature_selection",
|
|
91
|
+
"save",
|
|
92
|
+
"load",
|
|
93
|
+
"export_onnx",
|
|
94
|
+
"explain",
|
|
95
|
+
]
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"""Anomaly detection module: Isolation Forest, LOF, GritBot, PyOD integration, and more.
|
|
2
|
+
|
|
3
|
+
This module provides sklearn-compatible anomaly detectors with competition-tuned
|
|
4
|
+
defaults, including wrappers for popular algorithms and PyOD integration.
|
|
5
|
+
|
|
6
|
+
Example
|
|
7
|
+
-------
|
|
8
|
+
>>> from endgame.anomaly import IsolationForestDetector, PyODDetector, GritBotDetector
|
|
9
|
+
>>>
|
|
10
|
+
>>> # Simple Isolation Forest
|
|
11
|
+
>>> detector = IsolationForestDetector(contamination=0.1)
|
|
12
|
+
>>> detector.fit(X_train)
|
|
13
|
+
>>> scores = detector.decision_function(X_test) # Higher = more anomalous
|
|
14
|
+
>>> labels = detector.predict(X_test) # 1 = anomaly, 0 = normal
|
|
15
|
+
>>>
|
|
16
|
+
>>> # PyOD wrapper with any algorithm
|
|
17
|
+
>>> detector = PyODDetector(algorithm='ECOD', contamination=0.05)
|
|
18
|
+
>>> detector.fit(X_train)
|
|
19
|
+
>>> scores = detector.decision_function(X_test)
|
|
20
|
+
>>>
|
|
21
|
+
>>> # GritBot: Rule-based with interpretable context
|
|
22
|
+
>>> detector = GritBotDetector(filtering_level=50)
|
|
23
|
+
>>> detector.fit(X_train)
|
|
24
|
+
>>> print(detector.get_anomaly_report()) # Human-readable explanations
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
from endgame.anomaly.gritbot import (
|
|
28
|
+
Anomaly,
|
|
29
|
+
AnomalyContext,
|
|
30
|
+
GritBotDetector,
|
|
31
|
+
)
|
|
32
|
+
from endgame.anomaly.isolation_forest import IsolationForestDetector
|
|
33
|
+
|
|
34
|
+
try:
|
|
35
|
+
from treeple import ExtendedIsolationForest
|
|
36
|
+
except ImportError:
|
|
37
|
+
from endgame.anomaly.isolation_forest import ExtendedIsolationForest
|
|
38
|
+
from endgame.anomaly.lof import LocalOutlierFactorDetector
|
|
39
|
+
from endgame.anomaly.pyod_wrapper import (
|
|
40
|
+
PYOD_ALGORITHMS,
|
|
41
|
+
PyODDetector,
|
|
42
|
+
create_detector_ensemble,
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
__all__ = [
|
|
46
|
+
# Core detectors
|
|
47
|
+
"IsolationForestDetector",
|
|
48
|
+
"ExtendedIsolationForest",
|
|
49
|
+
"LocalOutlierFactorDetector",
|
|
50
|
+
# GritBot (rule-based, interpretable)
|
|
51
|
+
"GritBotDetector",
|
|
52
|
+
"Anomaly",
|
|
53
|
+
"AnomalyContext",
|
|
54
|
+
# PyOD integration
|
|
55
|
+
"PyODDetector",
|
|
56
|
+
"PYOD_ALGORITHMS",
|
|
57
|
+
"create_detector_ensemble",
|
|
58
|
+
]
|