featrixsphere 0.2.5182__tar.gz → 0.2.6127__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.
Files changed (298) hide show
  1. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/PKG-INFO +1 -1
  2. featrixsphere-0.2.6127/VERSION +1 -0
  3. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/featrixsphere/__init__.py +37 -18
  4. featrixsphere-0.2.6127/featrixsphere/api/__init__.py +50 -0
  5. featrixsphere-0.2.6127/featrixsphere/api/api_endpoint.py +280 -0
  6. featrixsphere-0.2.6127/featrixsphere/api/client.py +396 -0
  7. featrixsphere-0.2.6127/featrixsphere/api/foundational_model.py +658 -0
  8. featrixsphere-0.2.6127/featrixsphere/api/http_client.py +209 -0
  9. featrixsphere-0.2.6127/featrixsphere/api/notebook_helper.py +584 -0
  10. featrixsphere-0.2.6127/featrixsphere/api/prediction_result.py +231 -0
  11. featrixsphere-0.2.6127/featrixsphere/api/predictor.py +537 -0
  12. featrixsphere-0.2.6127/featrixsphere/api/reference_record.py +227 -0
  13. featrixsphere-0.2.6127/featrixsphere/api/vector_database.py +269 -0
  14. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/featrixsphere/client.py +397 -87
  15. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/featrixsphere.egg-info/PKG-INFO +1 -1
  16. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/featrixsphere.egg-info/SOURCES.txt +63 -1
  17. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/api.py +851 -159
  18. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/celery_app.py +486 -8
  19. featrixsphere-0.2.6127/src/cluster_movie_renderer.py +804 -0
  20. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/config.py +4 -0
  21. featrixsphere-0.2.6127/src/lib/backing_db.py +174 -0
  22. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/celery_job_recovery.py +223 -72
  23. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/epoch_projections.py +50 -60
  24. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/es_training.py +332 -35
  25. featrixsphere-0.2.6127/src/lib/featrix/download-data/build_geo_weather_db.py +445 -0
  26. featrixsphere-0.2.6127/src/lib/featrix/download-data/download_geographic_data.py +339 -0
  27. featrixsphere-0.2.6127/src/lib/featrix/download-data/download_road_data.py +408 -0
  28. featrixsphere-0.2.6127/src/lib/featrix/download-data/download_weather_data.py +404 -0
  29. featrixsphere-0.2.6127/src/lib/featrix/download-data/install-data.sh +370 -0
  30. featrixsphere-0.2.6127/src/lib/featrix/neural/__init__.py +26 -0
  31. featrixsphere-0.2.6127/src/lib/featrix/neural/adaptive_event_log.py +549 -0
  32. featrixsphere-0.2.6127/src/lib/featrix/neural/charting.py +1699 -0
  33. featrixsphere-0.2.6127/src/lib/featrix/neural/cluster_cohesion_tracker.py +485 -0
  34. featrixsphere-0.2.6127/src/lib/featrix/neural/curve_plots_example.py +869 -0
  35. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/detect.py +35 -5
  36. featrixsphere-0.2.6127/src/lib/featrix/neural/dimension_validator.py +350 -0
  37. featrixsphere-0.2.6127/src/lib/featrix/neural/duration_ops.py +455 -0
  38. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/dynamic_relationship_extractor.py +2722 -832
  39. featrixsphere-0.2.6127/src/lib/featrix/neural/email_domain_ops.py +1115 -0
  40. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/embedded_space.py +3484 -733
  41. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/embedding_space_utils.py +34 -1
  42. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/encoders.py +2068 -180
  43. featrixsphere-0.2.6127/src/lib/featrix/neural/foundation_input_data.py +765 -0
  44. featrixsphere-0.2.6127/src/lib/featrix/neural/geo_foundation.py +825 -0
  45. featrixsphere-0.2.6127/src/lib/featrix/neural/geo_ops.py +600 -0
  46. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/gpu_utils.py +7 -1
  47. featrixsphere-0.2.6127/src/lib/featrix/neural/gradient_flow.py +473 -0
  48. featrixsphere-0.2.6127/src/lib/featrix/neural/host_memory_tracker.py +256 -0
  49. featrixsphere-0.2.6127/src/lib/featrix/neural/hyperparam_search.py +362 -0
  50. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/input_data_set.py +18 -6
  51. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/io_utils.py +478 -99
  52. featrixsphere-0.2.6127/src/lib/featrix/neural/ip_address_ops.py +598 -0
  53. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/json_codec.py +23 -18
  54. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/logging_config.py +21 -8
  55. featrixsphere-0.2.6127/src/lib/featrix/neural/loss_short_embedding.py +465 -0
  56. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/lr_timeline.py +262 -110
  57. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/model_config.py +6 -3
  58. featrixsphere-0.2.6127/src/lib/featrix/neural/movie_frame_task.py +372 -0
  59. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/multi_table_dataset.py +4 -0
  60. featrixsphere-0.2.6127/src/lib/featrix/neural/pair_scorer.py +307 -0
  61. featrixsphere-0.2.6127/src/lib/featrix/neural/per_epoch_quality.py +318 -0
  62. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_adaptive_loss_benchmark.py +5 -10
  63. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_adaptive_training.py +2 -12
  64. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_confusion_matrix_metadata.py +2 -4
  65. featrixsphere-0.2.6127/src/lib/featrix/neural/qa/test_data_timestamps.py +120 -0
  66. featrixsphere-0.2.6127/src/lib/featrix/neural/qa/test_epoch_class_separation.py +441 -0
  67. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_extend_embedding_space.py +1 -14
  68. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_feature_engineering_prediction.py +1 -10
  69. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_focal_comparison.py +2 -3
  70. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_focal_comparison_enhanced.py +2 -3
  71. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_label_smoothing.py +2 -14
  72. featrixsphere-0.2.6127/src/lib/featrix/neural/qa/test_multi_dataset.py +389 -0
  73. featrixsphere-0.2.6127/src/lib/featrix/neural/qa/test_temporal_relationships.py +372 -0
  74. featrixsphere-0.2.6127/src/lib/featrix/neural/qa/test_training_data_timeline.py +93 -0
  75. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_warning_tracking.py +2 -6
  76. featrixsphere-0.2.6127/src/lib/featrix/neural/random_utils.py +412 -0
  77. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/relationship_estimator.py +52 -32
  78. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/scalar_codec.py +540 -108
  79. featrixsphere-0.2.6127/src/lib/featrix/neural/scalar_scalar_ops.py +234 -0
  80. featrixsphere-0.2.6127/src/lib/featrix/neural/scalar_timestamp_ops.py +359 -0
  81. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/set_codec.py +1091 -141
  82. featrixsphere-0.2.6127/src/lib/featrix/neural/set_scalar_ops.py +182 -0
  83. featrixsphere-0.2.6127/src/lib/featrix/neural/set_set_ops.py +237 -0
  84. featrixsphere-0.2.6127/src/lib/featrix/neural/set_timestamp_ops.py +382 -0
  85. featrixsphere-0.2.6127/src/lib/featrix/neural/simple_mlp.py +922 -0
  86. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/single_predictor.py +3791 -553
  87. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/single_predictor_mlp.py +18 -7
  88. featrixsphere-0.2.6127/src/lib/featrix/neural/sphere_config.py +1216 -0
  89. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/sqlite_utils.py +47 -1
  90. featrixsphere-0.2.6127/src/lib/featrix/neural/strategy_scalar_scalar_ops.py +341 -0
  91. featrixsphere-0.2.6127/src/lib/featrix/neural/strategy_set_scalar_ops.py +249 -0
  92. featrixsphere-0.2.6127/src/lib/featrix/neural/strategy_string_scalar_ops.py +244 -0
  93. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/string_analysis.py +2 -2
  94. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/string_cache.py +0 -1
  95. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/string_codec.py +240 -24
  96. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/string_list_codec.py +2 -0
  97. featrixsphere-0.2.6127/src/lib/featrix/neural/string_scalar_ops.py +211 -0
  98. featrixsphere-0.2.6127/src/lib/featrix/neural/string_set_ops.py +217 -0
  99. featrixsphere-0.2.6127/src/lib/featrix/neural/temporal_relationship_ops.py +508 -0
  100. featrixsphere-0.2.6127/src/lib/featrix/neural/timeline_events.py +40 -0
  101. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/timestamp_codec.py +43 -15
  102. featrixsphere-0.2.6127/src/lib/featrix/neural/tools/__init__.py +21 -0
  103. featrixsphere-0.2.6127/src/lib/featrix/neural/tools/compare_clusters.py +1240 -0
  104. featrixsphere-0.2.6127/src/lib/featrix/neural/training_context_manager.py +240 -0
  105. featrixsphere-0.2.6127/src/lib/featrix/neural/training_data_timeline.py +738 -0
  106. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/training_history_db.py +28 -13
  107. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/training_logger.py +335 -17
  108. featrixsphere-0.2.6127/src/lib/featrix/neural/training_movie_writer.py +807 -0
  109. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/training_timeline.py +1 -1
  110. featrixsphere-0.2.6127/src/lib/featrix/neural/transformer_encoder.py +1696 -0
  111. featrixsphere-0.2.6127/src/lib/featrix/neural/type_aware_ops_config.py +268 -0
  112. featrixsphere-0.2.6127/src/lib/featrix/neural/url_ops.py +1271 -0
  113. featrixsphere-0.2.6127/src/lib/featrix/neural/us_holidays.py +322 -0
  114. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/utils.py +255 -63
  115. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/vector_codec.py +9 -3
  116. featrixsphere-0.2.6127/src/lib/featrix/neural/webhooks.py +705 -0
  117. featrixsphere-0.2.6127/src/lib/featrix/neural/weight_timeline.py +1399 -0
  118. featrixsphere-0.2.6127/src/lib/featrix/neural/xgboost_classifier.py +263 -0
  119. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/job_manager.py +15 -0
  120. featrixsphere-0.2.6127/src/lib/model_card_repair.py +316 -0
  121. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/session_chains.py +101 -6
  122. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/session_manager.py +453 -202
  123. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/single_predictor_cv.py +1 -1
  124. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/single_predictor_training.py +462 -114
  125. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/sp_training_wrapper.py +2 -0
  126. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/structureddata.py +72 -0
  127. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/utils.py +38 -0
  128. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/weightwatcher_tracking.py +247 -258
  129. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/node-install.sh +25 -16
  130. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/regenerate_training_movie.py +2 -2
  131. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/start_celery_cpu_worker.sh +5 -2
  132. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/start_celery_gpu_worker.sh +6 -2
  133. featrixsphere-0.2.6127/src/upgrade-taco-python312.sh +160 -0
  134. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/system_monitor.py +295 -21
  135. featrixsphere-0.2.5182/VERSION +0 -1
  136. featrixsphere-0.2.5182/src/lib/featrix/neural/__init__.py +0 -9
  137. featrixsphere-0.2.5182/src/lib/featrix/neural/charting.py +0 -868
  138. featrixsphere-0.2.5182/src/lib/featrix/neural/movie_frame_task.py +0 -269
  139. featrixsphere-0.2.5182/src/lib/featrix/neural/simple_mlp.py +0 -353
  140. featrixsphere-0.2.5182/src/lib/featrix/neural/sphere_config.py +0 -507
  141. featrixsphere-0.2.5182/src/lib/featrix/neural/training_context_manager.py +0 -99
  142. featrixsphere-0.2.5182/src/lib/featrix/neural/transformer_encoder.py +0 -834
  143. featrixsphere-0.2.5182/src/lib/model_card_repair.py +0 -178
  144. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/MANIFEST.in +0 -0
  145. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/README.md +0 -0
  146. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/featrix-update.py +0 -0
  147. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/featrixsphere.egg-info/dependency_links.txt +0 -0
  148. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/featrixsphere.egg-info/entry_points.txt +0 -0
  149. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/featrixsphere.egg-info/not-zip-safe +0 -0
  150. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/featrixsphere.egg-info/requires.txt +0 -0
  151. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/featrixsphere.egg-info/top_level.txt +0 -0
  152. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/nv-install.sh +0 -0
  153. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/requirements.txt +0 -0
  154. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/setup.cfg +0 -0
  155. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/setup.py +0 -0
  156. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/auto_upgrade_monitor.py +0 -0
  157. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/build_version.py +0 -0
  158. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/demo_existing_model.py +0 -0
  159. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/demo_label_updates.py +0 -0
  160. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/deploy.py +0 -0
  161. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/deploy_cache_debug.sh +0 -0
  162. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/ensure_watchdog_running.sh +0 -0
  163. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/error_tracker.py +0 -0
  164. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/event_log.py +0 -0
  165. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/example_api_usage.py +0 -0
  166. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/example_prediction_feedback.py +0 -0
  167. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/example_train_predictor.py +0 -0
  168. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/featrix_watchdog.py +0 -0
  169. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/gc_cleanup.py +0 -0
  170. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/api_event_retry.py +0 -0
  171. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/convergence_monitor.py +0 -0
  172. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/crash_tracker.py +0 -0
  173. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/distribution_shift_detector.py +0 -0
  174. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/embedding_space_io.py +0 -0
  175. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/es_projections.py +0 -0
  176. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/es_training_wrapper.py +0 -0
  177. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/__init__.py +0 -0
  178. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/calibration_utils.py +0 -0
  179. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/causal_relationship_scorer.py +0 -0
  180. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/classification_metrics.py +0 -0
  181. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/config.py +0 -0
  182. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/customer_quality_tracker.py +0 -0
  183. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/data_frame_data_set.py +0 -0
  184. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/dataloader_utils.py +0 -0
  185. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/domain_codec.py +0 -0
  186. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/dropout_scheduler.py +0 -0
  187. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/embedding_lr_scheduler.py +0 -0
  188. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/embedding_quality.py +0 -0
  189. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/embedding_utils.py +0 -0
  190. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/enrich.py +0 -0
  191. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/es_projection.py +0 -0
  192. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/exceptions.py +0 -0
  193. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/featrix_csv.py +0 -0
  194. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/featrix_json.py +0 -0
  195. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/featrix_module_dict.py +0 -0
  196. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/featrix_token.py +0 -0
  197. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/feature_effectiveness_tracker.py +0 -0
  198. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/feature_engineer.py +0 -0
  199. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/feature_suggestion_tracker.py +0 -0
  200. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/graph_encoder.py +0 -0
  201. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/graph_encoder_training.py +0 -0
  202. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/guardrails.py +0 -0
  203. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/hubspot_free_domains_list_may_2025.py +0 -0
  204. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/hybrid_column_detector.py +0 -0
  205. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/hybrid_encoders.py +0 -0
  206. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/input_data_file.py +0 -0
  207. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/integrity.py +0 -0
  208. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/json_cache.py +0 -0
  209. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/llm/__init__.py +0 -0
  210. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/llm/schema_analyzer.py +0 -0
  211. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/local_string_cache.py +0 -0
  212. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/mask_bias_tracker.py +0 -0
  213. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/mask_tracker.py +0 -0
  214. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/model_hash.py +0 -0
  215. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/multi_table_embedding_space.py +0 -0
  216. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/network_viz.py +0 -0
  217. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/platform_utils.py +0 -0
  218. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/prng_control.py +0 -0
  219. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/demo_advisor_decisions.py +0 -0
  220. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/example_complete_workflow.py +0 -0
  221. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/generate_focal_report.py +0 -0
  222. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/model_advisor.py +0 -0
  223. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/show_results.py +0 -0
  224. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_checkpoint_dict_reconstruction.py +0 -0
  225. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_embedding_quality.py +0 -0
  226. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_embedding_space.py +0 -0
  227. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_focal_loss_single_predictor.py +0 -0
  228. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_hybrid_columns.py +0 -0
  229. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_lift_measurement_validation.py +0 -0
  230. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_lr_timeline_smoothness.py +0 -0
  231. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_min_support_rank_scaling.py +0 -0
  232. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_monitor_integration.py +0 -0
  233. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_piecewise_epochs.py +0 -0
  234. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_predict_during_training.py +0 -0
  235. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_relationship_extractor_integration.py +0 -0
  236. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_relationship_extractor_mixed_types.py +0 -0
  237. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_set_encoder_strategies.py +0 -0
  238. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_timeline_quick.py +0 -0
  239. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/test_training_monitor.py +0 -0
  240. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/qa/visualize_training_timeline.py +0 -0
  241. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/relationship_complexity.py +0 -0
  242. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/relationship_extractor.py +0 -0
  243. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/relationship_importance_validator.py +0 -0
  244. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/relationship_performance.py +0 -0
  245. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/relationship_preanalysis.py +0 -0
  246. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/relationship_search.py +0 -0
  247. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/schema_history.py +0 -0
  248. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/setlist_codec.py +0 -0
  249. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/simple_string_cache.py +0 -0
  250. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/stopwatch.py +0 -0
  251. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/training_banner.py +0 -0
  252. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/training_event.py +0 -0
  253. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/training_exceptions.py +0 -0
  254. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/url_codec.py +0 -0
  255. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/url_parser.py +0 -0
  256. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix/neural/world_data.py +0 -0
  257. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/featrix_debug.py +0 -0
  258. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/json_encoder_cache.py +0 -0
  259. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/knn_training.py +0 -0
  260. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/meta_learning_client.py +0 -0
  261. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/model_repair.py +0 -0
  262. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/pre_analysis_wrapper.py +0 -0
  263. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/queue_manager.py +0 -0
  264. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/quick_architecture_search.py +0 -0
  265. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/sphere_config.py +0 -0
  266. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/system_health_monitor.py +0 -0
  267. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/training_monitor.py +0 -0
  268. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/vector_db.py +0 -0
  269. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/lib/webhook_helpers.py +0 -0
  270. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/llm_client.py +0 -0
  271. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/load_and_test_model.py +0 -0
  272. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/manage_churro.sh +0 -0
  273. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/migrate_string_cache_naming.py +0 -0
  274. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/neural.py +0 -0
  275. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/prediction_client.py +0 -0
  276. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/prediction_drift_monitor.py +0 -0
  277. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/prediction_persistence_worker.py +0 -0
  278. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/prediction_server.py +0 -0
  279. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/query_schema_worker.py +0 -0
  280. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/quick_test_deployment.sh +0 -0
  281. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/recreate_session.py +0 -0
  282. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/redis_job_progress.py +0 -0
  283. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/redis_prediction_cli.py +0 -0
  284. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/redis_prediction_store.py +0 -0
  285. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/render_sphere.py +0 -0
  286. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/repair_checkpoint.py +0 -0
  287. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/repair_model.py +0 -0
  288. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/resubmit_es_completion.py +0 -0
  289. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/run_api_server.sh +0 -0
  290. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/send_email.py +0 -0
  291. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/slack.py +0 -0
  292. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/standalone_prediction.py +0 -0
  293. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/start_celery_movie_worker.sh +0 -0
  294. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/tail-watch.py +0 -0
  295. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/test_api_client.py +0 -0
  296. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/tree.py +0 -0
  297. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/utils.py +0 -0
  298. {featrixsphere-0.2.5182 → featrixsphere-0.2.6127}/src/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: featrixsphere
