featrixsphere 0.2.1237__tar.gz → 0.2.1314__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 (19) hide show
  1. {featrixsphere-0.2.1237/featrixsphere.egg-info → featrixsphere-0.2.1314}/PKG-INFO +1 -1
  2. featrixsphere-0.2.1314/VERSION +1 -0
  3. {featrixsphere-0.2.1237 → featrixsphere-0.2.1314}/featrixsphere/__init__.py +1 -1
  4. {featrixsphere-0.2.1237 → featrixsphere-0.2.1314}/featrixsphere/client.py +3 -83
  5. {featrixsphere-0.2.1237 → featrixsphere-0.2.1314/featrixsphere.egg-info}/PKG-INFO +1 -1
  6. featrixsphere-0.2.1237/VERSION +0 -1
  7. {featrixsphere-0.2.1237 → featrixsphere-0.2.1314}/MANIFEST.in +0 -0
  8. {featrixsphere-0.2.1237 → featrixsphere-0.2.1314}/README.md +0 -0
  9. {featrixsphere-0.2.1237 → featrixsphere-0.2.1314}/featrixsphere/cli.py +0 -0
  10. {featrixsphere-0.2.1237 → featrixsphere-0.2.1314}/featrixsphere/test_client.py +0 -0
  11. {featrixsphere-0.2.1237 → featrixsphere-0.2.1314}/featrixsphere.egg-info/SOURCES.txt +0 -0
  12. {featrixsphere-0.2.1237 → featrixsphere-0.2.1314}/featrixsphere.egg-info/dependency_links.txt +0 -0
  13. {featrixsphere-0.2.1237 → featrixsphere-0.2.1314}/featrixsphere.egg-info/entry_points.txt +0 -0
  14. {featrixsphere-0.2.1237 → featrixsphere-0.2.1314}/featrixsphere.egg-info/not-zip-safe +0 -0
  15. {featrixsphere-0.2.1237 → featrixsphere-0.2.1314}/featrixsphere.egg-info/requires.txt +0 -0
  16. {featrixsphere-0.2.1237 → featrixsphere-0.2.1314}/featrixsphere.egg-info/top_level.txt +0 -0
  17. {featrixsphere-0.2.1237 → featrixsphere-0.2.1314}/requirements.txt +0 -0
  18. {featrixsphere-0.2.1237 → featrixsphere-0.2.1314}/setup.cfg +0 -0
  19. {featrixsphere-0.2.1237 → featrixsphere-0.2.1314}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: featrixsphere
3
- Version: 0.2.1237
3
+ Version: 0.2.1314
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.1314
@@ -38,7 +38,7 @@ Example:
38
38
  ... labels=['Experiment A', 'Experiment B'])
39
39
  """
40
40
 
41
- __version__ = "0.2.1237"
41
+ __version__ = "0.2.1314"
42
42
  __author__ = "Featrix"
43
43
  __email__ = "support@featrix.com"
44
44
  __license__ = "MIT"
@@ -1727,48 +1727,6 @@ class FeatrixSphereClient:
1727
1727
  # File Upload
1728
1728
  # =========================================================================
1729
1729
 
1730
- def upload_file(self, file_path: str) -> str:
1731
- """
1732
- Upload a file to the server without creating a session.
1733
- Returns the filename that can be used in training requests.
1734
-
1735
- Args:
1736
- file_path: Path to the file to upload
1737
-
1738
- Returns:
1739
- Filename (relative path) that can be used in training requests
1740
- """
1741
- from pathlib import Path as PathLib
1742
- file_path_obj = PathLib(file_path)
1743
- if not file_path_obj.exists():
1744
- raise FileNotFoundError(f"File not found: {file_path}")
1745
-
1746
- with open(file_path_obj, 'rb') as f:
1747
- files = {'file': (file_path_obj.name, f, 'text/csv' if file_path_obj.suffix == '.csv' else 'application/gzip')}
1748
- response = self._make_request("POST", "/compute/upload_file", files=files)
1749
-
1750
- response_data = response.json()
1751
-
1752
- # Handle S3 upload response (returns s3_url and filename)
1753
- if 's3_url' in response_data:
1754
- # S3 upload - extract filename from key or use returned filename
1755
- filename = response_data.get('filename')
1756
- if not filename:
1757
- # Extract from S3 key if filename not provided
1758
- s3_key = response_data.get('key', '')
1759
- if s3_key:
1760
- filename = PathLib(s3_key).name
1761
- if not filename:
1762
- raise ValueError("Server did not return filename in S3 upload response")
1763
- return filename
1764
-
1765
- # Handle local file upload response (returns filename)
1766
- filename = response_data.get('filename')
1767
- if not filename:
1768
- raise ValueError("Server did not return filename in upload response")
1769
-
1770
- return filename
1771
-
1772
1730
  def upload_file_and_create_session(self, file_path: Path, session_name_prefix: str = None, name: str = None, webhooks: Dict[str, str] = None) -> SessionInfo:
1773
1731
  """
