featrixsphere 0.2.6127__tar.gz → 0.2.6708__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.
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/PKG-INFO +1 -1
- featrixsphere-0.2.6708/VERSION +1 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/featrixsphere/__init__.py +1 -1
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/featrixsphere/api/foundational_model.py +288 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/featrixsphere/api/http_client.py +37 -4
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/featrixsphere/api/prediction_result.py +98 -9
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/featrixsphere/api/predictor.py +77 -3
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/featrixsphere/client.py +81 -58
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/featrixsphere.egg-info/PKG-INFO +1 -1
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/featrixsphere.egg-info/SOURCES.txt +40 -2
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/requirements.txt +2 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/api.py +220 -49
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/celery_app.py +3 -2
- featrixsphere-0.2.6708/src/demo_label_updates.py +214 -0
- featrixsphere-0.2.6708/src/example_api_usage.py +191 -0
- featrixsphere-0.2.6708/src/example_prediction_feedback.py +121 -0
- featrixsphere-0.2.6708/src/example_train_predictor.py +116 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/celery_job_recovery.py +272 -9
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/convergence_monitor.py +27 -4
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/es_training.py +25 -5
- featrixsphere-0.2.6708/src/lib/featrix/auto_calibrate.py +924 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/adaptive_event_log.py +14 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/auc_animation.py +423 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/calibration_utils.py +218 -146
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/charting.py +181 -50
- featrixsphere-0.2.6708/src/lib/featrix/neural/checkpoint_validation.py +697 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/cluster_cohesion_tracker.py +307 -4
- featrixsphere-0.2.6708/src/lib/featrix/neural/constants.py +30 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/data_fips.py +3391 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/data_free_email_domains.py +4884 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/default_training_rules.py +127 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/detect.py +895 -3
- featrixsphere-0.2.6708/src/lib/featrix/neural/domain_codec.py +504 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/dropout_scheduler.py +58 -4
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/dynamic_relationship_extractor.py +1845 -66
- featrixsphere-0.2.6708/src/lib/featrix/neural/email_codec.py +455 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/email_domain_ops.py +227 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/embedded_space.py +2481 -655
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/embedding_utils.py +5 -2
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/encoders.py +1161 -182
- featrixsphere-0.2.6708/src/lib/featrix/neural/es_training_callbacks.py +353 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/fips_codec.py +522 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/foundation_input_data.py +221 -54
- featrixsphere-0.2.6708/src/lib/featrix/neural/geo_json_codec.py +530 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/geo_json_ops.py +710 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/geo_spread.py +436 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/geocode.py +587 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/gpu_utils.py +242 -5
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/gradient_flow.py +1 -1
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/guardrails.py +63 -24
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/hybrid_column_detector.py +199 -37
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/hybrid_encoders.py +257 -75
- featrixsphere-0.2.6708/src/lib/featrix/neural/hybrid_scalar_set_codec.py +600 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/input_data_set.py +55 -2
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/io_utils.py +120 -184
- featrixsphere-0.2.6708/src/lib/featrix/neural/junction_adapter.py +108 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/llm/schema_analyzer.py +102 -35
- featrixsphere-0.2.6708/src/lib/featrix/neural/loss_framework.py +1663 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/loss_functions/__init__.py +12 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/loss_functions/list_versions.py +95 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/loss_functions/loss_functions_01Jan2026.py +585 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/loss_functions/loss_functions_01Jul2025.py +633 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/loss_functions/loss_functions_21Jan2026.py +592 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/loss_short_embedding.py +241 -10
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/lr_timeline.py +6 -3
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/mask_bias_tracker.py +93 -25
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/model_config.py +10 -1
- featrixsphere-0.2.6708/src/lib/featrix/neural/phone_codec.py +925 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/qa/test_all_codecs.py +790 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/qa/test_cls_vs_mean_pooling.py +259 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/qa/test_phone_zip_geo.py +424 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_predict_during_training.py +102 -118
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/relationship_estimator.py +3 -10
- featrixsphere-0.2.6708/src/lib/featrix/neural/relationship_ops_base.py +325 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/scalar_codec.py +260 -167
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/set_codec.py +136 -26
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/setlist_codec.py +3 -2
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/simple_mlp.py +98 -22
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/simple_string_cache.py +4 -10
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/single_predictor.py +2933 -689
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/sphere_config.py +483 -30
- featrixsphere-0.2.6708/src/lib/featrix/neural/sphere_init.py +138 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/sqlite_utils.py +384 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/strategy_ops_base.py +284 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/strategy_scalar_scalar_ops.py +5 -8
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/strategy_set_scalar_ops.py +6 -8
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/strategy_string_scalar_ops.py +6 -8
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/string_analysis.py +384 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/string_cache.py +0 -14
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/string_codec.py +317 -199
- featrixsphere-0.2.6708/src/lib/featrix/neural/tensor_utils.py +181 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/timestamp_codec.py +8 -6
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/training_banner.py +19 -21
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/training_context_manager.py +33 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/training_data_timeline.py +55 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/training_history_db.py +10 -5
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/training_logger.py +3 -3
- featrixsphere-0.2.6708/src/lib/featrix/neural/training_rules.py +672 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/transformer_encoder.py +487 -116
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/type_aware_ops_config.py +39 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/vector_codec.py +3 -2
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/weight_timeline.py +210 -13
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/world_data.py +108 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/xgboost_classifier.py +437 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/year_json_codec.py +563 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/year_json_ops.py +526 -0
- featrixsphere-0.2.6708/src/lib/featrix/neural/zip_codec.py +797 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/job_manager.py +10 -2
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/model_card_repair.py +39 -3
- featrixsphere-0.2.6708/src/lib/runtime_version_manager.py +469 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/session_manager.py +6 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/single_predictor_training.py +51 -25
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/structureddata.py +26 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/vector_db.py +77 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/weightwatcher_tracking.py +84 -5
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/load_and_test_model.py +12 -9
- featrixsphere-0.2.6708/src/prediction_server.py +682 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/system_monitor.py +159 -2
- featrixsphere-0.2.6708/tests/test_checkpoint_on_taco.py +107 -0
- featrixsphere-0.2.6708/tests/test_foundation_mode_local.py +374 -0
- featrixsphere-0.2.6708/tests/test_local_checkpoint.py +80 -0
- featrixsphere-0.2.6708/tests/test_runtime_version_manager.py +146 -0
- featrixsphere-0.2.6127/VERSION +0 -1
- featrixsphere-0.2.6127/src/demo_label_updates.py +0 -259
- featrixsphere-0.2.6127/src/example_api_usage.py +0 -195
- featrixsphere-0.2.6127/src/example_prediction_feedback.py +0 -109
- featrixsphere-0.2.6127/src/example_train_predictor.py +0 -106
- featrixsphere-0.2.6127/src/lib/featrix/neural/domain_codec.py +0 -471
- featrixsphere-0.2.6127/src/lib/featrix/neural/random_utils.py +0 -412
- featrixsphere-0.2.6127/src/lib/featrix/neural/sqlite_utils.py +0 -184
- featrixsphere-0.2.6127/src/lib/featrix/neural/xgboost_classifier.py +0 -263
- featrixsphere-0.2.6127/src/prediction_server.py +0 -337
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/MANIFEST.in +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/README.md +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/featrix-update.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/featrixsphere/api/__init__.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/featrixsphere/api/api_endpoint.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/featrixsphere/api/client.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/featrixsphere/api/notebook_helper.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/featrixsphere/api/reference_record.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/featrixsphere/api/vector_database.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/featrixsphere.egg-info/dependency_links.txt +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/featrixsphere.egg-info/entry_points.txt +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/featrixsphere.egg-info/not-zip-safe +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/featrixsphere.egg-info/requires.txt +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/featrixsphere.egg-info/top_level.txt +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/nv-install.sh +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/setup.cfg +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/setup.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/auto_upgrade_monitor.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/build_version.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/cluster_movie_renderer.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/config.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/demo_existing_model.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/deploy.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/deploy_cache_debug.sh +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/ensure_watchdog_running.sh +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/error_tracker.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/event_log.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/featrix_watchdog.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/gc_cleanup.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/api_event_retry.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/backing_db.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/crash_tracker.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/distribution_shift_detector.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/embedding_space_io.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/epoch_projections.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/es_projections.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/es_training_wrapper.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/__init__.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/download-data/build_geo_weather_db.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/download-data/download_geographic_data.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/download-data/download_road_data.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/download-data/download_weather_data.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/download-data/install-data.sh +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/__init__.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/causal_relationship_scorer.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/classification_metrics.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/config.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/curve_plots_example.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/customer_quality_tracker.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/data_frame_data_set.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/dataloader_utils.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/dimension_validator.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/duration_ops.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/embedding_lr_scheduler.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/embedding_quality.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/embedding_space_utils.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/enrich.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/es_projection.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/exceptions.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/featrix_csv.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/featrix_json.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/featrix_module_dict.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/featrix_token.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/feature_effectiveness_tracker.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/feature_engineer.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/feature_suggestion_tracker.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/geo_foundation.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/geo_ops.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/graph_encoder.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/graph_encoder_training.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/host_memory_tracker.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/hubspot_free_domains_list_may_2025.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/hyperparam_search.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/input_data_file.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/integrity.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/ip_address_ops.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/json_cache.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/json_codec.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/llm/__init__.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/local_string_cache.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/logging_config.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/mask_tracker.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/model_hash.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/movie_frame_task.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/multi_table_dataset.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/multi_table_embedding_space.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/network_viz.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/pair_scorer.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/per_epoch_quality.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/platform_utils.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/prng_control.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/demo_advisor_decisions.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/example_complete_workflow.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/generate_focal_report.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/model_advisor.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/show_results.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_adaptive_loss_benchmark.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_adaptive_training.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_checkpoint_dict_reconstruction.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_confusion_matrix_metadata.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_data_timestamps.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_embedding_quality.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_embedding_space.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_epoch_class_separation.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_extend_embedding_space.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_feature_engineering_prediction.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_focal_comparison.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_focal_comparison_enhanced.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_focal_loss_single_predictor.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_hybrid_columns.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_label_smoothing.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_lift_measurement_validation.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_lr_timeline_smoothness.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_min_support_rank_scaling.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_monitor_integration.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_multi_dataset.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_piecewise_epochs.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_relationship_extractor_integration.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_relationship_extractor_mixed_types.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_set_encoder_strategies.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_temporal_relationships.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_timeline_quick.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_training_data_timeline.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_training_monitor.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/test_warning_tracking.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/qa/visualize_training_timeline.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/relationship_complexity.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/relationship_extractor.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/relationship_importance_validator.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/relationship_performance.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/relationship_preanalysis.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/relationship_search.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/scalar_scalar_ops.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/scalar_timestamp_ops.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/schema_history.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/set_scalar_ops.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/set_set_ops.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/set_timestamp_ops.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/single_predictor_mlp.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/stopwatch.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/string_list_codec.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/string_scalar_ops.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/string_set_ops.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/temporal_relationship_ops.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/timeline_events.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/tools/__init__.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/tools/compare_clusters.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/training_event.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/training_exceptions.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/training_movie_writer.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/training_timeline.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/url_codec.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/url_ops.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/url_parser.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/us_holidays.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/utils.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix/neural/webhooks.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/featrix_debug.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/json_encoder_cache.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/knn_training.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/meta_learning_client.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/model_repair.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/pre_analysis_wrapper.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/queue_manager.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/quick_architecture_search.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/session_chains.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/single_predictor_cv.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/sp_training_wrapper.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/sphere_config.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/system_health_monitor.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/training_monitor.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/utils.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/lib/webhook_helpers.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/llm_client.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/manage_churro.sh +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/migrate_string_cache_naming.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/neural.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/node-install.sh +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/prediction_client.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/prediction_drift_monitor.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/prediction_persistence_worker.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/query_schema_worker.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/quick_test_deployment.sh +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/recreate_session.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/redis_job_progress.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/redis_prediction_cli.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/redis_prediction_store.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/regenerate_training_movie.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/render_sphere.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/repair_checkpoint.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/repair_model.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/resubmit_es_completion.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/run_api_server.sh +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/send_email.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/slack.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/standalone_prediction.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/start_celery_cpu_worker.sh +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/start_celery_gpu_worker.sh +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/start_celery_movie_worker.sh +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/tail-watch.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/test_api_client.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/tree.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/upgrade-taco-python312.sh +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/utils.py +0 -0
- {featrixsphere-0.2.6127 → featrixsphere-0.2.6708}/src/version.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.2.6708
|
|
@@ -566,6 +566,28 @@ class FoundationalModel:
|
|
|
566
566
|
|
|
567
567
|
return self._ctx.get_json(f"/session/{self.id}/projections")
|
|
568
568
|
|
|
569
|
+
def get_sphere_preview(self, save_path: str = None) -> bytes:
|
|
570
|
+
"""
|
|
571
|
+
Get the 2D sphere projection preview image (PNG).
|
|
572
|
+
|
|
573
|
+
Args:
|
|
574
|
+
save_path: Optional path to save the PNG file. If provided, the image
|
|
575
|
+
will be written to this path.
|
|
576
|
+
|
|
577
|
+
Returns:
|
|
578
|
+
Raw PNG image bytes.
|
|
579
|
+
"""
|
|
580
|
+
if not self._ctx:
|
|
581
|
+
raise ValueError("FoundationalModel not connected to client")
|
|
582
|
+
|
|
583
|
+
png_bytes = self._ctx.get_bytes(f"/session/{self.id}/preview")
|
|
584
|
+
|
|
585
|
+
if save_path:
|
|
586
|
+
with open(save_path, 'wb') as f:
|
|
587
|
+
f.write(png_bytes)
|
|
588
|
+
|
|
589
|
+
return png_bytes
|
|
590
|
+
|
|
569
591
|
def get_training_metrics(self) -> Dict[str, Any]:
|
|
570
592
|
"""Get training metrics and history."""
|
|
571
593
|
if not self._ctx:
|
|
@@ -640,6 +662,272 @@ class FoundationalModel:
|
|
|
640
662
|
cleaned[key] = value
|
|
641
663
|
return cleaned
|
|
642
664
|
|
|
665
|
+
def get_columns(self) -> List[str]:
|
|
666
|
+
"""
|
|
667
|
+
Get the column names in this foundational model's embedding space.
|
|
668
|
+
|
|
669
|
+
Returns:
|
|
670
|
+
List of column name strings
|
|
671
|
+
|
|
672
|
+
Example:
|
|
673
|
+
columns = fm.get_columns()
|
|
674
|
+
print(columns) # ['age', 'income', 'city', ...]
|
|
675
|
+
"""
|
|
676
|
+
if not self._ctx:
|
|
677
|
+
raise ValueError("FoundationalModel not connected to client")
|
|
678
|
+
|
|
679
|
+
response = self._ctx.get_json(f"/compute/session/{self.id}/columns")
|
|
680
|
+
return response.get('columns', [])
|
|
681
|
+
|
|
682
|
+
@property
|
|
683
|
+
def columns(self) -> List[str]:
|
|
684
|
+
"""Column names in this foundational model's embedding space."""
|
|
685
|
+
return self.get_columns()
|
|
686
|
+
|
|
687
|
+
def clone(
|
|
688
|
+
self,
|
|
689
|
+
target_compute_cluster: Optional[str] = None,
|
|
690
|
+
new_name: Optional[str] = None,
|
|
691
|
+
source_compute_cluster: Optional[str] = None,
|
|
692
|
+
) -> 'FoundationalModel':
|
|
693
|
+
"""
|
|
694
|
+
Clone this embedding space, optionally to a different compute node.
|
|
695
|
+
|
|
696
|
+
Args:
|
|
697
|
+
target_compute_cluster: Target compute cluster (None = same node)
|
|
698
|
+
new_name: Name for the cloned session
|
|
699
|
+
source_compute_cluster: Source compute cluster (if routing needed)
|
|
700
|
+
|
|
701
|
+
Returns:
|
|
702
|
+
New FoundationalModel instance for the cloned embedding space
|
|
703
|
+
|
|
704
|
+
Example:
|
|
705
|
+
cloned = fm.clone(
|
|
706
|
+
target_compute_cluster="churro",
|
|
707
|
+
new_name="my-model-clone"
|
|
708
|
+
)
|
|
709
|
+
"""
|
|
710
|
+
if not self._ctx:
|
|
711
|
+
raise ValueError("FoundationalModel not connected to client")
|
|
712
|
+
|
|
713
|
+
data = {
|
|
714
|
+
"to_compute": target_compute_cluster,
|
|
715
|
+
"new_session_name": new_name,
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
response = self._ctx.post_json(
|
|
719
|
+
f"/compute/session/{self.id}/clone_embedding_space",
|
|
720
|
+
data=data
|
|
721
|
+
)
|
|
722
|
+
|
|
723
|
+
new_session_id = response.get('new_session_id', '')
|
|
724
|
+
return FoundationalModel(
|
|
725
|
+
id=new_session_id,
|
|
726
|
+
name=new_name,
|
|
727
|
+
status="done",
|
|
728
|
+
created_at=datetime.now(),
|
|
729
|
+
_ctx=self._ctx,
|
|
730
|
+
)
|
|
731
|
+
|
|
732
|
+
def refresh(self) -> Dict[str, Any]:
|
|
733
|
+
"""
|
|
734
|
+
Refresh this foundational model's state from the server.
|
|
735
|
+
|
|
736
|
+
Returns the full server-side info for this model, and updates
|
|
737
|
+
local attributes (status, epochs, dimensions, etc.).
|
|
738
|
+
|
|
739
|
+
Returns:
|
|
740
|
+
Full model info dictionary from the server
|
|
741
|
+
|
|
742
|
+
Example:
|
|
743
|
+
info = fm.refresh()
|
|
744
|
+
print(fm.status) # Updated from server
|
|
745
|
+
print(fm.epochs) # Updated from server
|
|
746
|
+
"""
|
|
747
|
+
if not self._ctx:
|
|
748
|
+
raise ValueError("FoundationalModel not connected to client")
|
|
749
|
+
|
|
750
|
+
data = self._ctx.get_json(f"/compute/session/{self.id}")
|
|
751
|
+
self._update_from_session(data)
|
|
752
|
+
self.status = data.get('status', self.status)
|
|
753
|
+
return data
|
|
754
|
+
|
|
755
|
+
def is_ready(self) -> bool:
|
|
756
|
+
"""
|
|
757
|
+
Check if this foundational model has finished training and is ready for use.
|
|
758
|
+
|
|
759
|
+
Returns:
|
|
760
|
+
True if training is complete, False otherwise
|
|
761
|
+
|
|
762
|
+
Example:
|
|
763
|
+
if fm.is_ready():
|
|
764
|
+
predictor = fm.create_classifier(target_column="target")
|
|
765
|
+
"""
|
|
766
|
+
if not self._ctx:
|
|
767
|
+
raise ValueError("FoundationalModel not connected to client")
|
|
768
|
+
|
|
769
|
+
data = self._ctx.get_json(f"/compute/session/{self.id}")
|
|
770
|
+
status = data.get('status', 'unknown')
|
|
771
|
+
self.status = status
|
|
772
|
+
return status == 'done'
|
|
773
|
+
|
|
774
|
+
def publish(
|
|
775
|
+
self,
|
|
776
|
+
org_id: str,
|
|
777
|
+
name: Optional[str] = None,
|
|
778
|
+
) -> Dict[str, Any]:
|
|
779
|
+
"""
|
|
780
|
+
Publish this foundational model to the production directory.
|
|
781
|
+
|
|
782
|
+
Published models are protected from garbage collection and available
|
|
783
|
+
across all compute nodes via the shared backplane.
|
|
784
|
+
|
|
785
|
+
Args:
|
|
786
|
+
org_id: Organization ID for directory organization
|
|
787
|
+
name: Name for the published model (defaults to self.name)
|
|
788
|
+
|
|
789
|
+
Returns:
|
|
790
|
+
dict with published_path, output_path, and status
|
|
791
|
+
|
|
792
|
+
Example:
|
|
793
|
+
fm = featrix.create_foundational_model(name="my_model", csv_file="data.csv")
|
|
794
|
+
fm.wait_for_training()
|
|
795
|
+
fm.publish(org_id="my_org", name="my_model_v1")
|
|
796
|
+
"""
|
|
797
|
+
if not self._ctx:
|
|
798
|
+
raise ValueError("FoundationalModel not connected to client")
|
|
799
|
+
|
|
800
|
+
publish_name = name or self.name
|
|
801
|
+
if not publish_name:
|
|
802
|
+
raise ValueError("name is required (either pass it or set it on the model)")
|
|
803
|
+
|
|
804
|
+
data = {
|
|
805
|
+
"org_id": org_id,
|
|
806
|
+
"name": publish_name,
|
|
807
|
+
}
|
|
808
|
+
return self._ctx.post_json(f"/compute/session/{self.id}/publish", data=data)
|
|
809
|
+
|
|
810
|
+
def deprecate(
|
|
811
|
+
self,
|
|
812
|
+
warning_message: str,
|
|
813
|
+
expiration_date: str,
|
|
814
|
+
) -> Dict[str, Any]:
|
|
815
|
+
"""
|
|
816
|
+
Deprecate this published model with a warning and expiration date.
|
|
817
|
+
|
|
818
|
+
The model remains available until the expiration date. Prediction
|
|
819
|
+
responses will include a model_expiration field warning consumers.
|
|
820
|
+
|
|
821
|
+
Args:
|
|
822
|
+
warning_message: Warning message to display
|
|
823
|
+
expiration_date: ISO format date string (e.g., "2026-06-01T00:00:00Z")
|
|
824
|
+
|
|
825
|
+
Returns:
|
|
826
|
+
dict with deprecation status
|
|
827
|
+
|
|
828
|
+
Example:
|
|
829
|
+
from datetime import datetime, timedelta
|
|
830
|
+
expiration = (datetime.now() + timedelta(days=90)).isoformat() + "Z"
|
|
831
|
+
fm.deprecate(
|
|
832
|
+
warning_message="Replaced by v2. Migrate by expiration.",
|
|
833
|
+
expiration_date=expiration
|
|
834
|
+
)
|
|
835
|
+
"""
|
|
836
|
+
if not self._ctx:
|
|
837
|
+
raise ValueError("FoundationalModel not connected to client")
|
|
838
|
+
|
|
839
|
+
data = {
|
|
840
|
+
"warning_message": warning_message,
|
|
841
|
+
"expiration_date": expiration_date,
|
|
842
|
+
}
|
|
843
|
+
return self._ctx.post_json(f"/compute/session/{self.id}/deprecate", data=data)
|
|
844
|
+
|
|
845
|
+
def unpublish(self) -> Dict[str, Any]:
|
|
846
|
+
"""
|
|
847
|
+
Unpublish this model, moving it back from the published directory.
|
|
848
|
+
|
|
849
|
+
WARNING: After unpublishing, the model is subject to garbage
|
|
850
|
+
collection and may be deleted when disk space is low.
|
|
851
|
+
|
|
852
|
+
Returns:
|
|
853
|
+
dict with unpublish status
|
|
854
|
+
|
|
855
|
+
Example:
|
|
856
|
+
fm.unpublish()
|
|
857
|
+
"""
|
|
858
|
+
if not self._ctx:
|
|
859
|
+
raise ValueError("FoundationalModel not connected to client")
|
|
860
|
+
|
|
861
|
+
return self._ctx.post_json(f"/compute/session/{self.id}/unpublish", data={})
|
|
862
|
+
|
|
863
|
+
def publish_checkpoint(
|
|
864
|
+
self,
|
|
865
|
+
name: str,
|
|
866
|
+
org_id: Optional[str] = None,
|
|
867
|
+
checkpoint_epoch: Optional[int] = None,
|
|
868
|
+
session_name_prefix: Optional[str] = None,
|
|
869
|
+
publish: bool = True,
|
|
870
|
+
) -> 'FoundationalModel':
|
|
871
|
+
"""
|
|
872
|
+
Publish a checkpoint from this model's training as a new foundation model.
|
|
873
|
+
|
|
874
|
+
Creates a NEW FoundationalModel from a training checkpoint with full
|
|
875
|
+
provenance tracking. Useful for snapshotting good intermediate models
|
|
876
|
+
while training continues.
|
|
877
|
+
|
|
878
|
+
Args:
|
|
879
|
+
name: Name for the new foundation model (required)
|
|
880
|
+
org_id: Organization ID (required if publish=True)
|
|
881
|
+
checkpoint_epoch: Which epoch checkpoint to use (None = best/latest)
|
|
882
|
+
session_name_prefix: Optional prefix for the new session ID
|
|
883
|
+
publish: Move to published directory (default: True)
|
|
884
|
+
|
|
885
|
+
Returns:
|
|
886
|
+
New FoundationalModel instance for the published checkpoint
|
|
887
|
+
|
|
888
|
+
Example:
|
|
889
|
+
# Snapshot epoch 50 while training continues
|
|
890
|
+
checkpoint_fm = fm.publish_checkpoint(
|
|
891
|
+
name="My Model v0.5",
|
|
892
|
+
org_id="my_org",
|
|
893
|
+
checkpoint_epoch=50
|
|
894
|
+
)
|
|
895
|
+
# Use immediately
|
|
896
|
+
predictor = checkpoint_fm.create_classifier(target_column="target")
|
|
897
|
+
"""
|
|
898
|
+
if not self._ctx:
|
|
899
|
+
raise ValueError("FoundationalModel not connected to client")
|
|
900
|
+
|
|
901
|
+
if publish and not org_id:
|
|
902
|
+
raise ValueError("org_id is required when publish=True")
|
|
903
|
+
|
|
904
|
+
data = {
|
|
905
|
+
"name": name,
|
|
906
|
+
"publish": publish,
|
|
907
|
+
}
|
|
908
|
+
if checkpoint_epoch is not None:
|
|
909
|
+
data["checkpoint_epoch"] = checkpoint_epoch
|
|
910
|
+
if session_name_prefix:
|
|
911
|
+
data["session_name_prefix"] = session_name_prefix
|
|
912
|
+
if org_id:
|
|
913
|
+
data["org_id"] = org_id
|
|
914
|
+
|
|
915
|
+
response = self._ctx.post_json(
|
|
916
|
+
f"/compute/session/{self.id}/publish_partial_foundation",
|
|
917
|
+
data=data
|
|
918
|
+
)
|
|
919
|
+
|
|
920
|
+
new_fm = FoundationalModel(
|
|
921
|
+
id=response.get("foundation_session_id", ""),
|
|
922
|
+
name=name,
|
|
923
|
+
status="done",
|
|
924
|
+
epochs=response.get("checkpoint_epoch"),
|
|
925
|
+
created_at=datetime.now(),
|
|
926
|
+
_ctx=self._ctx,
|
|
927
|
+
)
|
|
928
|
+
|
|
929
|
+
return new_fm
|
|
930
|
+
|
|
643
931
|
def to_dict(self) -> Dict[str, Any]:
|
|
644
932
|
"""Convert to dictionary representation."""
|
|
645
933
|
return {
|
|
@@ -121,14 +121,34 @@ class HTTPClientMixin:
|
|
|
121
121
|
|
|
122
122
|
def _unwrap_response(self, response_json: Dict[str, Any]) -> Dict[str, Any]:
|
|
123
123
|
"""
|
|
124
|
-
Unwrap server response, handling
|
|
124
|
+
Unwrap server response, handling wrapper formats.
|
|
125
125
|
|
|
126
|
-
The server
|
|
126
|
+
The server may wrap responses as:
|
|
127
|
+
- {"response": {...}}
|
|
128
|
+
- {"_meta": {...}, "data": {...}}
|
|
129
|
+
|
|
130
|
+
Captures server metadata when present.
|
|
127
131
|
"""
|
|
128
|
-
if isinstance(response_json, dict)
|
|
129
|
-
|
|
132
|
+
if isinstance(response_json, dict):
|
|
133
|
+
# Handle _meta/data wrapper (captures server metadata)
|
|
134
|
+
if '_meta' in response_json and 'data' in response_json:
|
|
135
|
+
self._last_server_metadata = response_json['_meta']
|
|
136
|
+
return response_json['data']
|
|
137
|
+
# Handle response wrapper
|
|
138
|
+
if 'response' in response_json and len(response_json) == 1:
|
|
139
|
+
return response_json['response']
|
|
130
140
|
return response_json
|
|
131
141
|
|
|
142
|
+
@property
|
|
143
|
+
def last_server_metadata(self) -> Optional[Dict[str, Any]]:
|
|
144
|
+
"""
|
|
145
|
+
Metadata from the most recent server response.
|
|
146
|
+
|
|
147
|
+
Contains server info like compute_cluster_time, compute_cluster,
|
|
148
|
+
compute_cluster_version, etc.
|
|
149
|
+
"""
|
|
150
|
+
return getattr(self, '_last_server_metadata', None)
|
|
151
|
+
|
|
132
152
|
def _get_json(
|
|
133
153
|
self,
|
|
134
154
|
endpoint: str,
|
|
@@ -139,6 +159,16 @@ class HTTPClientMixin:
|
|
|
139
159
|
response = self._make_request("GET", endpoint, max_retries=max_retries, **kwargs)
|
|
140
160
|
return self._unwrap_response(response.json())
|
|
141
161
|
|
|
162
|
+
def _get_bytes(
|
|
163
|
+
self,
|
|
164
|
+
endpoint: str,
|
|
165
|
+
max_retries: Optional[int] = None,
|
|
166
|
+
**kwargs
|
|
167
|
+
) -> bytes:
|
|
168
|
+
"""Make a GET request and return raw bytes (for binary content like images)."""
|
|
169
|
+
response = self._make_request("GET", endpoint, max_retries=max_retries, **kwargs)
|
|
170
|
+
return response.content
|
|
171
|
+
|
|
142
172
|
def _post_json(
|
|
143
173
|
self,
|
|
144
174
|
endpoint: str,
|
|
@@ -207,3 +237,6 @@ class ClientContext:
|
|
|
207
237
|
def post_multipart(self, endpoint: str, data: Dict[str, Any] = None,
|
|
208
238
|
files: Dict[str, Any] = None, **kwargs) -> Dict[str, Any]:
|
|
209
239
|
return self._client._post_multipart(endpoint, data, files, **kwargs)
|
|
240
|
+
|
|
241
|
+
def get_bytes(self, endpoint: str, **kwargs) -> bytes:
|
|
242
|
+
return self._client._get_bytes(endpoint, **kwargs)
|
|
@@ -23,11 +23,16 @@ class PredictionResult:
|
|
|
23
23
|
prediction: Raw prediction result (class probabilities or numeric value)
|
|
24
24
|
predicted_class: Predicted class name (for classification)
|
|
25
25
|
confidence: Confidence score (for classification)
|
|
26
|
+
probabilities: Full probability distribution (for classification)
|
|
27
|
+
threshold: Classification threshold (for binary classification)
|
|
26
28
|
query_record: Original input record
|
|
27
29
|
predictor_id: ID of predictor that made this prediction
|
|
28
30
|
session_id: Session ID (internal)
|
|
29
31
|
timestamp: When prediction was made
|
|
30
32
|
target_column: Target column name
|
|
33
|
+
guardrails: Per-column guardrail warnings (if any)
|
|
34
|
+
ignored_query_columns: Columns in input that were not used (not in training data)
|
|
35
|
+
available_query_columns: All columns the model knows about
|
|
31
36
|
|
|
32
37
|
Usage:
|
|
33
38
|
result = predictor.predict({"age": 35, "income": 50000})
|
|
@@ -35,6 +40,14 @@ class PredictionResult:
|
|
|
35
40
|
print(result.confidence) # 0.87
|
|
36
41
|
print(result.prediction_uuid) # UUID for feedback
|
|
37
42
|
|
|
43
|
+
# Check for guardrail warnings
|
|
44
|
+
if result.guardrails:
|
|
45
|
+
print(f"Warnings: {len(result.guardrails)} columns with issues")
|
|
46
|
+
|
|
47
|
+
# Check for ignored columns
|
|
48
|
+
if result.ignored_query_columns:
|
|
49
|
+
print(f"Ignored: {result.ignored_query_columns}")
|
|
50
|
+
|
|
38
51
|
# Send feedback if prediction was wrong
|
|
39
52
|
if result.predicted_class != actual_label:
|
|
40
53
|
feedback = result.send_feedback(ground_truth=actual_label)
|
|
@@ -44,14 +57,52 @@ class PredictionResult:
|
|
|
44
57
|
prediction_uuid: Optional[str] = None
|
|
45
58
|
prediction: Optional[Union[Dict[str, float], float]] = None
|
|
46
59
|
predicted_class: Optional[str] = None
|
|
60
|
+
probability: Optional[float] = None
|
|
47
61
|
confidence: Optional[float] = None
|
|
62
|
+
probabilities: Optional[Dict[str, float]] = None
|
|
63
|
+
threshold: Optional[float] = None
|
|
48
64
|
query_record: Optional[Dict[str, Any]] = None
|
|
65
|
+
|
|
66
|
+
# Documentation fields - explain what prediction/probability/confidence mean
|
|
67
|
+
readme_prediction: str = field(default="The predicted class label (for classification) or value (for regression).")
|
|
68
|
+
readme_probability: str = field(default="Raw probability of the predicted class from the model's softmax output.")
|
|
69
|
+
readme_confidence: str = field(default=(
|
|
70
|
+
"For binary classification: normalized margin from threshold. "
|
|
71
|
+
"confidence = (prob - threshold) / (1 - threshold) if predicting positive, "
|
|
72
|
+
"or (threshold - prob) / threshold if predicting negative. "
|
|
73
|
+
"Ranges from 0 (at decision boundary) to 1 (maximally certain). "
|
|
74
|
+
"For multi-class: same as probability."
|
|
75
|
+
))
|
|
76
|
+
readme_threshold: str = field(default=(
|
|
77
|
+
"Decision boundary for binary classification. "
|
|
78
|
+
"If P(positive_class) >= threshold, predict positive; otherwise predict negative. "
|
|
79
|
+
"Calibrated to optimize F1 score on validation data."
|
|
80
|
+
))
|
|
81
|
+
readme_probabilities: str = field(default=(
|
|
82
|
+
"Full probability distribution across all classes from the model's softmax output. "
|
|
83
|
+
"Dictionary mapping class labels to their probabilities (sum to 1.0)."
|
|
84
|
+
))
|
|
85
|
+
readme_pos_label: str = field(default=(
|
|
86
|
+
"The class label considered 'positive' for binary classification metrics. "
|
|
87
|
+
"Threshold and confidence calculations are relative to this class."
|
|
88
|
+
))
|
|
49
89
|
predictor_id: Optional[str] = None
|
|
50
90
|
session_id: Optional[str] = None
|
|
51
91
|
target_column: Optional[str] = None
|
|
52
92
|
timestamp: Optional[datetime] = None
|
|
53
93
|
model_version: Optional[str] = None
|
|
54
94
|
|
|
95
|
+
# Checkpoint info from the model (epoch, metric_type, metric_value)
|
|
96
|
+
checkpoint_info: Optional[Dict[str, Any]] = None
|
|
97
|
+
|
|
98
|
+
# Guardrails and warnings
|
|
99
|
+
guardrails: Optional[Dict[str, Any]] = None
|
|
100
|
+
ignored_query_columns: Optional[list] = None
|
|
101
|
+
available_query_columns: Optional[list] = None
|
|
102
|
+
|
|
103
|
+
# Feature importance (from leave-one-out ablation)
|
|
104
|
+
feature_importance: Optional[Dict[str, float]] = None
|
|
105
|
+
|
|
55
106
|
# Internal: client context for sending feedback
|
|
56
107
|
_ctx: Optional['ClientContext'] = field(default=None, repr=False)
|
|
57
108
|
|
|
@@ -73,29 +124,44 @@ class PredictionResult:
|
|
|
73
124
|
Returns:
|
|
74
125
|
PredictionResult instance
|
|
75
126
|
"""
|
|
76
|
-
# Extract prediction data
|
|
127
|
+
# Extract prediction data - handle both formats
|
|
128
|
+
# New format: prediction is the class label, probabilities is separate
|
|
129
|
+
# Old format: prediction is the probabilities dict
|
|
77
130
|
prediction = response.get('prediction')
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
131
|
+
probabilities = response.get('probabilities')
|
|
132
|
+
predicted_class = response.get('predicted_class')
|
|
133
|
+
probability = response.get('probability')
|
|
134
|
+
confidence = response.get('confidence')
|
|
135
|
+
|
|
136
|
+
# For old format where prediction is the probabilities dict
|
|
137
|
+
if isinstance(prediction, dict) and not probabilities:
|
|
138
|
+
probabilities = prediction
|
|
84
139
|
if prediction:
|
|
85
140
|
predicted_class = max(prediction.keys(), key=lambda k: prediction[k])
|
|
86
|
-
|
|
141
|
+
probability = prediction[predicted_class]
|
|
142
|
+
confidence = probability # Old format: confidence = probability
|
|
143
|
+
elif isinstance(prediction, str) and not predicted_class:
|
|
144
|
+
# New format: prediction is already the class label
|
|
145
|
+
predicted_class = prediction
|
|
87
146
|
|
|
88
147
|
return cls(
|
|
89
148
|
prediction_uuid=response.get('prediction_uuid') or response.get('prediction_id'),
|
|
90
149
|
prediction=prediction,
|
|
91
150
|
predicted_class=predicted_class,
|
|
151
|
+
probability=probability,
|
|
92
152
|
confidence=confidence,
|
|
153
|
+
probabilities=probabilities,
|
|
154
|
+
threshold=response.get('threshold'),
|
|
93
155
|
query_record=query_record,
|
|
94
156
|
predictor_id=response.get('predictor_id'),
|
|
95
157
|
session_id=response.get('session_id'),
|
|
96
158
|
target_column=response.get('target_column'),
|
|
97
159
|
timestamp=datetime.now(),
|
|
98
160
|
model_version=response.get('model_version'),
|
|
161
|
+
checkpoint_info=response.get('checkpoint_info'),
|
|
162
|
+
guardrails=response.get('guardrails'),
|
|
163
|
+
ignored_query_columns=response.get('ignored_query_columns'),
|
|
164
|
+
available_query_columns=response.get('available_query_columns'),
|
|
99
165
|
_ctx=ctx,
|
|
100
166
|
)
|
|
101
167
|
|
|
@@ -126,18 +192,41 @@ class PredictionResult:
|
|
|
126
192
|
|
|
127
193
|
def to_dict(self) -> Dict[str, Any]:
|
|
128
194
|
"""Convert to dictionary representation."""
|
|
129
|
-
|
|
195
|
+
result = {
|
|
130
196
|
'prediction_uuid': self.prediction_uuid,
|
|
131
197
|
'prediction': self.prediction,
|
|
132
198
|
'predicted_class': self.predicted_class,
|
|
199
|
+
'probability': self.probability,
|
|
133
200
|
'confidence': self.confidence,
|
|
201
|
+
'probabilities': self.probabilities,
|
|
202
|
+
'threshold': self.threshold,
|
|
134
203
|
'query_record': self.query_record,
|
|
135
204
|
'predictor_id': self.predictor_id,
|
|
136
205
|
'session_id': self.session_id,
|
|
137
206
|
'target_column': self.target_column,
|
|
138
207
|
'timestamp': self.timestamp.isoformat() if self.timestamp else None,
|
|
139
208
|
'model_version': self.model_version,
|
|
209
|
+
# Documentation
|
|
210
|
+
'readme_prediction': self.readme_prediction,
|
|
211
|
+
'readme_probability': self.readme_probability,
|
|
212
|
+
'readme_confidence': self.readme_confidence,
|
|
213
|
+
'readme_threshold': self.readme_threshold,
|
|
214
|
+
'readme_probabilities': self.readme_probabilities,
|
|
215
|
+
'readme_pos_label': self.readme_pos_label,
|
|
140
216
|
}
|
|
217
|
+
# Include checkpoint_info if present
|
|
218
|
+
if self.checkpoint_info:
|
|
219
|
+
result['checkpoint_info'] = self.checkpoint_info
|
|
220
|
+
# Include guardrails if present
|
|
221
|
+
if self.guardrails:
|
|
222
|
+
result['guardrails'] = self.guardrails
|
|
223
|
+
if self.ignored_query_columns:
|
|
224
|
+
result['ignored_query_columns'] = self.ignored_query_columns
|
|
225
|
+
if self.available_query_columns:
|
|
226
|
+
result['available_query_columns'] = self.available_query_columns
|
|
227
|
+
if self.feature_importance:
|
|
228
|
+
result['feature_importance'] = self.feature_importance
|
|
229
|
+
return result
|
|
141
230
|
|
|
142
231
|
|
|
143
232
|
@dataclass
|
|
@@ -105,7 +105,8 @@ class Predictor:
|
|
|
105
105
|
def predict(
|
|
106
106
|
self,
|
|
107
107
|
record: Dict[str, Any],
|
|
108
|
-
best_metric_preference: Optional[str] = None
|
|
108
|
+
best_metric_preference: Optional[str] = None,
|
|
109
|
+
feature_importance: bool = False
|
|
109
110
|
) -> PredictionResult:
|
|
110
111
|
"""
|
|
111
112
|
Make a single prediction.
|
|
@@ -113,15 +114,21 @@ class Predictor:
|
|
|
113
114
|
Args:
|
|
114
115
|
record: Input record dictionary
|
|
115
116
|
best_metric_preference: Metric checkpoint to use ("roc_auc", "pr_auc", or None)
|
|
117
|
+
feature_importance: If True, compute feature importance via leave-one-out ablation
|
|
116
118
|
|
|
117
119
|
Returns:
|
|
118
|
-
PredictionResult with prediction, confidence, and prediction_uuid
|
|
120
|
+
PredictionResult with prediction, confidence, and prediction_uuid.
|
|
121
|
+
If feature_importance=True, also includes feature_importance dict.
|
|
119
122
|
|
|
120
123
|
Example:
|
|
121
124
|
result = predictor.predict({"age": 35, "income": 50000})
|
|
122
125
|
print(result.predicted_class) # "churned"
|
|
123
126
|
print(result.confidence) # 0.87
|
|
124
127
|
print(result.prediction_uuid) # UUID for feedback
|
|
128
|
+
|
|
129
|
+
# With feature importance
|
|
130
|
+
result = predictor.predict(record, feature_importance=True)
|
|
131
|
+
print(result.feature_importance) # {"income": 0.15, "age": 0.08, ...}
|
|
125
132
|
"""
|
|
126
133
|
if not self._ctx:
|
|
127
134
|
raise ValueError("Predictor not connected to client")
|
|
@@ -129,7 +136,44 @@ class Predictor:
|
|
|
129
136
|
# Clean the record
|
|
130
137
|
cleaned_record = self._clean_record(record)
|
|
131
138
|
|
|
132
|
-
|
|
139
|
+
if feature_importance:
|
|
140
|
+
# Build N+1 records: original + each feature nulled out
|
|
141
|
+
columns = list(cleaned_record.keys())
|
|
142
|
+
batch = [cleaned_record] # Original first
|
|
143
|
+
|
|
144
|
+
for col in columns:
|
|
145
|
+
ablated = cleaned_record.copy()
|
|
146
|
+
ablated[col] = None
|
|
147
|
+
batch.append(ablated)
|
|
148
|
+
|
|
149
|
+
# Single batch call
|
|
150
|
+
results = self.batch_predict(
|
|
151
|
+
batch,
|
|
152
|
+
show_progress=False,
|
|
153
|
+
best_metric_preference=best_metric_preference
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
# Compare: importance = |original_confidence - ablated_confidence|
|
|
157
|
+
original = results[0]
|
|
158
|
+
importance = {}
|
|
159
|
+
original_conf = original.confidence or 0.0
|
|
160
|
+
|
|
161
|
+
for i, col in enumerate(columns):
|
|
162
|
+
ablated_result = results[i + 1]
|
|
163
|
+
ablated_conf = ablated_result.confidence or 0.0
|
|
164
|
+
# Higher delta = more important
|
|
165
|
+
delta = abs(original_conf - ablated_conf)
|
|
166
|
+
importance[col] = round(delta, 4)
|
|
167
|
+
|
|
168
|
+
# Sort by importance (highest first)
|
|
169
|
+
original.feature_importance = dict(sorted(
|
|
170
|
+
importance.items(),
|
|
171
|
+
key=lambda x: x[1],
|
|
172
|
+
reverse=True
|
|
173
|
+
))
|
|
174
|
+
return original
|
|
175
|
+
|
|
176
|
+
# Standard single prediction
|
|
133
177
|
request_payload = {
|
|
134
178
|
"query_record": cleaned_record,
|
|
135
179
|
"predictor_id": self.id,
|
|
@@ -196,6 +240,36 @@ class Predictor:
|
|
|
196
240
|
|
|
197
241
|
return results
|
|
198
242
|
|
|
243
|
+
def predict_csv_file(
|
|
244
|
+
self,
|
|
245
|
+
csv_path: str,
|
|
246
|
+
show_progress: bool = True,
|
|
247
|
+
best_metric_preference: Optional[str] = None
|
|
248
|
+
) -> List[PredictionResult]:
|
|
249
|
+
"""
|
|
250
|
+
Load a CSV file and run batch predictions on all rows.
|
|
251
|
+
|
|
252
|
+
Args:
|
|
253
|
+
csv_path: Path to the CSV file
|
|
254
|
+
show_progress: Show progress bar
|
|
255
|
+
best_metric_preference: Metric checkpoint to use
|
|
256
|
+
|
|
257
|
+
Returns:
|
|
258
|
+
List of PredictionResult objects
|
|
259
|
+
|
|
260
|
+
Example:
|
|
261
|
+
results = predictor.predict_csv_file("test_data.csv")
|
|
262
|
+
for r in results:
|
|
263
|
+
print(r.predicted_class, r.confidence)
|
|
264
|
+
"""
|
|
265
|
+
import pandas as pd
|
|
266
|
+
df = pd.read_csv(csv_path)
|
|
267
|
+
return self.batch_predict(
|
|
268
|
+
df,
|
|
269
|
+
show_progress=show_progress,
|
|
270
|
+
best_metric_preference=best_metric_preference
|
|
271
|
+
)
|
|
272
|
+
|
|
199
273
|
def explain(
|
|
200
274
|
self,
|
|
201
275
|
record: Dict[str, Any],
|