3
- Version: 0.2.5182
3
+ Version: 0.2.6127
4
4
  Summary: Transform any CSV into a production-ready ML model in minutes, not months.
5
5
  Home-page: https://github.com/Featrix/sphere
6
6
  Author: Featrix
@@ -0,0 +1 @@
1
+ 0.2.6127
@@ -3,42 +3,61 @@ Featrix Sphere API Client
3
3
 
4
4
  Transform any CSV into a production-ready ML model in minutes, not months.
5
5
 
6
- The Featrix Sphere API automatically builds neural embedding spaces from your data
7
- and trains high-accuracy predictors without requiring any ML expertise.
6
+ The Featrix Sphere API automatically builds neural embedding spaces from your data
7
+ and trains high-accuracy predictors without requiring any ML expertise.
8
8
  Just upload your data, specify what you want to predict, and get a production API endpoint.
9
9
 
10
- NEW: Beautiful training visualization with matplotlib plotting!
10
+ TWO API OPTIONS:
11
+ ----------------
12
+
13
+ 1. NEW Object-Oriented API (recommended for new projects):
14
+
15
+ >>> from featrixsphere.api import FeatrixSphere
16
+ >>>
17
+ >>> featrix = FeatrixSphere("http://your-server.com")
18
+ >>>
19
+ >>> # Create foundational model
20
+ >>> fm = featrix.create_foundational_model(
21
+ ... name="my_model",
22
+ ... csv_file="data.csv"
23
+ ... )
24
+ >>> fm.wait_for_training()
25
+ >>>
26
+ >>> # Create predictor
27
+ >>> predictor = fm.create_classifier(
28
+ ... target_column="target",
29
+ ... name="my_predictor"
30
+ ... )
31
+ >>> predictor.wait_for_training()
32
+ >>>
33
+ >>> # Make predictions
34
+ >>> result = predictor.predict({"feature": "value"})
35
+ >>> print(result.predicted_class)
36
+ >>> print(result.confidence)
37
+
38
+ 2. Classic API (for existing code):
11
39
 