1774
1732
  Upload a CSV, Parquet, JSON, or JSONL file and create a new session.
@@ -4159,7 +4117,6 @@ class FeatrixSphereClient:
4159
4117
  epochs: int = 0,
4160
4118
  rare_label_value: str = None,
4161
4119
  class_imbalance: dict = None,
4162
- optimize_for: str = "balanced",
4163
4120
  poll_interval: int = 30, max_poll_time: int = 3600,
4164
4121
  verbose: bool = True,
4165
4122
  webhooks: Dict[str, str] = None) -> SessionInfo:
@@ -4182,7 +4139,6 @@ class FeatrixSphereClient:
4182
4139
  epochs: Number of training epochs (default: 0; automatic)
4183
4140
  rare_label_value: For binary classification, which class is the rare/minority class for metrics (default: None)
4184
4141
  class_imbalance: Expected class ratios/counts from real world for sampled data (default: None)
4185
- optimize_for: Optimization target - "balanced" (F1 score), "precision", or "recall" (default: "balanced")
4186
4142
  poll_interval: Seconds between status checks when job is already running (default: 30)
4187
4143
  max_poll_time: Maximum time to poll in seconds (default: 3600 = 1 hour)
4188
4144
  verbose: Whether to print status updates during polling (default: True)
@@ -4220,7 +4176,6 @@ class FeatrixSphereClient:
4220
4176
  "target_column": target_column,
4221
4177
  "target_column_type": target_column_type,
4222
4178
  "epochs": str(epochs),
4223
- "optimize_for": optimize_for,
4224
4179
  }
4225
4180
 
4226
4181
  # Handle file upload - send file directly in multipart form
@@ -4339,7 +4294,6 @@ class FeatrixSphereClient:
4339
4294
  validation_ignore_columns: List[str] = None,
4340
4295
  rare_label_value: str = None,
4341
4296
  class_imbalance: dict = None,
4342
- optimize_for: str = "balanced",
4343
4297
  cost_false_positive: float = None,
4344
4298
  cost_false_negative: float = None,
4345
4299
  poll_interval: int = 30, max_poll_time: int = 3600,
@@ -4519,24 +4473,6 @@ class FeatrixSphereClient:
4519
4473
  This happens automatically - no configuration needed. The system invests a few seconds
4520
4474
  in analysis to deliver significantly better models.
4521
4475
 
4522
- Understanding optimize_for:
4523
- ---------------------------
4524
- The optimize_for parameter controls which loss function and training strategy is used,
4525
- optimizing for different aspects of model performance:
4526
-
4527
- - "balanced" (default): Optimizes for F1 score (harmonic mean of precision and recall).
4528
- Uses FocalLoss with class weights. Best for general-purpose classification where you
4529
- want balanced performance across all classes.
4530
-
4531
- - "precision": Optimizes for precision (minimizing false positives). Uses FocalLoss with
4532
- class weights, which focuses training on hard-to-classify examples. Best when false
4533
- positives are costly (e.g., fraud detection where flagging legitimate transactions
4534
- as fraud is expensive).
4535
-
4536
- - "recall": Optimizes for recall (minimizing false negatives). Uses CrossEntropyLoss
4537
- with class weights that strongly boost the minority class. Best when false negatives
4538
- are costly (e.g., medical diagnosis where missing a disease is dangerous).
4539
-
4540
4476
  Understanding class_imbalance:
4541
4477
  ------------------------------
4542
4478
  For imbalanced datasets where your training data doesn't reflect real-world class
@@ -4657,7 +4593,6 @@ class FeatrixSphereClient:
4657
4593
  target_column='approved',
4658
4594
  target_column_type='set',
4659
4595
  class_imbalance={'approved': 0.97, 'rejected': 0.03},
4660
- optimize_for='recall', # Don't miss rejections
4661
4596
  rare_label_value='rejected'
4662
4597
  )
4663
4598
 
@@ -4678,7 +4613,6 @@ class FeatrixSphereClient:
4678
4613
  target_column='is_fraud',
