nikodym 0.9.0__tar.gz
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.
- nikodym-0.9.0/.gitignore +68 -0
- nikodym-0.9.0/CHANGELOG.md +59 -0
- nikodym-0.9.0/LICENSE +201 -0
- nikodym-0.9.0/PKG-INFO +211 -0
- nikodym-0.9.0/README.md +108 -0
- nikodym-0.9.0/pyproject.toml +212 -0
- nikodym-0.9.0/src/nikodym/__init__.py +37 -0
- nikodym-0.9.0/src/nikodym/api.py +167 -0
- nikodym-0.9.0/src/nikodym/audit/__init__.py +35 -0
- nikodym-0.9.0/src/nikodym/audit/config.py +44 -0
- nikodym-0.9.0/src/nikodym/audit/environment.py +101 -0
- nikodym-0.9.0/src/nikodym/audit/exceptions.py +9 -0
- nikodym-0.9.0/src/nikodym/audit/hashing.py +59 -0
- nikodym-0.9.0/src/nikodym/audit/replay.py +52 -0
- nikodym-0.9.0/src/nikodym/audit/sink.py +76 -0
- nikodym-0.9.0/src/nikodym/binning/__init__.py +61 -0
- nikodym-0.9.0/src/nikodym/binning/config.py +536 -0
- nikodym-0.9.0/src/nikodym/binning/exceptions.py +17 -0
- nikodym-0.9.0/src/nikodym/binning/results.py +124 -0
- nikodym-0.9.0/src/nikodym/binning/step.py +700 -0
- nikodym-0.9.0/src/nikodym/binning/transformer.py +1098 -0
- nikodym-0.9.0/src/nikodym/calibration/__init__.py +73 -0
- nikodym-0.9.0/src/nikodym/calibration/calibrator.py +1212 -0
- nikodym-0.9.0/src/nikodym/calibration/config.py +427 -0
- nikodym-0.9.0/src/nikodym/calibration/exceptions.py +45 -0
- nikodym-0.9.0/src/nikodym/calibration/results.py +282 -0
- nikodym-0.9.0/src/nikodym/calibration/step.py +520 -0
- nikodym-0.9.0/src/nikodym/core/__init__.py +142 -0
- nikodym-0.9.0/src/nikodym/core/artifacts.py +73 -0
- nikodym-0.9.0/src/nikodym/core/audit.py +126 -0
- nikodym-0.9.0/src/nikodym/core/base.py +188 -0
- nikodym-0.9.0/src/nikodym/core/config/__init__.py +31 -0
- nikodym-0.9.0/src/nikodym/core/config/hashing.py +42 -0
- nikodym-0.9.0/src/nikodym/core/config/loader.py +97 -0
- nikodym-0.9.0/src/nikodym/core/config/migration.py +144 -0
- nikodym-0.9.0/src/nikodym/core/config/schema.py +1157 -0
- nikodym-0.9.0/src/nikodym/core/exceptions.py +92 -0
- nikodym-0.9.0/src/nikodym/core/lineage.py +68 -0
- nikodym-0.9.0/src/nikodym/core/mixins.py +94 -0
- nikodym-0.9.0/src/nikodym/core/registry.py +100 -0
- nikodym-0.9.0/src/nikodym/core/results.py +69 -0
- nikodym-0.9.0/src/nikodym/core/seeding.py +87 -0
- nikodym-0.9.0/src/nikodym/core/steps.py +92 -0
- nikodym-0.9.0/src/nikodym/core/study.py +529 -0
- nikodym-0.9.0/src/nikodym/data/__init__.py +43 -0
- nikodym-0.9.0/src/nikodym/data/card.py +33 -0
- nikodym-0.9.0/src/nikodym/data/config.py +807 -0
- nikodym-0.9.0/src/nikodym/data/hashing.py +113 -0
- nikodym-0.9.0/src/nikodym/data/loading.py +194 -0
- nikodym-0.9.0/src/nikodym/data/partition.py +622 -0
- nikodym-0.9.0/src/nikodym/data/schema.py +190 -0
- nikodym-0.9.0/src/nikodym/data/special.py +205 -0
- nikodym-0.9.0/src/nikodym/data/step.py +167 -0
- nikodym-0.9.0/src/nikodym/data/target.py +538 -0
- nikodym-0.9.0/src/nikodym/eda/__init__.py +90 -0
- nikodym-0.9.0/src/nikodym/eda/card.py +37 -0
- nikodym-0.9.0/src/nikodym/eda/config.py +287 -0
- nikodym-0.9.0/src/nikodym/eda/default_rate.py +295 -0
- nikodym-0.9.0/src/nikodym/eda/exceptions.py +9 -0
- nikodym-0.9.0/src/nikodym/eda/figures.py +96 -0
- nikodym-0.9.0/src/nikodym/eda/quality.py +174 -0
- nikodym-0.9.0/src/nikodym/eda/stability.py +221 -0
- nikodym-0.9.0/src/nikodym/eda/step.py +253 -0
- nikodym-0.9.0/src/nikodym/eda/univariate.py +337 -0
- nikodym-0.9.0/src/nikodym/explain/__init__.py +112 -0
- nikodym-0.9.0/src/nikodym/explain/config.py +356 -0
- nikodym-0.9.0/src/nikodym/explain/engine.py +865 -0
- nikodym-0.9.0/src/nikodym/explain/exceptions.py +58 -0
- nikodym-0.9.0/src/nikodym/explain/explainers.py +496 -0
- nikodym-0.9.0/src/nikodym/explain/reason_codes.py +179 -0
- nikodym-0.9.0/src/nikodym/explain/results.py +452 -0
- nikodym-0.9.0/src/nikodym/explain/step.py +996 -0
- nikodym-0.9.0/src/nikodym/forward/__init__.py +121 -0
- nikodym-0.9.0/src/nikodym/forward/config.py +660 -0
- nikodym-0.9.0/src/nikodym/forward/exceptions.py +51 -0
- nikodym-0.9.0/src/nikodym/forward/macro.py +1016 -0
- nikodym-0.9.0/src/nikodym/forward/results.py +1007 -0
- nikodym-0.9.0/src/nikodym/forward/satellite.py +1235 -0
- nikodym-0.9.0/src/nikodym/forward/scenarios.py +850 -0
- nikodym-0.9.0/src/nikodym/forward/step.py +994 -0
- nikodym-0.9.0/src/nikodym/governance/__init__.py +40 -0
- nikodym-0.9.0/src/nikodym/governance/config.py +97 -0
- nikodym-0.9.0/src/nikodym/governance/exceptions.py +13 -0
- nikodym-0.9.0/src/nikodym/governance/inventory.py +99 -0
- nikodym-0.9.0/src/nikodym/governance/model_card.py +361 -0
- nikodym-0.9.0/src/nikodym/governance/scenarios.py +130 -0
- nikodym-0.9.0/src/nikodym/markov/__init__.py +100 -0
- nikodym-0.9.0/src/nikodym/markov/config.py +406 -0
- nikodym-0.9.0/src/nikodym/markov/exceptions.py +46 -0
- nikodym-0.9.0/src/nikodym/markov/results.py +754 -0
- nikodym-0.9.0/src/nikodym/markov/step.py +643 -0
- nikodym-0.9.0/src/nikodym/markov/term_structure.py +938 -0
- nikodym-0.9.0/src/nikodym/markov/transition.py +978 -0
- nikodym-0.9.0/src/nikodym/ml/__init__.py +107 -0
- nikodym-0.9.0/src/nikodym/ml/backends.py +446 -0
- nikodym-0.9.0/src/nikodym/ml/config.py +603 -0
- nikodym-0.9.0/src/nikodym/ml/estimator.py +487 -0
- nikodym-0.9.0/src/nikodym/ml/exceptions.py +66 -0
- nikodym-0.9.0/src/nikodym/ml/results.py +406 -0
- nikodym-0.9.0/src/nikodym/ml/step.py +1046 -0
- nikodym-0.9.0/src/nikodym/model/__init__.py +79 -0
- nikodym-0.9.0/src/nikodym/model/config.py +474 -0
- nikodym-0.9.0/src/nikodym/model/estimator.py +1651 -0
- nikodym-0.9.0/src/nikodym/model/exceptions.py +17 -0
- nikodym-0.9.0/src/nikodym/model/results.py +429 -0
- nikodym-0.9.0/src/nikodym/model/step.py +606 -0
- nikodym-0.9.0/src/nikodym/performance/__init__.py +71 -0
- nikodym-0.9.0/src/nikodym/performance/config.py +302 -0
- nikodym-0.9.0/src/nikodym/performance/evaluator.py +904 -0
- nikodym-0.9.0/src/nikodym/performance/exceptions.py +17 -0
- nikodym-0.9.0/src/nikodym/performance/results.py +472 -0
- nikodym-0.9.0/src/nikodym/performance/step.py +227 -0
- nikodym-0.9.0/src/nikodym/provisioning/__init__.py +67 -0
- nikodym-0.9.0/src/nikodym/provisioning/cmf/__init__.py +114 -0
- nikodym-0.9.0/src/nikodym/provisioning/cmf/config.py +370 -0
- nikodym-0.9.0/src/nikodym/provisioning/cmf/data/cmf_b1_b3_2025_01.sha256 +1 -0
- nikodym-0.9.0/src/nikodym/provisioning/cmf/data/cmf_b1_b3_2025_01.yaml +1248 -0
- nikodym-0.9.0/src/nikodym/provisioning/cmf/data/manifest.json +149 -0
- nikodym-0.9.0/src/nikodym/provisioning/cmf/engine.py +2025 -0
- nikodym-0.9.0/src/nikodym/provisioning/cmf/exceptions.py +41 -0
- nikodym-0.9.0/src/nikodym/provisioning/cmf/matrices.py +359 -0
- nikodym-0.9.0/src/nikodym/provisioning/cmf/results.py +267 -0
- nikodym-0.9.0/src/nikodym/provisioning/cmf/step.py +416 -0
- nikodym-0.9.0/src/nikodym/provisioning/config.py +244 -0
- nikodym-0.9.0/src/nikodym/provisioning/exceptions.py +39 -0
- nikodym-0.9.0/src/nikodym/provisioning/ifrs9/__init__.py +90 -0
- nikodym-0.9.0/src/nikodym/provisioning/ifrs9/base.py +49 -0
- nikodym-0.9.0/src/nikodym/provisioning/ifrs9/config.py +627 -0
- nikodym-0.9.0/src/nikodym/provisioning/ifrs9/ead.py +243 -0
- nikodym-0.9.0/src/nikodym/provisioning/ifrs9/ecl.py +447 -0
- nikodym-0.9.0/src/nikodym/provisioning/ifrs9/engine.py +908 -0
- nikodym-0.9.0/src/nikodym/provisioning/ifrs9/exceptions.py +59 -0
- nikodym-0.9.0/src/nikodym/provisioning/ifrs9/lgd.py +293 -0
- nikodym-0.9.0/src/nikodym/provisioning/ifrs9/pd_pit.py +207 -0
- nikodym-0.9.0/src/nikodym/provisioning/ifrs9/results.py +520 -0
- nikodym-0.9.0/src/nikodym/provisioning/ifrs9/staging.py +352 -0
- nikodym-0.9.0/src/nikodym/provisioning/ifrs9/step.py +324 -0
- nikodym-0.9.0/src/nikodym/provisioning/orchestrator.py +671 -0
- nikodym-0.9.0/src/nikodym/provisioning/results.py +397 -0
- nikodym-0.9.0/src/nikodym/provisioning/step.py +211 -0
- nikodym-0.9.0/src/nikodym/py.typed +0 -0
- nikodym-0.9.0/src/nikodym/report/__init__.py +95 -0
- nikodym-0.9.0/src/nikodym/report/_manifest.py +18 -0
- nikodym-0.9.0/src/nikodym/report/ai.py +538 -0
- nikodym-0.9.0/src/nikodym/report/builder.py +457 -0
- nikodym-0.9.0/src/nikodym/report/config.py +254 -0
- nikodym-0.9.0/src/nikodym/report/exceptions.py +36 -0
- nikodym-0.9.0/src/nikodym/report/renderer.py +693 -0
- nikodym-0.9.0/src/nikodym/report/results.py +169 -0
- nikodym-0.9.0/src/nikodym/report/step.py +302 -0
- nikodym-0.9.0/src/nikodym/scorecard/__init__.py +74 -0
- nikodym-0.9.0/src/nikodym/scorecard/config.py +345 -0
- nikodym-0.9.0/src/nikodym/scorecard/exceptions.py +17 -0
- nikodym-0.9.0/src/nikodym/scorecard/results.py +244 -0
- nikodym-0.9.0/src/nikodym/scorecard/scaler.py +751 -0
- nikodym-0.9.0/src/nikodym/scorecard/step.py +560 -0
- nikodym-0.9.0/src/nikodym/scorecard/transformer.py +91 -0
- nikodym-0.9.0/src/nikodym/selection/__init__.py +79 -0
- nikodym-0.9.0/src/nikodym/selection/config.py +523 -0
- nikodym-0.9.0/src/nikodym/selection/exceptions.py +26 -0
- nikodym-0.9.0/src/nikodym/selection/results.py +270 -0
- nikodym-0.9.0/src/nikodym/selection/selector.py +1401 -0
- nikodym-0.9.0/src/nikodym/selection/step.py +520 -0
- nikodym-0.9.0/src/nikodym/stability/__init__.py +77 -0
- nikodym-0.9.0/src/nikodym/stability/config.py +208 -0
- nikodym-0.9.0/src/nikodym/stability/evaluator.py +1038 -0
- nikodym-0.9.0/src/nikodym/stability/exceptions.py +17 -0
- nikodym-0.9.0/src/nikodym/stability/results.py +547 -0
- nikodym-0.9.0/src/nikodym/stability/step.py +343 -0
- nikodym-0.9.0/src/nikodym/stress/__init__.py +110 -0
- nikodym-0.9.0/src/nikodym/stress/config.py +949 -0
- nikodym-0.9.0/src/nikodym/stress/engine.py +5318 -0
- nikodym-0.9.0/src/nikodym/stress/exceptions.py +56 -0
- nikodym-0.9.0/src/nikodym/stress/results.py +1620 -0
- nikodym-0.9.0/src/nikodym/stress/step.py +217 -0
- nikodym-0.9.0/src/nikodym/survival/__init__.py +107 -0
- nikodym-0.9.0/src/nikodym/survival/base.py +67 -0
- nikodym-0.9.0/src/nikodym/survival/config.py +335 -0
- nikodym-0.9.0/src/nikodym/survival/cox_aft.py +1227 -0
- nikodym-0.9.0/src/nikodym/survival/discrete_hazard.py +1289 -0
- nikodym-0.9.0/src/nikodym/survival/exceptions.py +36 -0
- nikodym-0.9.0/src/nikodym/survival/kaplan_meier.py +771 -0
- nikodym-0.9.0/src/nikodym/survival/results.py +511 -0
- nikodym-0.9.0/src/nikodym/survival/step.py +709 -0
- nikodym-0.9.0/src/nikodym/testing/__init__.py +34 -0
- nikodym-0.9.0/src/nikodym/testing/estimator_checks.py +401 -0
- nikodym-0.9.0/src/nikodym/testing/fixtures.py +115 -0
- nikodym-0.9.0/src/nikodym/testing/regulatory.py +47 -0
- nikodym-0.9.0/src/nikodym/testing/reproducibility.py +52 -0
- nikodym-0.9.0/src/nikodym/testing/strategies.py +610 -0
- nikodym-0.9.0/src/nikodym/tracking/__init__.py +32 -0
- nikodym-0.9.0/src/nikodym/tracking/_registry.py +12 -0
- nikodym-0.9.0/src/nikodym/tracking/config.py +85 -0
- nikodym-0.9.0/src/nikodym/tracking/exceptions.py +14 -0
- nikodym-0.9.0/src/nikodym/tracking/inventory.py +259 -0
- nikodym-0.9.0/src/nikodym/tracking/recorder.py +384 -0
- nikodym-0.9.0/src/nikodym/tracking/sink.py +68 -0
- nikodym-0.9.0/src/nikodym/tuning/__init__.py +111 -0
- nikodym-0.9.0/src/nikodym/tuning/config.py +300 -0
- nikodym-0.9.0/src/nikodym/tuning/exceptions.py +51 -0
- nikodym-0.9.0/src/nikodym/tuning/optimizer.py +615 -0
- nikodym-0.9.0/src/nikodym/tuning/results.py +288 -0
- nikodym-0.9.0/src/nikodym/tuning/search_space.py +222 -0
- nikodym-0.9.0/src/nikodym/tuning/step.py +593 -0
- nikodym-0.9.0/src/nikodym/ui/__init__.py +24 -0
- nikodym-0.9.0/src/nikodym/ui/datasets.py +384 -0
- nikodym-0.9.0/src/nikodym/ui/exceptions.py +39 -0
- nikodym-0.9.0/src/nikodym/ui/presets.py +437 -0
- nikodym-0.9.0/src/nikodym/ui/reliability.py +164 -0
- nikodym-0.9.0/src/nikodym/ui/routes.py +385 -0
- nikodym-0.9.0/src/nikodym/ui/runs.py +108 -0
- nikodym-0.9.0/src/nikodym/ui/serializers.py +306 -0
- nikodym-0.9.0/src/nikodym/ui/server.py +66 -0
- nikodym-0.9.0/src/nikodym/ui/settings.py +32 -0
- nikodym-0.9.0/src/nikodym/utils/__init__.py +5 -0
- nikodym-0.9.0/src/nikodym/utils/optional.py +83 -0
- nikodym-0.9.0/src/nikodym/validation/__init__.py +95 -0
- nikodym-0.9.0/src/nikodym/validation/backtesting.py +333 -0
- nikodym-0.9.0/src/nikodym/validation/calibration_tests.py +351 -0
- nikodym-0.9.0/src/nikodym/validation/config.py +408 -0
- nikodym-0.9.0/src/nikodym/validation/discrimination.py +268 -0
- nikodym-0.9.0/src/nikodym/validation/evaluator.py +898 -0
- nikodym-0.9.0/src/nikodym/validation/exceptions.py +42 -0
- nikodym-0.9.0/src/nikodym/validation/results.py +594 -0
- nikodym-0.9.0/src/nikodym/validation/stability.py +303 -0
- nikodym-0.9.0/src/nikodym/validation/step.py +453 -0
- nikodym-0.9.0/tests/conftest.py +373 -0
- nikodym-0.9.0/tests/integration/test_binning_pipeline.py +200 -0
- nikodym-0.9.0/tests/integration/test_eda_pipeline.py +164 -0
- nikodym-0.9.0/tests/integration/test_markov_pipeline.py +156 -0
- nikodym-0.9.0/tests/integration/test_model_pipeline.py +453 -0
- nikodym-0.9.0/tests/integration/test_selection_pipeline.py +213 -0
- nikodym-0.9.0/tests/repro/test_config_hash_golden.py +67 -0
- nikodym-0.9.0/tests/repro/test_seeding_golden.py +100 -0
- nikodym-0.9.0/tests/unit/_ui_f1.py +187 -0
- nikodym-0.9.0/tests/unit/test_api_assemble_run.py +140 -0
- nikodym-0.9.0/tests/unit/test_api_run.py +486 -0
- nikodym-0.9.0/tests/unit/test_artifacts.py +92 -0
- nikodym-0.9.0/tests/unit/test_audit.py +176 -0
- nikodym-0.9.0/tests/unit/test_audit_config.py +95 -0
- nikodym-0.9.0/tests/unit/test_audit_environment_hashing.py +112 -0
- nikodym-0.9.0/tests/unit/test_audit_sink_replay.py +140 -0
- nikodym-0.9.0/tests/unit/test_base_mixins.py +286 -0
- nikodym-0.9.0/tests/unit/test_binning_compatibility.py +85 -0
- nikodym-0.9.0/tests/unit/test_binning_config.py +258 -0
- nikodym-0.9.0/tests/unit/test_binning_results.py +241 -0
- nikodym-0.9.0/tests/unit/test_binning_step.py +552 -0
- nikodym-0.9.0/tests/unit/test_binning_transformer.py +1315 -0
- nikodym-0.9.0/tests/unit/test_calibration_calibrator.py +701 -0
- nikodym-0.9.0/tests/unit/test_calibration_config.py +421 -0
- nikodym-0.9.0/tests/unit/test_calibration_results.py +325 -0
- nikodym-0.9.0/tests/unit/test_calibration_step.py +779 -0
- nikodym-0.9.0/tests/unit/test_cmf_engine.py +1194 -0
- nikodym-0.9.0/tests/unit/test_cmf_matrices.py +304 -0
- nikodym-0.9.0/tests/unit/test_cmf_results.py +402 -0
- nikodym-0.9.0/tests/unit/test_cmf_step.py +516 -0
- nikodym-0.9.0/tests/unit/test_config_full_schema.py +89 -0
- nikodym-0.9.0/tests/unit/test_config_hashing.py +33 -0
- nikodym-0.9.0/tests/unit/test_config_loader.py +112 -0
- nikodym-0.9.0/tests/unit/test_config_migration.py +128 -0
- nikodym-0.9.0/tests/unit/test_config_public_api.py +40 -0
- nikodym-0.9.0/tests/unit/test_config_schema.py +141 -0
- nikodym-0.9.0/tests/unit/test_data_config.py +220 -0
- nikodym-0.9.0/tests/unit/test_data_hashing.py +177 -0
- nikodym-0.9.0/tests/unit/test_data_loading.py +371 -0
- nikodym-0.9.0/tests/unit/test_data_partition.py +692 -0
- nikodym-0.9.0/tests/unit/test_data_schema.py +294 -0
- nikodym-0.9.0/tests/unit/test_data_special.py +245 -0
- nikodym-0.9.0/tests/unit/test_data_step.py +290 -0
- nikodym-0.9.0/tests/unit/test_data_target.py +637 -0
- nikodym-0.9.0/tests/unit/test_eda_card.py +159 -0
- nikodym-0.9.0/tests/unit/test_eda_config.py +195 -0
- nikodym-0.9.0/tests/unit/test_eda_default_rate.py +407 -0
- nikodym-0.9.0/tests/unit/test_eda_quality.py +226 -0
- nikodym-0.9.0/tests/unit/test_eda_stability.py +275 -0
- nikodym-0.9.0/tests/unit/test_eda_step.py +402 -0
- nikodym-0.9.0/tests/unit/test_eda_univariate.py +399 -0
- nikodym-0.9.0/tests/unit/test_exceptions.py +53 -0
- nikodym-0.9.0/tests/unit/test_explain_config.py +434 -0
- nikodym-0.9.0/tests/unit/test_explain_engine.py +572 -0
- nikodym-0.9.0/tests/unit/test_explain_explainers.py +507 -0
- nikodym-0.9.0/tests/unit/test_explain_reason_codes.py +311 -0
- nikodym-0.9.0/tests/unit/test_explain_results.py +420 -0
- nikodym-0.9.0/tests/unit/test_explain_step.py +876 -0
- nikodym-0.9.0/tests/unit/test_forward_config.py +711 -0
- nikodym-0.9.0/tests/unit/test_forward_macro.py +637 -0
- nikodym-0.9.0/tests/unit/test_forward_results.py +947 -0
- nikodym-0.9.0/tests/unit/test_forward_satellite.py +1074 -0
- nikodym-0.9.0/tests/unit/test_forward_scenarios.py +762 -0
- nikodym-0.9.0/tests/unit/test_forward_step.py +680 -0
- nikodym-0.9.0/tests/unit/test_governance_config.py +134 -0
- nikodym-0.9.0/tests/unit/test_governance_inventory.py +153 -0
- nikodym-0.9.0/tests/unit/test_governance_model_card.py +318 -0
- nikodym-0.9.0/tests/unit/test_governance_scenarios.py +165 -0
- nikodym-0.9.0/tests/unit/test_hito0_contracts.py +315 -0
- nikodym-0.9.0/tests/unit/test_ifrs9_config.py +633 -0
- nikodym-0.9.0/tests/unit/test_ifrs9_ead.py +235 -0
- nikodym-0.9.0/tests/unit/test_ifrs9_ecl.py +582 -0
- nikodym-0.9.0/tests/unit/test_ifrs9_engine.py +777 -0
- nikodym-0.9.0/tests/unit/test_ifrs9_lgd.py +370 -0
- nikodym-0.9.0/tests/unit/test_ifrs9_pd_pit.py +276 -0
- nikodym-0.9.0/tests/unit/test_ifrs9_results.py +579 -0
- nikodym-0.9.0/tests/unit/test_ifrs9_staging.py +434 -0
- nikodym-0.9.0/tests/unit/test_ifrs9_step.py +371 -0
- nikodym-0.9.0/tests/unit/test_lineage.py +135 -0
- nikodym-0.9.0/tests/unit/test_markov_config.py +517 -0
- nikodym-0.9.0/tests/unit/test_markov_results.py +690 -0
- nikodym-0.9.0/tests/unit/test_markov_step.py +453 -0
- nikodym-0.9.0/tests/unit/test_markov_term_structure.py +733 -0
- nikodym-0.9.0/tests/unit/test_markov_transition.py +647 -0
- nikodym-0.9.0/tests/unit/test_ml_backends.py +734 -0
- nikodym-0.9.0/tests/unit/test_ml_config.py +577 -0
- nikodym-0.9.0/tests/unit/test_ml_estimator.py +669 -0
- nikodym-0.9.0/tests/unit/test_ml_results.py +442 -0
- nikodym-0.9.0/tests/unit/test_ml_step.py +822 -0
- nikodym-0.9.0/tests/unit/test_model_config.py +305 -0
- nikodym-0.9.0/tests/unit/test_model_estimator.py +1359 -0
- nikodym-0.9.0/tests/unit/test_model_results.py +592 -0
- nikodym-0.9.0/tests/unit/test_model_step.py +494 -0
- nikodym-0.9.0/tests/unit/test_optional.py +60 -0
- nikodym-0.9.0/tests/unit/test_performance_config.py +298 -0
- nikodym-0.9.0/tests/unit/test_performance_evaluator.py +667 -0
- nikodym-0.9.0/tests/unit/test_performance_results.py +627 -0
- nikodym-0.9.0/tests/unit/test_performance_step.py +359 -0
- nikodym-0.9.0/tests/unit/test_provisioning_cmf_config.py +426 -0
- nikodym-0.9.0/tests/unit/test_provisioning_config.py +392 -0
- nikodym-0.9.0/tests/unit/test_provisioning_orchestrator.py +795 -0
- nikodym-0.9.0/tests/unit/test_provisioning_results.py +598 -0
- nikodym-0.9.0/tests/unit/test_provisioning_step.py +656 -0
- nikodym-0.9.0/tests/unit/test_registry.py +151 -0
- nikodym-0.9.0/tests/unit/test_report_ai.py +572 -0
- nikodym-0.9.0/tests/unit/test_report_builder.py +369 -0
- nikodym-0.9.0/tests/unit/test_report_config.py +336 -0
- nikodym-0.9.0/tests/unit/test_report_renderer.py +513 -0
- nikodym-0.9.0/tests/unit/test_report_results.py +374 -0
- nikodym-0.9.0/tests/unit/test_report_step.py +806 -0
- nikodym-0.9.0/tests/unit/test_results.py +115 -0
- nikodym-0.9.0/tests/unit/test_scorecard_config.py +310 -0
- nikodym-0.9.0/tests/unit/test_scorecard_results.py +305 -0
- nikodym-0.9.0/tests/unit/test_scorecard_scaler.py +632 -0
- nikodym-0.9.0/tests/unit/test_scorecard_step.py +606 -0
- nikodym-0.9.0/tests/unit/test_selection_config.py +317 -0
- nikodym-0.9.0/tests/unit/test_selection_results.py +624 -0
- nikodym-0.9.0/tests/unit/test_selection_selector.py +1064 -0
- nikodym-0.9.0/tests/unit/test_selection_step.py +590 -0
- nikodym-0.9.0/tests/unit/test_stability_config.py +296 -0
- nikodym-0.9.0/tests/unit/test_stability_evaluator.py +819 -0
- nikodym-0.9.0/tests/unit/test_stability_results.py +724 -0
- nikodym-0.9.0/tests/unit/test_stability_step.py +616 -0
- nikodym-0.9.0/tests/unit/test_steps.py +108 -0
- nikodym-0.9.0/tests/unit/test_stress_config.py +1009 -0
- nikodym-0.9.0/tests/unit/test_stress_engine.py +6301 -0
- nikodym-0.9.0/tests/unit/test_stress_results.py +1999 -0
- nikodym-0.9.0/tests/unit/test_stress_step.py +832 -0
- nikodym-0.9.0/tests/unit/test_study.py +747 -0
- nikodym-0.9.0/tests/unit/test_survival_config.py +431 -0
- nikodym-0.9.0/tests/unit/test_survival_cox_aft.py +766 -0
- nikodym-0.9.0/tests/unit/test_survival_discrete_hazard.py +805 -0
- nikodym-0.9.0/tests/unit/test_survival_kaplan_meier.py +457 -0
- nikodym-0.9.0/tests/unit/test_survival_results.py +611 -0
- nikodym-0.9.0/tests/unit/test_survival_step.py +542 -0
- nikodym-0.9.0/tests/unit/test_testing_estimator_checks.py +580 -0
- nikodym-0.9.0/tests/unit/test_testing_fixtures.py +107 -0
- nikodym-0.9.0/tests/unit/test_testing_reproducibility.py +46 -0
- nikodym-0.9.0/tests/unit/test_testing_strategies.py +103 -0
- nikodym-0.9.0/tests/unit/test_tracking_config.py +128 -0
- nikodym-0.9.0/tests/unit/test_tracking_inventory.py +370 -0
- nikodym-0.9.0/tests/unit/test_tracking_recorder_sink.py +458 -0
- nikodym-0.9.0/tests/unit/test_tuning_config.py +431 -0
- nikodym-0.9.0/tests/unit/test_tuning_exceptions.py +48 -0
- nikodym-0.9.0/tests/unit/test_tuning_optimizer.py +430 -0
- nikodym-0.9.0/tests/unit/test_tuning_results.py +324 -0
- nikodym-0.9.0/tests/unit/test_tuning_search_space.py +283 -0
- nikodym-0.9.0/tests/unit/test_tuning_step.py +664 -0
- nikodym-0.9.0/tests/unit/test_ui_datasets.py +192 -0
- nikodym-0.9.0/tests/unit/test_ui_presets.py +164 -0
- nikodym-0.9.0/tests/unit/test_ui_reliability.py +182 -0
- nikodym-0.9.0/tests/unit/test_ui_routes.py +501 -0
- nikodym-0.9.0/tests/unit/test_ui_runs.py +126 -0
- nikodym-0.9.0/tests/unit/test_ui_serializers.py +513 -0
- nikodym-0.9.0/tests/unit/test_ui_server.py +381 -0
- nikodym-0.9.0/tests/unit/test_ui_settings.py +65 -0
- nikodym-0.9.0/tests/unit/test_validation_backtesting.py +370 -0
- nikodym-0.9.0/tests/unit/test_validation_calibration_tests.py +378 -0
- nikodym-0.9.0/tests/unit/test_validation_config.py +446 -0
- nikodym-0.9.0/tests/unit/test_validation_discrimination.py +332 -0
- nikodym-0.9.0/tests/unit/test_validation_evaluator.py +791 -0
- nikodym-0.9.0/tests/unit/test_validation_results.py +717 -0
- nikodym-0.9.0/tests/unit/test_validation_stability.py +333 -0
- nikodym-0.9.0/tests/unit/test_validation_step.py +684 -0
nikodym-0.9.0/.gitignore
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# === Datos y secretos — NUNCA versionar (proyecto regulatorio) ===
|
|
2
|
+
.env
|
|
3
|
+
.env.*
|
|
4
|
+
*.key
|
|
5
|
+
*.pem
|
|
6
|
+
secrets/
|
|
7
|
+
credentials*
|
|
8
|
+
/data/ # datasets en la raíz (anclado: NO veta el paquete fuente `src/nikodym/data/`, SDD-02).
|
|
9
|
+
# Los ficheros de datos en cualquier ruta los vetan los patrones por extensión de abajo.
|
|
10
|
+
*.csv
|
|
11
|
+
*.parquet
|
|
12
|
+
*.xlsx
|
|
13
|
+
*.xls
|
|
14
|
+
*.feather
|
|
15
|
+
*.dta
|
|
16
|
+
*.sav
|
|
17
|
+
|
|
18
|
+
# === Python ===
|
|
19
|
+
__pycache__/
|
|
20
|
+
*.py[cod]
|
|
21
|
+
*.egg
|
|
22
|
+
*.egg-info/
|
|
23
|
+
.eggs/
|
|
24
|
+
build/
|
|
25
|
+
dist/
|
|
26
|
+
*.whl
|
|
27
|
+
|
|
28
|
+
# === Entornos / uv ===
|
|
29
|
+
.venv/
|
|
30
|
+
venv/
|
|
31
|
+
env/
|
|
32
|
+
.uv/
|
|
33
|
+
uv.lock.bak
|
|
34
|
+
|
|
35
|
+
# === Testing / calidad ===
|
|
36
|
+
.pytest_cache/
|
|
37
|
+
.mypy_cache/
|
|
38
|
+
.ruff_cache/
|
|
39
|
+
.hypothesis/
|
|
40
|
+
.coverage
|
|
41
|
+
.coverage.*
|
|
42
|
+
htmlcov/
|
|
43
|
+
coverage.xml
|
|
44
|
+
|
|
45
|
+
# === MLflow / artefactos de modelos ===
|
|
46
|
+
mlruns/
|
|
47
|
+
mlartifacts/
|
|
48
|
+
*.joblib
|
|
49
|
+
*.pkl
|
|
50
|
+
|
|
51
|
+
# === Quarto / reportes generados ===
|
|
52
|
+
/.quarto/
|
|
53
|
+
*_files/
|
|
54
|
+
_site/
|
|
55
|
+
|
|
56
|
+
# === mkdocs (sitio de documentación generado; NO se versiona, el deploy lo decide Cami) ===
|
|
57
|
+
/site/
|
|
58
|
+
|
|
59
|
+
# === Jupyter ===
|
|
60
|
+
.ipynb_checkpoints/
|
|
61
|
+
|
|
62
|
+
# === OS / IDE ===
|
|
63
|
+
.DS_Store
|
|
64
|
+
Thumbs.db
|
|
65
|
+
.idea/
|
|
66
|
+
.vscode/
|
|
67
|
+
*.swp
|
|
68
|
+
*~
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Formato basado en [Keep a Changelog](https://keepachangelog.com/es-ES/1.1.0/);
|
|
4
|
+
el proyecto sigue [SemVer](https://semver.org/lang/es/) (0.x honesto: APIs que crecerán
|
|
5
|
+
marcadas como experimentales hasta la 1.0).
|
|
6
|
+
|
|
7
|
+
## [0.9.0] — 2026-07-10
|
|
8
|
+
|
|
9
|
+
Primer release público en PyPI. Motor V1 completo (F0–F7) y verde en CI; API pública
|
|
10
|
+
versionada como 0.x honesto (puede cambiar hasta la 1.0).
|
|
11
|
+
|
|
12
|
+
### Incluye
|
|
13
|
+
- **Núcleo reproducible** (F0): config declarativo Pydantic v2, `Study`/lineage, audit-trail,
|
|
14
|
+
artifacts *namespaced*, gobernanza SR 11-7.
|
|
15
|
+
- **Scorecard (F1)**: binning/WoE monotónico (optbinning), selección, regresión logística,
|
|
16
|
+
scorecard escalado, calibración, desempeño (AUC/KS/Gini) y estabilidad (PSI/CSI).
|
|
17
|
+
- **Backends ML (F2)**: XGBoost, LightGBM, CatBoost, tuning (Optuna) y explicabilidad (SHAP)
|
|
18
|
+
como *extras* selectivos.
|
|
19
|
+
- **Provisiones**: motores **CMF (Chile)** e **IFRS 9/ECL** separados (provisión = máximo).
|
|
20
|
+
- **Forward-looking y stress testing**.
|
|
21
|
+
- **UI (F7)**: flujo Scorecard F1 (Datos · Ejecutar · Resultados · Reporte) — React + backend
|
|
22
|
+
FastAPI, con modo claro/oscuro y reporte HTML del modelo.
|
|
23
|
+
- **Empaquetado**: publicación en PyPI vía Trusted Publishing (OIDC, sin tokens).
|
|
24
|
+
|
|
25
|
+
### Detalle de la Fundación (F0)
|
|
26
|
+
- Esqueleto del paquete: `pyproject.toml` (uv + hatchling, layout `src/`, 7 deps base,
|
|
27
|
+
extras de usuario y grupos de desarrollo PEP 735), `LICENSE` Apache-2.0, `README`, `CHANGELOG`.
|
|
28
|
+
- `nikodym.core.exceptions`: jerarquía de excepciones con raíz `NikodymError` (código
|
|
29
|
+
regulatorio, cobertura objetivo 100 %).
|
|
30
|
+
- `nikodym.core.seeding`: `SeedManager` — derivación determinista por nombre vía
|
|
31
|
+
`SeedSequence(entropy=[root_seed, hashlib])` (código regulatorio, cobertura objetivo 100 %).
|
|
32
|
+
- `nikodym.core.config`: configuración declarativa (Pydantic v2). `NikodymConfig` *frozen*
|
|
33
|
+
construible sin argumentos, secciones `ReproConfig`/`RunConfig`; `config_hash` (SHA-256 del
|
|
34
|
+
JSON canónico que excluye `INFRA_SECTIONS`, estable e idéntico entre procesos); `load_config`/
|
|
35
|
+
`dump_config` (round-trip YAML con `safe_load`); version-gate `migrate` + decorador `@migration`
|
|
36
|
+
(registro vacío en 1.0.0, cadena lineal validada en import-time). Experimental (SemVer 0.x).
|
|
37
|
+
- `nikodym.utils.optional`: `require_extra` / `has_extra` / `EXTRA_TO_DISTRIBUTIONS`
|
|
38
|
+
(import perezoso de extras con mensaje accionable).
|
|
39
|
+
- Paths regulatorios declarados (`nikodym.provisioning.cmf`, `nikodym.provisioning.ifrs9`)
|
|
40
|
+
para el gate de cobertura regulatoria; su implementación llega en F3/F4.
|
|
41
|
+
- `nikodym.core` (resto de la Fundación, 9 módulos): primer `Study` end-to-end con lineage
|
|
42
|
+
reproducible. `audit` (`AuditEvent`/`AuditKind`/`AuditSink`, `NullAuditSink`/`InMemoryAuditSink`/
|
|
43
|
+
`FanOutSink`); `results` (Protocols económicos `ProvisionResultLike`/`ECLResultLike` con
|
|
44
|
+
`term_structure()`, CT-2); `base` (`BaseNikodymEstimator` raíz propia + 6 familias, semántica
|
|
45
|
+
`get_params`/`set_params`/`from_config` estilo scikit-learn sin heredarlo); `mixins`
|
|
46
|
+
(`AuditableMixin`, `SerializationMixin` con puerta `trust`); `registry`/`artifacts` (registro y
|
|
47
|
+
almacén *namespaced* `(domain, key)`); `steps` (`Step`/`StepAdapter`, `requires`/`provides`, CT-1);
|
|
48
|
+
`lineage` (`LineageBundle`/`RunContext`); `study` (`Study`: orquestador motor v1 con validación de
|
|
49
|
+
prerequisitos CT-1, persistencia en directorio atómico, recarga con verificación de `config_hash`
|
|
50
|
+
y reproducibilidad). Experimental (SemVer 0.x): orquestación y Protocols de resultados crecerán.
|
|
51
|
+
- `nikodym.data` (B2a — capa `data`, configuración + endurecimiento, SDD-02 §5): sub-config
|
|
52
|
+
declarativo `DataConfig` (`nikodym/data/config.py`): árbol Pydantic completo (Loading/Schema/Target/
|
|
53
|
+
Missing/Partition), mini-DSL declarativo `Predicate`/`Rule` (allowlist cerrada de operadores, sin
|
|
54
|
+
`eval`), unión discriminada **anidada** de la estrategia de partición (temporal/random/cohort) por
|
|
55
|
+
factory local, `model_validator` de fracciones (suman 1) y de regla no vacía, alias `schema` con
|
|
56
|
+
`populate_by_name`. Endurecido `NikodymConfig.data` de `Any` a `DataConfig | None` (tipado estricto
|
|
57
|
+
para mypy; coerción en runtime vía hook `_DATA_CONFIG_CLS` que `nikodym.data` puebla al importarse —
|
|
58
|
+
el núcleo sigue liviano, no importa `data`). Golden `config_hash` por defecto **invariante**. Deps
|
|
59
|
+
base activadas: `pandera>=0.24` (uso `import pandera.pandas`) y `pyarrow>=14`. Experimental (SemVer 0.x).
|
nikodym-0.9.0/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
95
|
+
Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Nikodym (Nexo Labs SpA)
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
nikodym-0.9.0/PKG-INFO
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nikodym
|
|
3
|
+
Version: 0.9.0
|
|
4
|
+
Summary: Librería de riesgo de crédito: scoring, ML, provisiones CMF e IFRS 9/ECL, forward-looking y stress testing.
|
|
5
|
+
Project-URL: Homepage, https://github.com/nexolabs-gh/nikodym
|
|
6
|
+
Project-URL: Source, https://github.com/nexolabs-gh/nikodym
|
|
7
|
+
Project-URL: Documentation, https://github.com/nexolabs-gh/nikodym#readme
|
|
8
|
+
Project-URL: Changelog, https://github.com/nexolabs-gh/nikodym/blob/main/CHANGELOG.md
|
|
9
|
+
Author-email: Nikodym <admin@nxlabs.cl>
|
|
10
|
+
License-Expression: Apache-2.0
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: cmf,credit-risk,ecl,ifrs9,provisioning,scorecard
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
15
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering
|
|
20
|
+
Classifier: Typing :: Typed
|
|
21
|
+
Requires-Python: >=3.11
|
|
22
|
+
Requires-Dist: jinja2>=3.1
|
|
23
|
+
Requires-Dist: joblib>=1.3
|
|
24
|
+
Requires-Dist: numpy>=1.22
|
|
25
|
+
Requires-Dist: pandas>=2.0
|
|
26
|
+
Requires-Dist: pandera>=0.24
|
|
27
|
+
Requires-Dist: pyarrow>=14
|
|
28
|
+
Requires-Dist: pydantic>=2.5
|
|
29
|
+
Requires-Dist: pyyaml>=6.0
|
|
30
|
+
Provides-Extra: ai
|
|
31
|
+
Requires-Dist: anthropic>=0.40; extra == 'ai'
|
|
32
|
+
Provides-Extra: all
|
|
33
|
+
Requires-Dist: anthropic>=0.40; extra == 'all'
|
|
34
|
+
Requires-Dist: catboost>=1.2; extra == 'all'
|
|
35
|
+
Requires-Dist: fastapi>=0.110; extra == 'all'
|
|
36
|
+
Requires-Dist: hydra-core>=1.3; extra == 'all'
|
|
37
|
+
Requires-Dist: lifelines>=0.28; extra == 'all'
|
|
38
|
+
Requires-Dist: lightgbm>=4.0; extra == 'all'
|
|
39
|
+
Requires-Dist: llvmlite>=0.43; extra == 'all'
|
|
40
|
+
Requires-Dist: matplotlib>=3.7; extra == 'all'
|
|
41
|
+
Requires-Dist: mlflow>=2.10; extra == 'all'
|
|
42
|
+
Requires-Dist: numba>=0.60; extra == 'all'
|
|
43
|
+
Requires-Dist: omegaconf>=2.3; extra == 'all'
|
|
44
|
+
Requires-Dist: openpyxl>=3.1; extra == 'all'
|
|
45
|
+
Requires-Dist: optbinning>=0.19; extra == 'all'
|
|
46
|
+
Requires-Dist: optuna>=3.5; extra == 'all'
|
|
47
|
+
Requires-Dist: plotly>=5.0; extra == 'all'
|
|
48
|
+
Requires-Dist: pmdarima>=2.0; extra == 'all'
|
|
49
|
+
Requires-Dist: polars>=0.20; extra == 'all'
|
|
50
|
+
Requires-Dist: python-multipart>=0.0.9; extra == 'all'
|
|
51
|
+
Requires-Dist: scikit-learn>=1.6; extra == 'all'
|
|
52
|
+
Requires-Dist: scipy>=1.10; extra == 'all'
|
|
53
|
+
Requires-Dist: shap>=0.44; extra == 'all'
|
|
54
|
+
Requires-Dist: statsmodels>=0.14; extra == 'all'
|
|
55
|
+
Requires-Dist: uvicorn>=0.29; extra == 'all'
|
|
56
|
+
Requires-Dist: xgboost>=2.0; extra == 'all'
|
|
57
|
+
Provides-Extra: catboost
|
|
58
|
+
Requires-Dist: catboost>=1.2; extra == 'catboost'
|
|
59
|
+
Requires-Dist: scikit-learn>=1.6; extra == 'catboost'
|
|
60
|
+
Provides-Extra: excel
|
|
61
|
+
Requires-Dist: openpyxl>=3.1; extra == 'excel'
|
|
62
|
+
Provides-Extra: explain
|
|
63
|
+
Requires-Dist: llvmlite>=0.43; extra == 'explain'
|
|
64
|
+
Requires-Dist: matplotlib>=3.7; extra == 'explain'
|
|
65
|
+
Requires-Dist: numba>=0.60; extra == 'explain'
|
|
66
|
+
Requires-Dist: shap>=0.44; extra == 'explain'
|
|
67
|
+
Provides-Extra: forecasting
|
|
68
|
+
Requires-Dist: pmdarima>=2.0; extra == 'forecasting'
|
|
69
|
+
Requires-Dist: statsmodels>=0.14; extra == 'forecasting'
|
|
70
|
+
Provides-Extra: lightgbm
|
|
71
|
+
Requires-Dist: lightgbm>=4.0; extra == 'lightgbm'
|
|
72
|
+
Requires-Dist: scikit-learn>=1.6; extra == 'lightgbm'
|
|
73
|
+
Provides-Extra: ml
|
|
74
|
+
Requires-Dist: scikit-learn>=1.6; extra == 'ml'
|
|
75
|
+
Provides-Extra: polars
|
|
76
|
+
Requires-Dist: polars>=0.20; extra == 'polars'
|
|
77
|
+
Provides-Extra: report
|
|
78
|
+
Requires-Dist: matplotlib>=3.7; extra == 'report'
|
|
79
|
+
Requires-Dist: plotly>=5.0; extra == 'report'
|
|
80
|
+
Provides-Extra: scoring
|
|
81
|
+
Requires-Dist: optbinning>=0.19; extra == 'scoring'
|
|
82
|
+
Requires-Dist: scikit-learn>=1.6; extra == 'scoring'
|
|
83
|
+
Requires-Dist: scipy>=1.10; extra == 'scoring'
|
|
84
|
+
Requires-Dist: statsmodels>=0.14; extra == 'scoring'
|
|
85
|
+
Provides-Extra: survival
|
|
86
|
+
Requires-Dist: lifelines>=0.28; extra == 'survival'
|
|
87
|
+
Provides-Extra: sweep
|
|
88
|
+
Requires-Dist: hydra-core>=1.3; extra == 'sweep'
|
|
89
|
+
Requires-Dist: omegaconf>=2.3; extra == 'sweep'
|
|
90
|
+
Provides-Extra: tracking
|
|
91
|
+
Requires-Dist: mlflow>=2.10; extra == 'tracking'
|
|
92
|
+
Provides-Extra: tuning
|
|
93
|
+
Requires-Dist: optuna>=3.5; extra == 'tuning'
|
|
94
|
+
Provides-Extra: ui
|
|
95
|
+
Requires-Dist: fastapi>=0.110; extra == 'ui'
|
|
96
|
+
Requires-Dist: openpyxl>=3.1; extra == 'ui'
|
|
97
|
+
Requires-Dist: python-multipart>=0.0.9; extra == 'ui'
|
|
98
|
+
Requires-Dist: uvicorn>=0.29; extra == 'ui'
|
|
99
|
+
Provides-Extra: xgboost
|
|
100
|
+
Requires-Dist: scikit-learn>=1.6; extra == 'xgboost'
|
|
101
|
+
Requires-Dist: xgboost>=2.0; extra == 'xgboost'
|
|
102
|
+
Description-Content-Type: text/markdown
|
|
103
|
+
|
|
104
|
+
# Nikodym RiskLib
|
|
105
|
+
|
|
106
|
+
[](https://pypi.org/project/nikodym/)
|
|
107
|
+
[](https://pypi.org/project/nikodym/)
|
|
108
|
+
[](LICENSE)
|
|
109
|
+
[](https://github.com/nexolabs-gh/nikodym/actions/workflows/ci.yml)
|
|
110
|
+
|
|
111
|
+
Librería Python **open-source (Apache-2.0)** de riesgo de crédito **integral**:
|
|
112
|
+
scoring/scorecards, backends ML, provisiones **CMF (Chile)** e **IFRS 9/ECL**, forward-looking
|
|
113
|
+
y stress testing. Todo en un motor **reproducible por construcción** y con gobernanza
|
|
114
|
+
(model card + audit-trail) automática. Paquete: `nikodym`.
|
|
115
|
+
|
|
116
|
+
> **Estado: pre-1.0 (0.9.x).** El motor V1 está completo y verde; la API pública sigue
|
|
117
|
+
> versionada como **0.x honesto** (SemVer): puede cambiar hasta la 1.0. Las superficies que aún
|
|
118
|
+
> crecen (resultados/overlay/métricas/orquestación) están marcadas como experimentales.
|
|
119
|
+
|
|
120
|
+
## Qué hace
|
|
121
|
+
|
|
122
|
+
- **Scorecard (F1)**: binning/WoE con monotonía (optbinning), selección, regresión logística,
|
|
123
|
+
scorecard escalado, calibración y métricas de desempeño (AUC/KS/Gini) y estabilidad (PSI/CSI).
|
|
124
|
+
- **Backends ML (F2)**: XGBoost, LightGBM, CatBoost y tuning (Optuna) como *extras* selectivos,
|
|
125
|
+
con explicabilidad (SHAP) opcional.
|
|
126
|
+
- **Provisiones**: motores **CMF (Chile)** e **IFRS 9/ECL** separados; la provisión es el
|
|
127
|
+
**máximo** de ambos (piso prudencial).
|
|
128
|
+
- **Forward-looking & stress testing**: proyección macroeconómica y escenarios.
|
|
129
|
+
- **Reproducibilidad total**: `(datos + config + semilla) → resultado idéntico`, con *lineage
|
|
130
|
+
bundle* (git SHA + hash de datos + config + semilla + `uv.lock`) en cada corrida.
|
|
131
|
+
|
|
132
|
+
## Instalación
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
pip install nikodym # núcleo base (config, Study, lineage)
|
|
136
|
+
pip install 'nikodym[scoring]' # MVP scorecard (optbinning + statsmodels + sklearn>=1.6)
|
|
137
|
+
pip install 'nikodym[all]' # todo lo redistribuible (sin copyleft)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Requiere Python ≥ 3.11. El núcleo base es liviano: `import nikodym` **no** arrastra el stack ML;
|
|
141
|
+
los backends pesados viven tras *extras* opcionales con import perezoso.
|
|
142
|
+
|
|
143
|
+
## Quickstart
|
|
144
|
+
|
|
145
|
+
El experimento es un `NikodymConfig` declarativo; `nikodym.run(config)` lo ejecuta de extremo a
|
|
146
|
+
extremo (binning → selección → modelo → scorecard → calibración → desempeño → estabilidad) y
|
|
147
|
+
devuelve un `Study` reproducible. Este ejemplo usa el **preset estándar F1** sobre un dataset
|
|
148
|
+
sintético de consumo, así corre sin rellenar ningún campo:
|
|
149
|
+
|
|
150
|
+
```python
|
|
151
|
+
from pathlib import Path
|
|
152
|
+
from tempfile import mkdtemp
|
|
153
|
+
|
|
154
|
+
import nikodym
|
|
155
|
+
from nikodym.core.config import NikodymConfig
|
|
156
|
+
from nikodym.ui.datasets import materialize
|
|
157
|
+
from nikodym.ui.presets import standard_preset
|
|
158
|
+
|
|
159
|
+
# 1. Materializa el dataset sintético de consumo (determinista) en un workdir temporal.
|
|
160
|
+
workdir = Path(mkdtemp(prefix="nikodym-quickstart-"))
|
|
161
|
+
preset = standard_preset()
|
|
162
|
+
data_path = materialize(preset["dataset_id"], workdir=workdir)
|
|
163
|
+
|
|
164
|
+
# 2. Toma el config F1 curado y apúntalo al archivo de datos recién materializado.
|
|
165
|
+
cfg_dict = preset["config"]
|
|
166
|
+
cfg_dict["data"]["load"]["source"] = str(data_path)
|
|
167
|
+
config = NikodymConfig.model_validate(cfg_dict)
|
|
168
|
+
|
|
169
|
+
# 3. Ejecuta la corrida completa y verifica el estado.
|
|
170
|
+
study = nikodym.run(config)
|
|
171
|
+
assert study.run_context.status == "done"
|
|
172
|
+
|
|
173
|
+
# 4. Accede a los resultados namespaced por dominio/clave.
|
|
174
|
+
scorecard = study.artifacts.get("scorecard", "scorecard") # tabla del scorecard
|
|
175
|
+
metrics = study.artifacts.get("performance", "discriminant_metrics") # AUC/KS/Gini por partición
|
|
176
|
+
print(metrics)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
`nikodym.run` es *fail-loud pero no explosivo*: ante un fallo devuelve el `Study` **parcial** con
|
|
180
|
+
`study.run_context.status == "failed"` (el error vive en el audit-trail y el lineage, no se
|
|
181
|
+
silencia). El consumidor por código **debe** chequear `study.run_context.status` antes de usar los
|
|
182
|
+
resultados.
|
|
183
|
+
|
|
184
|
+
## Principios de diseño
|
|
185
|
+
|
|
186
|
+
- **Reproducibilidad total**: misma entrada → resultado byte-idéntico, con lineage completo.
|
|
187
|
+
- **Gobernanza por construcción** (SR 11-7): *model card* y *audit-trail* automáticos.
|
|
188
|
+
- **Config declarativo** (Pydantic v2): *el config ES el experimento*.
|
|
189
|
+
- **Núcleo liviano**: los backends pesados van tras *extras* con import perezoso.
|
|
190
|
+
- **CMF ≠ IFRS 9**: dos motores separados; la provisión es el máximo (piso prudencial).
|
|
191
|
+
|
|
192
|
+
## Documentación
|
|
193
|
+
|
|
194
|
+
Guía completa (conceptos, referencia de `run`/`Study`/`NikodymConfig`) en el
|
|
195
|
+
[sitio de documentación](https://github.com/nexolabs-gh/nikodym#readme). El `CHANGELOG.md`
|
|
196
|
+
registra los cambios por versión.
|
|
197
|
+
|
|
198
|
+
## Desarrollo
|
|
199
|
+
|
|
200
|
+
El proyecto usa [uv](https://docs.astral.sh/uv/) + hatchling, con layout `src/`.
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
uv sync # entorno completo (grupo dev: test/lint/docs)
|
|
204
|
+
uv run ruff check . && uv run ruff format --check .
|
|
205
|
+
uv run mypy # type-check estricto de todo el paquete
|
|
206
|
+
uv run pytest # suite de tests
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## Licencia
|
|
210
|
+
|
|
211
|
+
[Apache-2.0](LICENSE). Sin dependencias copyleft (GPL/LGPL/AGPL) en el wheel.
|
nikodym-0.9.0/README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Nikodym RiskLib
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/nikodym/)
|
|
4
|
+
[](https://pypi.org/project/nikodym/)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://github.com/nexolabs-gh/nikodym/actions/workflows/ci.yml)
|
|
7
|
+
|
|
8
|
+
Librería Python **open-source (Apache-2.0)** de riesgo de crédito **integral**:
|
|
9
|
+
scoring/scorecards, backends ML, provisiones **CMF (Chile)** e **IFRS 9/ECL**, forward-looking
|
|
10
|
+
y stress testing. Todo en un motor **reproducible por construcción** y con gobernanza
|
|
11
|
+
(model card + audit-trail) automática. Paquete: `nikodym`.
|
|
12
|
+
|
|
13
|
+
> **Estado: pre-1.0 (0.9.x).** El motor V1 está completo y verde; la API pública sigue
|
|
14
|
+
> versionada como **0.x honesto** (SemVer): puede cambiar hasta la 1.0. Las superficies que aún
|
|
15
|
+
> crecen (resultados/overlay/métricas/orquestación) están marcadas como experimentales.
|
|
16
|
+
|
|
17
|
+
## Qué hace
|
|
18
|
+
|
|
19
|
+
- **Scorecard (F1)**: binning/WoE con monotonía (optbinning), selección, regresión logística,
|
|
20
|
+
scorecard escalado, calibración y métricas de desempeño (AUC/KS/Gini) y estabilidad (PSI/CSI).
|
|
21
|
+
- **Backends ML (F2)**: XGBoost, LightGBM, CatBoost y tuning (Optuna) como *extras* selectivos,
|
|
22
|
+
con explicabilidad (SHAP) opcional.
|
|
23
|
+
- **Provisiones**: motores **CMF (Chile)** e **IFRS 9/ECL** separados; la provisión es el
|
|
24
|
+
**máximo** de ambos (piso prudencial).
|
|
25
|
+
- **Forward-looking & stress testing**: proyección macroeconómica y escenarios.
|
|
26
|
+
- **Reproducibilidad total**: `(datos + config + semilla) → resultado idéntico`, con *lineage
|
|
27
|
+
bundle* (git SHA + hash de datos + config + semilla + `uv.lock`) en cada corrida.
|
|
28
|
+
|
|
29
|
+
## Instalación
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install nikodym # núcleo base (config, Study, lineage)
|
|
33
|
+
pip install 'nikodym[scoring]' # MVP scorecard (optbinning + statsmodels + sklearn>=1.6)
|
|
34
|
+
pip install 'nikodym[all]' # todo lo redistribuible (sin copyleft)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Requiere Python ≥ 3.11. El núcleo base es liviano: `import nikodym` **no** arrastra el stack ML;
|
|
38
|
+
los backends pesados viven tras *extras* opcionales con import perezoso.
|
|
39
|
+
|
|
40
|
+
## Quickstart
|
|
41
|
+
|
|
42
|
+
El experimento es un `NikodymConfig` declarativo; `nikodym.run(config)` lo ejecuta de extremo a
|
|
43
|
+
extremo (binning → selección → modelo → scorecard → calibración → desempeño → estabilidad) y
|
|
44
|
+
devuelve un `Study` reproducible. Este ejemplo usa el **preset estándar F1** sobre un dataset
|
|
45
|
+
sintético de consumo, así corre sin rellenar ningún campo:
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
from pathlib import Path
|
|
49
|
+
from tempfile import mkdtemp
|
|
50
|
+
|
|
51
|
+
import nikodym
|
|
52
|
+
from nikodym.core.config import NikodymConfig
|
|
53
|
+
from nikodym.ui.datasets import materialize
|
|
54
|
+
from nikodym.ui.presets import standard_preset
|
|
55
|
+
|
|
56
|
+
# 1. Materializa el dataset sintético de consumo (determinista) en un workdir temporal.
|
|
57
|
+
workdir = Path(mkdtemp(prefix="nikodym-quickstart-"))
|
|
58
|
+
preset = standard_preset()
|
|
59
|
+
data_path = materialize(preset["dataset_id"], workdir=workdir)
|
|
60
|
+
|
|
61
|
+
# 2. Toma el config F1 curado y apúntalo al archivo de datos recién materializado.
|
|
62
|
+
cfg_dict = preset["config"]
|
|
63
|
+
cfg_dict["data"]["load"]["source"] = str(data_path)
|
|
64
|
+
config = NikodymConfig.model_validate(cfg_dict)
|
|
65
|
+
|
|
66
|
+
# 3. Ejecuta la corrida completa y verifica el estado.
|
|
67
|
+
study = nikodym.run(config)
|
|
68
|
+
assert study.run_context.status == "done"
|
|
69
|
+
|
|
70
|
+
# 4. Accede a los resultados namespaced por dominio/clave.
|
|
71
|
+
scorecard = study.artifacts.get("scorecard", "scorecard") # tabla del scorecard
|
|
72
|
+
metrics = study.artifacts.get("performance", "discriminant_metrics") # AUC/KS/Gini por partición
|
|
73
|
+
print(metrics)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`nikodym.run` es *fail-loud pero no explosivo*: ante un fallo devuelve el `Study` **parcial** con
|
|
77
|
+
`study.run_context.status == "failed"` (el error vive en el audit-trail y el lineage, no se
|
|
78
|
+
silencia). El consumidor por código **debe** chequear `study.run_context.status` antes de usar los
|
|
79
|
+
resultados.
|
|
80
|
+
|
|
81
|
+
## Principios de diseño
|
|
82
|
+
|
|
83
|
+
- **Reproducibilidad total**: misma entrada → resultado byte-idéntico, con lineage completo.
|
|
84
|
+
- **Gobernanza por construcción** (SR 11-7): *model card* y *audit-trail* automáticos.
|
|
85
|
+
- **Config declarativo** (Pydantic v2): *el config ES el experimento*.
|
|
86
|
+
- **Núcleo liviano**: los backends pesados van tras *extras* con import perezoso.
|
|
87
|
+
- **CMF ≠ IFRS 9**: dos motores separados; la provisión es el máximo (piso prudencial).
|
|
88
|
+
|
|
89
|
+
## Documentación
|
|
90
|
+
|
|
91
|
+
Guía completa (conceptos, referencia de `run`/`Study`/`NikodymConfig`) en el
|
|
92
|
+
[sitio de documentación](https://github.com/nexolabs-gh/nikodym#readme). El `CHANGELOG.md`
|
|
93
|
+
registra los cambios por versión.
|
|
94
|
+
|
|
95
|
+
## Desarrollo
|
|
96
|
+
|
|
97
|
+
El proyecto usa [uv](https://docs.astral.sh/uv/) + hatchling, con layout `src/`.
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
uv sync # entorno completo (grupo dev: test/lint/docs)
|
|
101
|
+
uv run ruff check . && uv run ruff format --check .
|
|
102
|
+
uv run mypy # type-check estricto de todo el paquete
|
|
103
|
+
uv run pytest # suite de tests
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Licencia
|
|
107
|
+
|
|
108
|
+
[Apache-2.0](LICENSE). Sin dependencias copyleft (GPL/LGPL/AGPL) en el wheel.
|