12
- Example:
13
40
  >>> from featrixsphere import FeatrixSphereClient
14
41
  >>> import pandas as pd
15
- >>>
42
+ >>>
16
43
  >>> client = FeatrixSphereClient("http://your-server.com")
17
- >>>
44
+ >>>
18
45
  >>> # Upload DataFrame directly
19
46
  >>> df = pd.read_csv("data.csv")
20
47
  >>> session = client.upload_df_and_create_session(df=df)
21
- >>>
48
+ >>>
22
49
  >>> # Or upload CSV file directly (with automatic gzip compression)
23
50
  >>> session = client.upload_df_and_create_session(file_path="data.csv")
24
- >>>
51
+ >>>
25
52
  >>> # Train a predictor
26
53
  >>> client.train_single_predictor(session.session_id, "target_column", "set")
27
- >>>
54
+ >>>
28
55
  >>> # Make predictions
29
56
  >>> result = client.predict(session.session_id, {"feature": "value"})
30
57
  >>> print(result['prediction'])
31
- >>>
32
- >>> # NEW: Visualize training progress with beautiful plots!
33
- >>> fig = client.plot_training_loss(session.session_id, style='notebook')
34
- >>> # Returns matplotlib Figure - perfect for Jupyter notebooks!
35
- >>>
36
- >>> # Compare multiple training runs
37
- >>> client.plot_training_comparison(['session1', 'session2'],
38
- ... labels=['Experiment A', 'Experiment B'])
39
58
  """
40
59
 
41
- __version__ = "0.2.5182"
60
+ __version__ = "0.2.6127"
42
61
  __author__ = "Featrix"
43
62
  __email__ = "support@featrix.com"
44
63
  __license__ = "MIT"
@@ -0,0 +1,50 @@
1
+ """
2
+ FeatrixSphere New API
3
+
4
+ A clean, object-oriented API for interacting with FeatrixSphere.
5
+
6
+ Usage:
7
+ from featrixsphere.api import FeatrixSphere
8
+
9
+ featrix = FeatrixSphere("https://sphere-api.featrix.com")
10
+
11
+ # Create foundational model
12
+ fm = featrix.create_foundational_model(
13
+ name="my_model",
14
+ csv_file="data.csv"
15
+ )
16
+ fm.wait_for_training()
17
+
18
+ # Create predictor
19
+ predictor = fm.create_classifier(
20
+ name="my_classifier",
21
+ target_column="target"
22
+ )
23
+ predictor.wait_for_training()
24
+
25
+ # Make predictions
26
+ result = predictor.predict({"feature1": "value1"})
27
+ print(result.predicted_class)
28
+ print(result.confidence)
29
+ """
30
+
31
+ from .client import FeatrixSphere
32
+ from .foundational_model import FoundationalModel
33
+ from .predictor import Predictor
34
+ from .prediction_result import PredictionResult, PredictionFeedback
35
+ from .vector_database import VectorDatabase
36
+ from .reference_record import ReferenceRecord
37
+ from .api_endpoint import APIEndpoint
38
+ from .notebook_helper import FeatrixNotebookHelper
39
+
40
+ __all__ = [
41
+ 'FeatrixSphere',
42
+ 'FoundationalModel',
43
+ 'Predictor',
44
+ 'PredictionResult',
45
+ 'PredictionFeedback',
46
+ 'VectorDatabase',
47
+ 'ReferenceRecord',
48
+ 'APIEndpoint',
49
+ 'FeatrixNotebookHelper',
50
+ ]
@@ -0,0 +1,280 @@
1
+ """
2
+ APIEndpoint class for FeatrixSphere API.
3
+
4
+ Represents a named API endpoint for a predictor with optional API key authentication.
5
+ """
6
+
7
+ import logging
8
+ from dataclasses import dataclass, field
9
+ from datetime import datetime
10
+ from typing import Dict, Any, Optional, TYPE_CHECKING
11
+
12
+ if TYPE_CHECKING:
13
+ from .http_client import ClientContext
14
+ from .predictor import Predictor
15
+ from .prediction_result import PredictionResult
16
+
17
+ logger = logging.getLogger(__name__)
18
+
19
+
20
+ @dataclass
21
+ class APIEndpoint:
22
+ """
23
+ Represents a named API endpoint for a predictor.
24
+
25
+ API endpoints allow you to create named, versioned access points for
26
+ predictions with optional API key authentication.
27
+
28
+ Attributes:
29
+ id: Endpoint ID
30
+ name: Endpoint name
31
+ predictor_id: Associated predictor ID
32
+ session_id: Parent session ID
33
+ api_key: API key (if configured)
34
+ api_key_created_at: When API key was created
35
+ description: Endpoint description
36
+ url: Full endpoint URL
37
+ created_at: Creation timestamp
38
+ last_used_at: Last usage timestamp
39
+ usage_count: Number of predictions made via this endpoint
40
+
41
+ Usage:
42
+ # Create from predictor
43
+ endpoint = predictor.create_api_endpoint(
44
+ name="production_api",
45
+ description="Production endpoint"
46
+ )
47
+ print(f"API Key: {endpoint.api_key}")
48
+
49
+ # Make predictions via endpoint
50
+ result = endpoint.predict({"age": 35, "income": 50000})
51
+ """
52
+
53
+ id: str
54
+ name: str
55
+ predictor_id: str
56
+ session_id: str
57
+ api_key: Optional[str] = None
58
+ api_key_created_at: Optional[datetime] = None
59
+ description: Optional[str] = None
60
+ url: Optional[str] = None
61
+ created_at: Optional[datetime] = None
62
+ last_used_at: Optional[datetime] = None
63
+ usage_count: int = 0
64
+
65
+ # Internal
66
+ _ctx: Optional['ClientContext'] = field(default=None, repr=False)
67
+ _predictor: Optional['Predictor'] = field(default=None, repr=False)
68
+
69
+ @classmethod
70
+ def from_response(
71
+ cls,
72
+ response: Dict[str, Any],
73
+ predictor_id: str,
74
+ session_id: str,
75
+ ctx: Optional['ClientContext'] = None,
76
+ predictor: Optional['Predictor'] = None
77
+ ) -> 'APIEndpoint':
78
+ """Create APIEndpoint from API response."""
79
+ return cls(
80
+ id=response.get('endpoint_id') or response.get('id', ''),
81
+ name=response.get('name', ''),
82
+ predictor_id=predictor_id,
83
+ session_id=session_id,
84
+ api_key=response.get('api_key'),
85
+ api_key_created_at=datetime.fromisoformat(response['api_key_created_at'])
86
+ if response.get('api_key_created_at') else None,
87
+ description=response.get('description'),
88
+ url=response.get('url') or response.get('endpoint_url'),
89
+ created_at=datetime.fromisoformat(response['created_at'])
90
+ if response.get('created_at') else datetime.now(),
91
+ last_used_at=datetime.fromisoformat(response['last_used_at'])
92
+ if response.get('last_used_at') else None,
93
+ usage_count=response.get('usage_count', 0),
94
+ _ctx=ctx,
95
+ _predictor=predictor,
96
+ )
97
+
98
+ @property
99
+ def predictor(self) -> Optional['Predictor']:
100
+ """Get the associated predictor."""
101
+ return self._predictor
102
+
103
+ def predict(
104
+ self,
105
+ record: Dict[str, Any],
106
+ api_key: Optional[str] = None
107
+ ) -> 'PredictionResult':
108
+ """
109
+ Make a prediction via this endpoint.
110
+
111
+ Args:
112
+ record: Input record dictionary
113
+ api_key: Override endpoint API key
114
+
115
+ Returns:
116
+ PredictionResult with prediction, confidence, and prediction_uuid
117
+
118
+ Example:
119
+ result = endpoint.predict(
120
+ {"age": 35, "income": 50000},
121
+ api_key="sk_live_abc123" # Optional if endpoint has key
122
+ )
123
+ print(result.predicted_class)
124
+ """
125
+ if not self._ctx:
126
+ raise ValueError("APIEndpoint not connected to client")
127
+
128
+ from .prediction_result import PredictionResult
129
+
130
+ # Clean the record
131
+ cleaned_record = self._clean_record(record)
132
+
133
+ # Build request with API key if provided
134
+ headers = {}
135
+ key_to_use = api_key or self.api_key
136
+ if key_to_use:
137
+ headers['X-API-Key'] = key_to_use
138
+
139
+ # Make request to endpoint
140
+ request_payload = {
141
+ "query_record": cleaned_record,
142
+ "predictor_id": self.predictor_id,
143
+ "endpoint_id": self.id,
144
+ }
145
+
146
+ response = self._ctx.post_json(
147
+ f"/session/{self.session_id}/predict",
148
+ data=request_payload,
149
+ headers=headers
150
+ )
151
+
152
+ # Update usage stats
153
+ self.usage_count += 1
154
+ self.last_used_at = datetime.now()
155
+
156
+ return PredictionResult.from_response(response, cleaned_record, self._ctx)
157
+
158
+ def regenerate_api_key(self) -> str:
159
+ """
160
+ Regenerate the API key for this endpoint.
161
+
162
+ Returns:
163
+ The new API key
164
+
165
+ Example:
166
+ new_key = endpoint.regenerate_api_key()
167
+ print(f"New API Key: {new_key}")
168
+ """
169
+ if not self._ctx:
170
+ raise ValueError("APIEndpoint not connected to client")
171
+
172
+ response = self._ctx.post_json(
173
+ f"/session/{self.session_id}/endpoint/{self.id}/regenerate_key",
174
+ data={}
175
+ )
176
+
177
+ self.api_key = response.get('api_key')
178
+ self.api_key_created_at = datetime.now()
179
+
180
+ return self.api_key or ""
181
+
182
+ def revoke_api_key(self) -> None:
183
+ """
184
+ Revoke/remove the API key (endpoint becomes public).
185
+
186
+ Example:
187
+ endpoint.revoke_api_key() # Endpoint now allows unauthenticated access
188
+ """
189
+ if not self._ctx:
190
+ raise ValueError("APIEndpoint not connected to client")
191
+
192
+ self._ctx.post_json(
193
+ f"/session/{self.session_id}/endpoint/{self.id}/revoke_key",
194
+ data={}
195
+ )
196
+
197
+ self.api_key = None
198
+ self.api_key_created_at = None
199
+
200
+ def get_usage_stats(self) -> Dict[str, Any]:
201
+ """
202
+ Get usage statistics for this endpoint.
203
+
204
+ Returns:
205
+ Dictionary with usage statistics
206
+
207
+ Example:
208
+ stats = endpoint.get_usage_stats()
209
+ print(f"Total predictions: {stats['usage_count']}")
210
+ print(f"Last used: {stats['last_used_at']}")
211
+ """
212
+ if not self._ctx:
213
+ raise ValueError("APIEndpoint not connected to client")
214
+
215
+ try:
216
+ response = self._ctx.get_json(
217
+ f"/session/{self.session_id}/endpoint/{self.id}/stats"
218
+ )
219
+
220
+ self.usage_count = response.get('usage_count', self.usage_count)
221
+ if response.get('last_used_at'):
222
+ self.last_used_at = datetime.fromisoformat(response['last_used_at'])
223
+
224
+ return response
225
+ except Exception:
226
+ # Return cached values if endpoint doesn't exist yet
227
+ return {
228
+ 'endpoint_id': self.id,
229
+ 'usage_count': self.usage_count,
230
+ 'last_used_at': self.last_used_at.isoformat() if self.last_used_at else None,
231
+ }
232
+
233
+ def delete(self) -> None:
234
+ """
235
+ Delete this endpoint.
236
+
237
+ Example:
238
+ endpoint.delete() # Endpoint is now deleted
239
+ """
240
+ if not self._ctx:
241
+ raise ValueError("APIEndpoint not connected to client")
242
+
243
+ self._ctx.delete_json(
244
+ f"/session/{self.session_id}/endpoint/{self.id}"
245
+ )
246
+
247
+ def _clean_record(self, record: Dict[str, Any]) -> Dict[str, Any]:
248
+ """Clean a record for API submission."""
249
+ import math
250
+
251
+ cleaned = {}
252
+ for key, value in record.items():
253
+ if isinstance(value, float):
254
+ if math.isnan(value) or math.isinf(value):
255
+ value = None
256
+ if hasattr(value, 'item'):
257
+ value = value.item()
258
+ cleaned[key] = value
259
+ return cleaned
260
+
261
+ def to_dict(self) -> Dict[str, Any]:
262
+ """Convert to dictionary representation."""
263
+ return {
264
+ 'id': self.id,
265
+ 'name': self.name,
266
+ 'predictor_id': self.predictor_id,
267
+ 'session_id': self.session_id,
268
+ 'api_key': self.api_key,
269
+ 'api_key_created_at': self.api_key_created_at.isoformat()
270
+ if self.api_key_created_at else None,
271
+ 'description': self.description,
272
+ 'url': self.url,
273
+ 'created_at': self.created_at.isoformat() if self.created_at else None,
274
+ 'last_used_at': self.last_used_at.isoformat() if self.last_used_at else None,
275
+ 'usage_count': self.usage_count,
276
+ }
277
+
278
+ def __repr__(self) -> str:
279
+ key_str = ", has_key=True" if self.api_key else ""
280
+ return f"APIEndpoint(id='{self.id}', name='{self.name}'{key_str})"