4679
4614
  target_column_type='set',
4680
4615
  rare_label_value='fraud',
4681
- optimize_for='precision', # Minimize false alarms
4682
4616
  class_imbalance={'legitimate': 0.999, 'fraud': 0.001}
4683
4617
  )
4684
4618
  ```
@@ -4692,8 +4626,7 @@ class FeatrixSphereClient:
4692
4626
  session_id=session.session_id,
4693
4627
  target_column='has_disease',
4694
4628
  target_column_type='set',
4695
- rare_label_value='positive',
4696
- optimize_for='recall' # Don't miss any cases
4629
+ rare_label_value='positive'
4697
4630
  )
4698
4631
  ```
4699
4632
 
@@ -4735,14 +4668,6 @@ class FeatrixSphereClient:
4735
4668
  validation_ignore_columns: List of column names to exclude from validation queries (default: None)
4736
4669
  rare_label_value: For binary classification, which class is the rare/minority class for metrics (default: None)
4737
4670
  class_imbalance: Expected class ratios/counts from real world for sampled data (default: None)
4738
- optimize_for: Optimization target - "balanced" (F1 score), "precision", or "recall" (default: "balanced").
4739
- Ignored if cost_false_positive and cost_false_negative are provided.
4740
- cost_false_positive: Cost of a false positive (predicting positive when actually negative).
4741
- Must be specified together with cost_false_negative. Only valid for target_column_type="set".
4742
- When provided, overrides optimize_for and uses cost-based optimization.
4743
- cost_false_negative: Cost of a false negative (predicting negative when actually positive).
4744
- Must be specified together with cost_false_positive. Only valid for target_column_type="set".
4745
- When provided, overrides optimize_for and uses cost-based optimization.
4746
4671
  poll_interval: Seconds between status checks when job is already running (default: 30)
4747
4672
  max_poll_time: Maximum time to poll in seconds (default: 3600 = 1 hour)
4748
4673
  verbose: Whether to print status updates during polling (default: True)
@@ -4769,7 +4694,6 @@ class FeatrixSphereClient:
4769
4694
  raise ValueError("cost_false_positive and cost_false_negative must be positive numbers")
4770
4695
  if verbose:
4771
4696
  print(f"💰 Cost-based optimization enabled: FP cost={cost_false_positive}, FN cost={cost_false_negative}")
4772
- print(f" (optimize_for='{optimize_for}' will be ignored)")
4773
4697
 
4774
4698
  # If DataFrame provided, save to temp file and use file_path logic
4775
4699
  temp_file = None
@@ -4803,7 +4727,6 @@ class FeatrixSphereClient:
4803
4727
  epochs=epochs,
4804
4728
  rare_label_value=rare_label_value,
4805
4729
  class_imbalance=class_imbalance,
4806
- optimize_for=optimize_for,
4807
4730
  cost_false_positive=cost_false_positive,
4808
4731
  cost_false_negative=cost_false_negative,
4809
4732
  verbose=verbose,
@@ -4817,8 +4740,7 @@ class FeatrixSphereClient:
4817
4740
  "epochs": epochs,
4818
4741
  "validation_ignore_columns": validation_ignore_columns or [],
4819
4742
  "rare_label_value": rare_label_value,
4820
- "class_imbalance": class_imbalance,
4821
- "optimize_for": optimize_for
4743
+ "class_imbalance": class_imbalance
4822
4744
  }
4823
4745
  if cost_false_positive is not None and cost_false_negative is not None:
4824
4746
  data["cost_false_positive"] = cost_false_positive
@@ -5395,7 +5317,6 @@ class FeatrixSphereClient:
5395
5317
  epochs: int,
5396
5318
  rare_label_value: str,
5397
5319
  class_imbalance: dict,
5398
- optimize_for: str,
5399
5320
  cost_false_positive: float = None,
5400
5321
  cost_false_negative: float = None,
5401
5322
  verbose: bool = True,
@@ -5423,8 +5344,7 @@ class FeatrixSphereClient:
5423
5344
  data = {
5424
5345
  'target_column': target_column,
5425
5346
  'target_column_type': target_column_type,
5426
- 'epochs': str(epochs),
5427
- 'optimize_for': optimize_for,
5347
+ 'epochs': str(epochs)
5428
5348
  }
5429
5349
 
5430
5350
  if rare_label_value:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: featrixsphere
3
- Version: 0.2.1237
3
+ Version: 0.2.1314
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
@@ -1 +0,0 @@
1
- 0.2.1237